-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kim Fehrs
authored
May 5, 2023
1 parent
34d8e6b
commit 63b6901
Showing
4 changed files
with
151 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: fetch-secrets | ||
|
||
inputs: | ||
role_name: | ||
type: string | ||
required: true | ||
region: | ||
type: string | ||
required: false | ||
default: "eu-west-2" | ||
app_name: | ||
type: string | ||
required: true | ||
description: "Used for naming role session to audit secrets access" | ||
step_name: | ||
type: string | ||
required: true | ||
description: "Used for naming role session to audit secrets access because app_name is not enough" | ||
secret_name: | ||
type: string | ||
required: true | ||
secret_prefix: | ||
type: string | ||
required: true | ||
parse_json: | ||
type: boolean | ||
required: false | ||
default: "false" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install AWS CLI | ||
uses: unfor19/install-aws-cli-action@ee0eb151cf1bca186ccf8c35d314b08d62e0e878 # v1 | ||
with: | ||
version: 2 | ||
|
||
- name: Configure AWS credentials to fetch secrets | ||
uses: aws-actions/configure-aws-credentials@97271860067ec931c45b8d104fbf0d15954ab85c # branch v1-node16 | ||
with: | ||
role-to-assume: ${{ inputs.role_name }} | ||
aws-region: ${{ inputs.region }} | ||
role-session-name: ${{ inputs.app_name }}-${{ github.run_id }}-${{ github.run_attempt }} | ||
|
||
- name: Fetch AWS secrets | ||
uses: aws-actions/aws-secretsmanager-get-secrets@287592d14d9c9c48199db83dc182ae12af3df18e # v1.0.1 | ||
with: | ||
secret-ids: | | ||
${{ inputs.secret_prefix }}, ${{ inputs.secret_name }} | ||
parse-json-secrets: ${{ inputs.parse_json }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters