Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

aws-cloudformation-deploy parameter issue

Henk Bakker February 24, 2020

All,

I am using the aws-cloudformation-deploy to deploy my code. But I want to put  the stack parameters in a separate JSON file to keep the bitbucket-pipelines.yaml file a bit cleaner. 

when I add: STACK_PARAMETERS"./cloudformation/test.json"

content of file:

[{    "ParameterKey": "COUNT",   

      "ParameterValue": "20"     

 }]

I get this error:

botocore.exceptions.ParamValidationError: Parameter validation failed:Invalid type for parameter Parameters, value: ./cloudformation/test.json, type: <class 'str'>, valid types: <class 'list'>, <class 'tuple'>

1 answer

1 accepted

2 votes
Answer accepted
Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 25, 2020

The value for STACK_PARAMETERS has to be a json string, not a path to a json document. You can read the json document from a file and assign it to a variable to be used in the pipe:

 

script:
- export PARAMETERS=$(cat ./cloudformation/test.json)
- pipe: atlassian/aws-cloudformation-deploy:0.6.4
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: PARAMETERS

Henk Bakker February 26, 2020

Thanks. that worked out beautifully. 

Like Alexander Zhukov likes this
Rob Larmon March 5, 2021

Would love examples like this in the documentation.  Thank you!!!

Peter Smith April 18, 2021

I think the final line of the example is missing a dollar sign and should be:

 STACK_PARAMETERS: $PARAMETERS



Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events