2
"AWSTemplateFormatVersion": "2010-09-09",
4
"Description": "WordPress is web software you can use to create a beautiful website or blog. This template installs two instances: one running a WordPress deployment and the other, created within a separate stack embedded in this one with template composition, using a local MySQL database to store the data.",
9
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
14
"Description": "WebServer EC2 instance type",
16
"Default": "m1.large",
17
"AllowedValues": [ "t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "m2.2xlarge", "m2.4xlarge", "c1.medium", "c1.xlarge", "cc1.4xlarge" ],
18
"ConstraintDescription": "must be a valid EC2 instance type."
22
"Default": "wordpress",
23
"Description": "The WordPress database name",
27
"AllowedPattern": "[a-zA-Z][a-zA-Z0-9]*",
28
"ConstraintDescription": "must begin with a letter and contain only alphanumeric characters."
34
"Description": "The WordPress database admin account username",
38
"AllowedPattern": "[a-zA-Z][a-zA-Z0-9]*",
39
"ConstraintDescription": "must begin with a letter and contain only alphanumeric characters."
45
"Description": "The WordPress database admin account password",
49
"AllowedPattern": "[a-zA-Z0-9]*",
50
"ConstraintDescription": "must contain only alphanumeric characters."
56
"Description": "Root password for MySQL",
60
"AllowedPattern": "[a-zA-Z0-9]*",
61
"ConstraintDescription": "must contain only alphanumeric characters."
63
"LinuxDistribution": {
65
"Description": "Distribution of choice",
67
"AllowedValues": [ "F18", "F17", "U10", "RHEL-6.1", "RHEL-6.2", "RHEL-6.3" ]
72
"AWSInstanceType2Arch": {
73
"t1.micro" : { "Arch": "32" },
74
"m1.small" : { "Arch": "32" },
75
"m1.large" : { "Arch": "64" },
76
"m1.xlarge" : { "Arch": "64" },
77
"m2.xlarge" : { "Arch": "64" },
78
"m2.2xlarge" : { "Arch": "64" },
79
"m2.4xlarge" : { "Arch": "64" },
80
"c1.medium" : { "Arch": "32" },
81
"c1.xlarge" : { "Arch": "64" },
82
"cc1.4xlarge" : { "Arch": "64" }
85
"F18" : { "32": "F18-i386-cfntools", "64": "F18-x86_64-cfntools" },
86
"F17" : { "32": "F17-i386-cfntools", "64": "F17-x86_64-cfntools" },
87
"U10" : { "32": "U10-i386-cfntools", "64": "U10-x86_64-cfntools" },
88
"RHEL-6.1": { "32": "rhel61-i386-cfntools", "64": "rhel61-x86_64-cfntools" },
89
"RHEL-6.2": { "32": "rhel62-i386-cfntools", "64": "rhel62-x86_64-cfntools" },
90
"RHEL-6.3": { "32": "rhel63-i386-cfntools", "64": "rhel63-x86_64-cfntools" }
96
"Type": "AWS::CloudFormation::Stack",
98
"TemplateURL": "https://raw.github.com/openstack/heat/master/templates/MySQL_Single_Instance.template",
100
"KeyName" : { "Ref": "KeyName" },
101
"InstanceType" : { "Ref": "InstanceType" },
102
"DBName" : { "Ref": "DBName" },
103
"DBUsername" : { "Ref": "DBUsername" },
104
"DBPassword" : { "Ref": "DBPassword" },
105
"DBRootPassword" : { "Ref": "DBRootPassword" },
106
"LinuxDistribution": { "Ref": "LinuxDistribution" }
112
"Type": "AWS::EC2::Instance",
113
"DependsOn" : "DatabaseServer",
115
"AWS::CloudFormation::Init": {
125
"httpd" : { "enabled": "true", "ensureRunning": "true" }
132
"ImageId": { "Fn::FindInMap": [ "DistroArch2AMI", { "Ref": "LinuxDistribution" },
133
{ "Fn::FindInMap": [ "AWSInstanceType2Arch", { "Ref": "InstanceType" }, "Arch" ] } ] },
134
"InstanceType" : { "Ref": "InstanceType" },
135
"KeyName" : { "Ref": "KeyName" },
136
"UserData" : { "Fn::Base64": { "Fn::Join": ["", [
138
"/opt/aws/bin/cfn-init\n",
139
"sed -i \"/Deny from All/d\" /etc/httpd/conf.d/wordpress.conf\n",
140
"sed --in-place --e s/database_name_here/", { "Ref": "DBName" },
141
"/ --e s/username_here/", { "Ref": "DBUsername" },
142
"/ --e s/password_here/", { "Ref": "DBPassword" },
143
"/ --e s/localhost/", { "Fn::GetAtt": [ "DatabaseServer", "Outputs.PublicIp" ]},
144
"/ /usr/share/wordpress/wp-config.php\n",
145
"systemctl restart httpd.service\n"
151
"Type" : "AWS::ElasticLoadBalancing::LoadBalancer",
153
"AvailabilityZones" : { "Fn::GetAZs" : "" },
154
"Instances" : [{"Ref": "WikiServerOne"}],
156
"LoadBalancerPort" : "80",
157
"InstancePort" : "80",
166
"Value": { "Fn::Join": ["", ["http://", { "Fn::GetAtt": [ "LoadBalancer", "DNSName" ]}, "/wordpress"]] },
167
"Description": "URL for Wordpress wiki"