Skip to content

Commit

Permalink
Fixi CFN capability handling
Browse files Browse the repository at this point in the history
Must be space-delimited
  • Loading branch information
tmclaugh committed Sep 10, 2024
1 parent 95561c9 commit 6848dc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ See below for inputs, outputs, and examples.

- `aws_account_id` (required): Account ID of the account to deploy to.
- `aws_region` (optional): Region to deploy to. If not set, will use AWS_REGION set by [gha-assume-aws-credentials](https://github.com/ServerlessOpsIO/gha-assume-aws-credentials)
- `cfn_capabilities` (optional): Comma-separated list of capabilities to enable. (values: CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, CAPABILITY_RESOURCE_POLICY)
- `cfn_capabilities` (optional): space-separated list of capabilities to enable. (values: CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND, CAPABILITY_RESOURCE_POLICY)
- `cfn_exec_role_name` (optional): Name of the optional CloudFormation IAM execution role.
- `cfn_parameters_file` (optional): Name of the CloudFormation parameters file. Default is `cfn-parameters.json`.
- `cfn_tags_file` (optional): Name of the CloudFormation tags file. Default is `cfn-tags.json`.
Expand Down
15 changes: 8 additions & 7 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ inputs:
description: Region to deploy to
required: false
cfn_capabilities:
description: "Comma separated list of capabilities to enable. (values: CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, CAPABILITY_RESOURCE_POLICY)"
description: "Space separated list of capabilities to enable. (values: CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND, CAPABILITY_RESOURCE_POLICY)"
required: false
default: CAPABILITY_IAM,CAPABILITY_NAMED_IAM
default: CAPABILITY_NAMED_IAM
cfn_exec_role_name:
description: Name of CloudFormation IAM execution role
required: false
Expand Down Expand Up @@ -120,7 +120,7 @@ runs:
"org:commit=${GITHUB_SHA}",
"org:stackName=${STACK_NAME}"
] |
join(",")
join(" ")
'
)
echo "Resolved Cloudformation tags: ${AWS_CFN_TAGS}"
Expand All @@ -144,7 +144,7 @@ runs:
-r '
to_entries |
map("\(.key)=\(.value|tostring)") |
join(",")
join(" ")
'
)
echo "Resolved CFN parameters: $AWS_CFN_PARAMS"
Expand All @@ -160,6 +160,7 @@ runs:
S3_PREFIX: ${{ steps.set-sam-s3-prefix.outputs.s3-prefix }}
STACK_NAME: ${{ steps.set-stack-name.outputs.name }}
TEMPLATE_FILE: ${{ inputs.template_file }}
CAPABILITIES: ${{ inputs.cfn_capabilities }}
CFN_TAGS: ${{ steps.process-aws-tags.outputs.tags }}
CFN_PARAMS: ${{ steps.process-aws-parameters.outputs.parameters }}
shell: bash
Expand All @@ -172,6 +173,6 @@ runs:
--role-arn arn:aws:iam::${ACCOUNT_ID}:role/${CFN_EXEC_ROLE} \
--region ${REGION} \
--on-failure DELETE \
--capabilities ${{ inputs.cfn_capabilities }} \
--parameter-overrides "${CFN_PARAMS}" \
--tags "${CFN_TAGS}"
--capabilities ${CAPABILITIES} \
--parameter-overrides ${CFN_PARAMS} \
--tags ${CFN_TAGS}

0 comments on commit 6848dc6

Please sign in to comment.