I want to run a bash command in AWS Cloudforamtion. I find this on internet.
Resources:
CommandRunner:
Type: AWSUtility::CloudFormation::CommandRunner
Properties:
Command: 'aws ssm get-parameter --name BucketName --region us-east-1 --query Parameter.Value --output text > /command-output.txt'
I installed this private registry in my was account. When I use this utility, It creates a new stack and starts to deploy new resources like security groups, logs, and EC2 instance.
When it comes to create EC2 instance. It gives an error:
Your requested instance type (t3.micro) is not supported in your requested Availability Zone (us-east-1e). Please retry your request by not specifying an Availability Zone or choosing us-east-1a, us-east-1b, us-east-1c, us-east-1d, us-east-1f. (Service: AmazonEC2; Status Code: 400; Error Code: Unsupported; Request ID: e1f9xyz; Proxy: null)
I followed this link:
https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-commandrunner-stack/
Can anyone help me with how to run a bash script in a cloud formation template?
SubnetId
. So choose subnet in AZ where t3.micros are available. – Marcin