Skip to content

Commit

Permalink
feat: Add SSM parameter ARN and name to outputs (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantbiggs authored Oct 1, 2024
1 parent 2301490 commit 6ae2c60
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 23 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ on:
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
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:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- master

env:
TERRAFORM_DOCS_VERSION: v0.16.0
TERRAFORM_DOCS_VERSION: v0.19.0

jobs:
collectInputs:
Expand All @@ -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
Expand All @@ -32,26 +32,26 @@ 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 }}/*'

- 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)'
Expand All @@ -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 }}
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/semantic-releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].0
@semantic-release/[email protected].0
conventional-changelog-conventionalcommits@4.6.3
@semantic-release/[email protected].3
@semantic-release/[email protected].1
conventional-changelog-conventionalcommits@7.0.2
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ Examples codified under the [`examples`](https://github.com/clowdhaus/terraform-

| Name | Description |
|------|-------------|
| <a name="output_ssm_parameter_arn"></a> [ssm\_parameter\_arn](#output\_ssm\_parameter\_arn) | The ARN of the SSM parameter storing the snapshot name |
| <a name="output_ssm_parameter_name"></a> [ssm\_parameter\_name](#output\_ssm\_parameter\_name) | The name of the SSM parameter storing the snapshot name |
| <a name="output_start_execution_command"></a> [start\_execution\_command](#output\_start\_execution\_command) | Example awscli command to start the state machine execution |
<!-- END_TF_DOCS -->

Expand Down
2 changes: 2 additions & 0 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ No inputs.

| Name | Description |
|------|-------------|
| <a name="output_ssm_parameter_arn"></a> [ssm\_parameter\_arn](#output\_ssm\_parameter\_arn) | The ARN of the SSM parameter storing the snapshot name |
| <a name="output_ssm_parameter_name"></a> [ssm\_parameter\_name](#output\_ssm\_parameter\_name) | The name of the SSM parameter storing the snapshot name |
| <a name="output_start_execution_command"></a> [start\_execution\_command](#output\_start\_execution\_command) | Example awscli command to start the state machine execution |
<!-- END_TF_DOCS -->

Expand Down
14 changes: 14 additions & 0 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
14 changes: 14 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion state_machine.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,4 @@
"End": true
}
}
}
}

0 comments on commit 6ae2c60

Please sign in to comment.