-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwordpress.template
More file actions
125 lines (122 loc) · 4.66 KB
/
wordpress.template
File metadata and controls
125 lines (122 loc) · 4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "The Bitnami WordPress 4.2.2: WordPress is one of the world's most popular web publishing platforms for building blogs and websites. It can be customized via a wide selection of themes, extensions and plug-ins. For more information, please visit: https://bitnami.com.",
"Parameters" : {
"BitnamiInstanceType" : {
"Default" : "t1.micro",
"Type" : "String",
"Description" : "The type of EC2 instances"
},
"KeyName": {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access",
"Type": "String",
"Default" : "default"
},
"BitnamiUser" : {
"Default" : "user",
"Type" : "String",
"Description" : "The Bitnami WordPress user login"
},
"BitnamiPassword" : {
"Default" : "bitnami",
"Type" : "String",
"Description" : "The Bitnami WordPress user password (minimum 6 characters, default value: bitnami )",
"NoEcho" : "TRUE"
},
"BitnamiEmail" : {
"Default" : "user@example.com",
"Description" : "The Bitnami WordPress user email",
"Type" : "String"
},
"BitnamiUserName" : {
"Default" : "Bitnami User",
"Description" : "The Bitnami WordPress user full name",
"Type" : "String"
}
},
"Resources" : {
"BitnamiSecurityGroup" : {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"GroupDescription" : "Allow HTTP/SSH to Bitnami machine.",
"SecurityGroupIngress" : [ {
"IpProtocol" : "tcp",
"FromPort" : "80",
"ToPort" : "80",
"CidrIp" : "0.0.0.0/0"
}, {
"IpProtocol" : "tcp",
"FromPort" : "443",
"ToPort" : "443",
"CidrIp" : "0.0.0.0/0"
}, {
"IpProtocol" : "tcp",
"FromPort" : "22",
"ToPort" : "22",
"CidrIp" : "0.0.0.0/0"
} ]
}
},
"BitnamiServer" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"ImageId" : { "Fn::FindInMap": [ "AWSRegionArch2AMI", { "Ref": "AWS::Region" }, { "Fn::FindInMap": [ "AWSInstanceType2Arch", {"Ref": "BitnamiInstanceType" },"Arch" ] } ]},
"KeyName" : {"Ref": "KeyName"},
"SecurityGroups" : [ { "Ref" : "BitnamiSecurityGroup" } ],
"UserData" : { "Fn::Base64" : { "Fn::Join" : [ "", [
"#!/bin/sh\n",
"cat > /tmp/stack_properties.ini <<EOF\n",
"base_user=",{ "Ref" : "BitnamiUser" }, "\n",
"base_user_name=",{ "Ref" : "BitnamiUserName" }, "\n",
"base_mail=",{ "Ref" : "BitnamiEmail" }, "\n",
"base_password=",{ "Ref" : "BitnamiPassword" }, "\n",
"EOF\n",
"\n",
"\n",
"/opt/bitnami/mysql/bin/mysqladmin -p'bitnami' -u root password '", { "Ref" : "BitnamiPassword" }, "'\n",
"\n",
"curl --capath /etc/ssl/certs/ --retry 3 -sS -o /tmp/stack.bin -L --max-redirs 3 https://downloads.bitnami.com/files/stacks/wordpress/4.2.2-0/bitnami-wordpress-4.2.2-0-module-linux-x64-installer.run\n",
"chmod +x /tmp/stack.bin\n",
"/tmp/stack.bin --mode unattended --prefix /opt/bitnami --optionfile /tmp/stack_properties.ini\n",
"\n",
"/opt/bitnami/scripts/init/update_ip\n",
"rm -f /tmp/stack.bin \n",
"rm -f /tmp/stack_properties.ini\n",
"\n"
] ] } },
"InstanceType" : { "Ref" : "BitnamiInstanceType" },
"Tags" : [ {
"Key" : "Name",
"Value" : "The Bitnami WordPress 4.2.2"
} ]
}
},
"BitnamiIP" : {
"Type" : "AWS::EC2::EIP",
"Properties" : {
"InstanceId" : { "Ref" : "BitnamiServer" }
}
}
},
"Mappings": {
"AWSInstanceType2Arch" : {
"t1.micro" : { "Arch" : "64" },
"m1.small" : { "Arch" : "64" },
"m1.medium" : { "Arch" : "64" },
"m1.large" : { "Arch" : "64" },
"m2.xlarge" : { "Arch" : "64" },
"c1.medium" : { "Arch" : "64" },
"c1.xlarge" : { "Arch" : "64" },
"m1.xlarge" : { "Arch" : "64" },
"m2.2xlarge" : { "Arch" : "64" },
"m2.4xlarge" : { "Arch" : "64" }
},
"AWSRegionArch2AMI" : {"ap-northeast-1":{"64":"ami-96479296"},"ap-southeast-1":{"64":"ami-b2f9c0e0"},"ap-southeast-2":{"64":"ami-57e7996d"},"eu-central-1":{"64":"ami-f4e6d8e9"},"eu-west-1":{"64":"ami-dfaed9a8"},"sa-east-1":{"64":"ami-1369ef0e"},"us-east-1":{"64":"ami-b25a42da"},"us-west-1":{"64":"ami-e51cf5a1"},"us-west-2":{"64":"ami-61350851"}}
},
"Outputs" : {
"URL" : {
"Description" : "URL of the Bitnami WordPress 4.2.2 server:",
"Value" : { "Fn::Join" : [ "", [ "http://", { "Ref" : "BitnamiIP" } ] ] }
}
}
}