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.