10. 1. JSON
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template Insoshi_Multi_AZ: Insoshi is an open source social networking platform in Ruby on Rails. This template installs a highly-available, scalable Insoshi deployment using a
multi-az Amazon RDS database instance for storage and using an S3 bucket for photos and thumbnails. It demonstrates using the AWS CloudFormation bootstrap scripts to install the packages and files necessary to deploy
Insoshi, Rails, MySQL and all dependent packages at instance launch time. **WARNING** This template creates one or more Amazon EC2 instances, an S3 bucket, and Amazon RDS database instance and other AWS
resources. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"KeyName": {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "String",
"MinLength": "1",
"MaxLength": "255",
"AllowedPattern" : "[¥¥x20-¥¥x7E]*",
"ConstraintDescription" : "can contain only ASCII characters."
},
"DBName": {
"Default": "insoshi",
"Description" : "MySQL database name",
"Type": "String",
"MinLength": "1",
"MaxLength": "64",
"AllowedPattern" : "[a-zA-Z][a-zA-Z0-9]*",
"ConstraintDescription" : "must begin with a letter and contain only alphanumeric characters."
},
"DBUsername": {
"NoEcho": "true",
"Description" : "Username for MySQL database access",
"Type": "String",
15. 2. Cloud-Init / cfn-init
Cloud-Init
Cloud-init is the defacto multi-distribution package that
handles early initialization of a cloud instance.
cfn-init
The cfn-init helper script reads template metadata from
the AWS::CloudFormation::Init key
31. Kumogata
• CloudFormationの薄いラッパーです
• Ruby DSLを使えます(JSONも使えます)
AWSTemplateFormatVersion "2010-09-09"Description (<<-EOS).undent Kumogata Sample Template You can use Here document!EOSParameters do
InstanceType do
Default "t1.micro"
Description "Instance Type"
Type "String"
endendResources do
myEC2Instance do
Type "AWS::EC2::Instance"