Skip to content

Commit

Permalink
fix: Check if KeyId is populated if ssm-value-type is SecureString
Browse files Browse the repository at this point in the history
  • Loading branch information
dwardu89 committed Feb 4, 2021
1 parent dbbc718 commit 1e37288
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Add to SSM Step
id: add_to_ssm
- name: Add SecureString to SSM
id: add_to_ssm_secure_string
uses: ./
with:
ssm-path: "/dwardu89/hello"
ssm-value: ${{ secrets.SSM_VALUE_EXAMPLE }}
aws-region: eu-west-1
- name: Add String to SSM Step
id: add_to_ssm_string
uses: ./
with:
ssm-path: "/dwardu89/hello"
ssm-value: ${{ secrets.SSM_VALUE_EXAMPLE }}
ssm-value-type: "String"
aws-region: eu-west-1
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ try {
Value: core.getInput('ssm-value', { required: true }),
Type: core.getInput('ssm-value-type', { required: true }),
Overwrite: core.getInput('ssm-value-overwrite', { required: true }),
KeyId: core.getInput('ssm-kms-key-id'),
Description: core.getInput('ssm-value-description')
}
const keyId = core.getInput('ssm-kms-key-id')
if (params['Type'] === "SecureString" && keyId !== '') {
params['KeyId'] = keyId
}
ssm.putParameter(params).then(value => {
console.log(`Successfully Stored parameter in path [${value}]`);
}).catch(reason => {
Expand Down

0 comments on commit 1e37288

Please sign in to comment.