22. テンプレート解説
テンプレートのバージョン
{ (最新は2010-09-09)
"AWSTemplateFormatVersion" : “2010-09-09",
"Description" : "Valid JSON strings up to 4K", テンプレートの詳細(説明文)
"Parameters" : {
set of parameters CloudFormation実行時に
}, 後で変更可能なパラメータを列挙
(例:DBユーザー名など)
"Mappings" : {
set of mappings
}, Hashtableのようなもの
キーに応じて値を特定出来る
"Resources" : { (例:リージョンに応じたAMI番号など)
set of resources
},
EC2やRDSなど、スタックを構成する
"Outputs" : { リソースを定義
set of outputs
}
} スタック構築後に取得したい値
(例:アクセスURLなど)
23. Parameters
{
"AWSTemplateFormatVersion" : “2010-09-09",
"Description" : "Valid JSON strings up to 4K",
"Parameters" : {
set of parameters CloudFormation実行時に
}, 後で変更可能なパラメータを列挙
(例:DBユーザー名など)
"Mappings" : {
set of mappings
},
"Resources" : {
set of resources
},
"Outputs" : {
set of outputs
}
}
24. Parametersとは
スタック構築時に値の入力が可能
データ型、デフォルト値、最小最大値など設定可能
"Parameters" : {
"Age":{
"Type":"Number",
“Default” : “30”,
“MinValue”: “20”,
“MaxValue”: “60”,
"Description":"input your age.“
},
"FirstName":{
"Type":"String",
"Description":"input your first name.“
},
}
29. Mappings
{
"AWSTemplateFormatVersion" : “2010-09-09",
"Description" : "Valid JSON strings up to 4K",
"Parameters" : {
set of parameters
},
"Mappings" : {
set of mappings
}, Hashtableのようなもの
キーに応じて値を特定出来る
"Resources" : { (例:リージョンに応じたAMI番号など)
set of resources
},
"Outputs" : {
set of outputs
}
}
32. Resources
{
"AWSTemplateFormatVersion" : “2010-09-09",
"Description" : "Valid JSON strings up to 4K",
"Parameters" : {
set of parameters
},
"Mappings" : {
set of mappings
},
"Resources" : {
set of resources
},
EC2やRDSなど、スタックを構成する
"Outputs" : { リソースを定義
set of outputs
}
}
35. リソースタイプ
Auto Scaling AutoScalingGroup AWS::AutoScaling::AutoScalingGroup Auto Scaling AutoScalingGroup AWS::AutoScaling::AutoScalingGroup
IAM Access Key AWS::IAM::AccessKey Auto Scaling LaunchConfiguration AWS::AutoScaling::LaunchConfiguration
IAM Group AWS::IAM::Group Auto Scaling Policy AWS::AutoScaling::ScalingPolicy
IAM Policy AWS::IAM::Policy Auto Scaling Trigger AWS::AutoScaling::Trigger
IAM Add User to Group UserToGroupAddition Amazon CloudFormation Stack AWS::CloudFormation::Stack
IAM User AWS::IAM::User Amazon CloudFormation WaitCondition AWS::CloudFormation::WaitCondition
Amazon CloudFormation
Elastic Load Balancing LoadBalancer AWS::ElasticLoadBalancing::LoadBalancer AWS::CloudFormation::WaitConditionHandle
WaitConditionHandle
Amazon RDS DBInstance AWS::RDS::DBInstance Amazon CloudFront Distribution AWS::CloudFront::Distribution
Amazon RDS DBSecurityGroup AWS::RDS::DBSecurityGroup Amazon CloudWatch AWS::CloudWatch::Alarm
Amazon Route 53 Resource Record Set AWS::Route53::RecordSet Amazon EBS Volume AWS::EC2::Volume
Amazon Route 53 Resource Record Set Amazon EBS Volume Attachment AWS::EC2::VolumeAttachment
AWS::Route53::RecordSetGroup
Group
Amazon EC2 Elastic IP Address AWS::EC2::EIP
Amazon S3 Bucket AWS::S3::Bucket
Amazon EC2 Elastic IP Address
AWS::EC2::EIPAssociation
Amazon S3 Bucket Policy AWS::S3::BucketPolicy Association
Amazon EC2 Instance AWS::EC2::Instance
Amazon SimpleDB Domain AWS::SDB::Domain
Amazon EC2 Security Group AWS::EC2::SecurityGroup
SNS Topic Policy AWS::SNS::TopicPolicy
Amazon EC2 Security Group Ingress AWS::EC2::SecurityGroupIngress
Amazon SNS Subscription AWS::SNS::Subscription
Amazon SQS Queue Policy AWS::SQS::QueuePolicy
Amazon SNS Topic AWS::SNS::Topic
Amazon SQS Queue AWS::SQS::Queue
http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide/index.h
tml?aws-template-resource-type-ref.html
36. Outputs
{
"AWSTemplateFormatVersion" : “2010-09-09",
"Description" : "Valid JSON strings up to 4K",
"Parameters" : {
set of parameters
},
"Mappings" : {
set of mappings
},
"Resources" : {
set of resources
},
"Outputs" : {
set of outputs
}
} スタック構築後に取得したい値
(例:アクセスURLなど)