You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I have the need to update a cloudformation stack with some new parameters. I would like to do that using the aws cloudformation pipe like this:
script:
- pipe: atlassian/aws-cloudformation-deploy:0.13.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-east-1'
STACK_NAME: 'my-stack-name'
TEMPLATE: 'https://s3.amazonaws.com/cfn-deploy-pipe/cfn-template.json'
STACK_PARAMETERS: >
[{
"ParameterKey": "KeyName",
"ParameterValue": "mykey"
},
{
"ParameterKey": "DBUser",
"ParameterValue": "mydbuser"
},
{
"ParameterKey": "DBPassword",
"ParameterValue": $DB_PASSWORD
But I also have parameters that I won't define in my pipeline and simply use what the previous value was for the parameter, which I would have setup manually through the aws console. This is how I would do it using the aws cli:
aws cloudformation update-stack --stack-name stack-name --use-previous-template --parameters ParameterKey=KeyName,ParameterValue=mykey ParameterKey=DBPassword,UsePreviousValue=true
Does the aws cloudformation pipe support the use of previous values in the STACK_PARAMETERS option?
@Adam Whiteland hi. Thanks for your question.
You should use extra parameters:
script:
- pipe: atlassian/aws-cloudformation-deploy:0.13.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-east-1'
STACK_NAME: 'my-stack-name'
TEMPLATE: 'https://s3.amazonaws.com/cfn-deploy-pipe/cfn-template.json'
STACK_PARAMETERS: >
[{
"ParameterKey": "KeyName",
"ParameterValue": "mykey"
},
{
"ParameterKey": "DBUser",
"ParameterValue": "mydbuser"
},
{
"ParameterKey": "DBPassword",
"ParameterValue": $DB_PASSWORD
}]
EXTRA_PARAMETERS: > { "UsePreviousTemplate": true
}
Regards, Igor
I don't think UsePreviousTemplate (for a stack) and UsePreviousValue (for a stack param) are the same.
This is how they are different:
You don't need to specify the template if you use UsePreviousTemplate.
You don't need to specify the parameter value if you use UsePreviousValue.
I couldn't find any doc on the cloudformation pipe which clearly says that UsePreviousValue is supported.
Can you please specify some link to a doc to verify this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ashish Kataria hi. Our pipe based on boto3 implementation.
Here is link to boto3 cloudformation update stack.
In pipe it should work something like this:
EXTRA_PARAMETERS: > { "UsePreviousTemplate": true,
"Parameters":[ { 'ParameterKey': 'string', 'ParameterValue': 'string', 'UsePreviousValue': True|False, 'ResolvedValue': 'string' } ]
}
Also link to amazon guide
Regards, Igor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.