How Do You Pass Parameters Using Boto?

Problem scenario
You want to run a Boto program. But there is an error about necessary parameters not being assigned.

You see a message like this:

botocore.exceptions.ClientError: An error occurred (ValidationError) when calling the CreateStack operation: Parameters: [KeyName, DBPassword, DBUser] must have values

Where can you see an example of parameters being passed?

Updated on 3/15/21.
Here is a working program:

import boto3
cloudf = boto3.client('cloudformation', region_name='us-west-1', aws_access_key_id='AKIAabcdefgh12345', aws_secret_access_key='SOMETHING1234here/moretext')
json_stack=open('lampstack.json', 'r').read()
cloudf.create_stack(StackName='continualstack', TemplateBody=json_stack, Parameters = [ { 'ParameterKey': 'KeyName', 'ParameterValue': 'foobar'}, {'ParameterKey': 'DBPassword', 'ParameterValue': 'verycont'}, {'ParameterKey': 'DBUser', 'ParameterValue': 'contuser'}, {'ParameterKey': 'DBRootPassword', 'ParameterValue': 'contpassword'}] )

Leave a comment

Your email address will not be published. Required fields are marked *