From 6ae2c609f2e0f77d1db573250fe7cbd22cb933b1 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Tue, 1 Oct 2024 18:07:29 -0500 Subject: [PATCH] feat: Add SSM parameter ARN and name to outputs (#1) --- .github/workflows/pr-title.yml | 5 ++++- .github/workflows/pre-commit.yml | 20 ++++++++++---------- .github/workflows/semantic-releaser.yml | 17 ++++++----------- README.md | 2 ++ examples/complete/README.md | 2 ++ examples/complete/outputs.tf | 14 ++++++++++++++ outputs.tf | 14 ++++++++++++++ state_machine.json | 2 +- 8 files changed, 53 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index cb32a0f..f4bf439 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -7,6 +7,9 @@ on: - edited - synchronize +permissions: + pull-requests: read + jobs: main: name: Validate PR title @@ -14,7 +17,7 @@ jobs: steps: # Please look up the latest version from # https://github.com/amannn/action-semantic-pull-request/releases - - uses: amannn/action-semantic-pull-request@v5.0.2 + - uses: amannn/action-semantic-pull-request@v5.5.3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 398a2de..5a36e10 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -7,7 +7,7 @@ on: - master env: - TERRAFORM_DOCS_VERSION: v0.16.0 + TERRAFORM_DOCS_VERSION: v0.19.0 jobs: collectInputs: @@ -17,11 +17,11 @@ jobs: directories: ${{ steps.dirs.outputs.directories }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get root directories id: dirs - uses: clowdhaus/terraform-composite-actions/directories@v1.8.3 + uses: clowdhaus/terraform-composite-actions/directories@v1.9.0 preCommitMinVersions: name: Min TF pre-commit @@ -32,18 +32,18 @@ jobs: directory: ${{ fromJson(needs.collectInputs.outputs.directories) }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Terraform min/max versions id: minMax - uses: clowdhaus/terraform-min-max@v1.2.4 + uses: clowdhaus/terraform-min-max@v1.3.0 with: directory: ${{ matrix.directory }} - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} # Run only validate pre-commit check on min version supported if: ${{ matrix.directory != '.' }} - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3 + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 with: terraform-version: ${{ steps.minMax.outputs.minVersion }} args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*' @@ -51,7 +51,7 @@ jobs: - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} # Run only validate pre-commit check on min version supported if: ${{ matrix.directory == '.' }} - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3 + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 with: terraform-version: ${{ steps.minMax.outputs.minVersion }} args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)' @@ -62,17 +62,17 @@ jobs: needs: collectInputs steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} repository: ${{github.event.pull_request.head.repo.full_name}} - name: Terraform min/max versions id: minMax - uses: clowdhaus/terraform-min-max@v1.2.4 + uses: clowdhaus/terraform-min-max@v1.3.0 - name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }} - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3 + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 with: terraform-version: ${{ steps.minMax.outputs.maxVersion }} terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }} diff --git a/.github/workflows/semantic-releaser.yml b/.github/workflows/semantic-releaser.yml index 8f98009..68ca35b 100644 --- a/.github/workflows/semantic-releaser.yml +++ b/.github/workflows/semantic-releaser.yml @@ -14,23 +14,18 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 persist-credentials: false - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 16 - - name: Release - uses: cycjimmy/semantic-release-action@v3 + uses: cycjimmy/semantic-release-action@v4 with: - semantic_version: 18.0.0 + semantic_version: 23.0.2 extra_plugins: | - @semantic-release/changelog@6.0.0 - @semantic-release/git@10.0.0 - conventional-changelog-conventionalcommits@4.6.3 + @semantic-release/changelog@6.0.3 + @semantic-release/git@10.0.1 + conventional-changelog-conventionalcommits@7.0.2 env: GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE }} diff --git a/README.md b/README.md index 74e790e..39bc378 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,8 @@ Examples codified under the [`examples`](https://github.com/clowdhaus/terraform- | Name | Description | |------|-------------| +| [ssm\_parameter\_arn](#output\_ssm\_parameter\_arn) | The ARN of the SSM parameter storing the snapshot name | +| [ssm\_parameter\_name](#output\_ssm\_parameter\_name) | The name of the SSM parameter storing the snapshot name | | [start\_execution\_command](#output\_start\_execution\_command) | Example awscli command to start the state machine execution | diff --git a/examples/complete/README.md b/examples/complete/README.md index c61c98e..f9a175f 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -59,6 +59,8 @@ No inputs. | Name | Description | |------|-------------| +| [ssm\_parameter\_arn](#output\_ssm\_parameter\_arn) | The ARN of the SSM parameter storing the snapshot name | +| [ssm\_parameter\_name](#output\_ssm\_parameter\_name) | The name of the SSM parameter storing the snapshot name | | [start\_execution\_command](#output\_start\_execution\_command) | Example awscli command to start the state machine execution | diff --git a/examples/complete/outputs.tf b/examples/complete/outputs.tf index d7f2587..b41dbf6 100644 --- a/examples/complete/outputs.tf +++ b/examples/complete/outputs.tf @@ -2,3 +2,17 @@ output "start_execution_command" { description = "Example awscli command to start the state machine execution" value = module.ebs_snapshot_builder.start_execution_command } + +################################################################################ +# Snapshot SSM Parameter +################################################################################ + +output "ssm_parameter_arn" { + description = "The ARN of the SSM parameter storing the snapshot name" + value = module.ebs_snapshot_builder.ssm_parameter_arn +} + +output "ssm_parameter_name" { + description = "The name of the SSM parameter storing the snapshot name" + value = module.ebs_snapshot_builder.ssm_parameter_name +} diff --git a/outputs.tf b/outputs.tf index 2bd1e74..e33bae6 100644 --- a/outputs.tf +++ b/outputs.tf @@ -12,3 +12,17 @@ output "start_execution_command" { ))} EOT } + +################################################################################ +# Snapshot SSM Parameter +################################################################################ + +output "ssm_parameter_arn" { + description = "The ARN of the SSM parameter storing the snapshot name" + value = try(aws_ssm_parameter.snapshot_id[0].arn, null) +} + +output "ssm_parameter_name" { + description = "The name of the SSM parameter storing the snapshot name" + value = try(aws_ssm_parameter.snapshot_id[0].name, null) +} diff --git a/state_machine.json b/state_machine.json index b85c5c8..718262a 100644 --- a/state_machine.json +++ b/state_machine.json @@ -357,4 +357,4 @@ "End": true } } -} \ No newline at end of file +}