arn:aws:s3:::${TrailBucket}/AWSLogs/${AWS::AccountId}/*
AWS_PROFILE=admin-account AWS_REGION=ap-northeast-1 STACK_SET_NAME=example DELETE_ACCOUNTS="123456789012 123456789013" aws cloudformation delete-stack-instances --stack-set-name "$STACK_SET_NAME" --accounts $DELETE_ACCOUNTS --regions $AWS_REGION --retain-stacks --profile $AWS_PROFILE
{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "vpc6c2d5a0b": { "Type": "AWS::EC2::VPC", "Properties": { "CidrBlock": "172.31.0.0/16", "InstanceTenancy": "default", "EnableDnsSupport": "true", "EnableDnsHostnames": "true" } }, "traildefault": { "Type": "AWS::CloudTrail::Trail", "Properties": { "IncludeGlobalServiceEvents": true, "IsLogging": "true", "S3BucketName": "cloudtrail-bucket-example" } }, "dchpassoc1": { "Type": "AWS::EC2::VPCDHCPOptionsAssociation", "Properties": { "VpcId": { "Ref": "vpc****" }, "DhcpOptionsId": "dopt-****" } } }, "Description": "" }
AWSTemplateFormatVersion: "2010-09-09" Mappings: RegionMap: us-east-1: HVM64: ami-0ff8a91507f77f867 HVMG2: ami-0a584ac55a7631c0c us-west-1: HVM64: ami-0bdb828fd58c52235 HVMG2: ami-066ee5fd4a9ef77f1 ... Resources: myEC2Instance: Type: "AWS::EC2::Instance" Properties: ImageId: !FindInMap [RegionMap, !Ref "AWS::Region", HVM64]
aws cloudformation validate-template --template-body file://cloudformation/example.yml --profile example
- Version: 2012-10-17 + Version: "2012-10-17"
cloudformation_stack_set: ... capabilities: - "CAPABILITY_IAM" - "CAPABILITY_NAMED_IAM"
Stack毎に見積が出せる。
yamlとjsonが使える。