List latest Amazon Linux AMI ID from deployed regions as JSON.
git clone https://github.com/clifflu/sam-aws-linux-ami-list
cd sam-aws-linux-ami-list
npm install
aws cloudformation package \
--template-file template.yaml \
--output-template-file packaged-template.yaml \
--s3-bucket bucket-name
Replace bucket-name with bucket name for deploy artifact.
aws cloudformation deploy \
--template-file packaged-template.yaml \
--capabilities CAPABILITY_IAM \
--stack-name my-new-stack
rm packaged-template.yaml
Replace my-new-stack with CloudFormation stack name.
Note: Replace my-new-stack with CloudFormation stack name.
aws cloudformation describe-stacks \
--output text \
--query "Stacks[0].Outputs[?OutputKey=='EndPoint'].OutputValue | [0]" \
--stack-name my-new-stack
wget -qO- `aws cloudformation describe-stacks \
--output text \
--query "Stacks[0].Outputs[?OutputKey=='EndPoint'].OutputValue | [0]" \
--stack-name my-new-stack`
{
"us-west-2": {
"EcsHvm64": "ami-3702ca4f",
"Ec2Hvm64":"ami-e689729e",
"NatHvm64":"ami-d08b70a8"
}
}
- EcsHvm64: ECS-Optimized, HVM x86_64
- Ec2Hvm64: Amazon Linux AMI, HVM x86_64
- NatHvm64: NAT instance, HVM x86_64
MIT