~ubuntu-branches/ubuntu/trusty/heat/trusty-security

« back to all changes in this revision

Viewing changes to templates/WordPress_With_LB.template

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Yolanda Robla, Chuck Short
  • Date: 2013-07-22 16:22:29 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130722162229-zzvfu40id94ii0hc
Tags: 2013.2~b2-0ubuntu1
[ Yolanda Robla ]
* debian/tests: added autopkg tests

[ Chuck Short ]
* New upstream release
* debian/control:
  - Add python-pbr to build-depends.
  - Add python-d2to to build-depends.
  - Dropped python-argparse.
  - Add python-six to build-depends.
  - Dropped python-sendfile.
  - Dropped python-nose.
  - Added testrepository.
  - Added python-testtools.
* debian/rules: Run testrepository instead of nosetets.
* debian/patches/removes-lxml-version-limitation-from-pip-requires.patch: Dropped
  no longer needed.
* debian/patches/fix-package-version-detection-when-building-doc.patch: Dropped
  no longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{
2
 
  "AWSTemplateFormatVersion": "2010-09-09",
3
 
 
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.",
5
 
 
6
 
  "Parameters": {
7
 
 
8
 
    "KeyName": {
9
 
      "Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
10
 
      "Type": "String"
11
 
    },
12
 
 
13
 
    "InstanceType": {
14
 
      "Description": "WebServer EC2 instance type",
15
 
      "Type": "String",
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."
19
 
    },
20
 
 
21
 
    "DBName": {
22
 
      "Default": "wordpress",
23
 
      "Description": "The WordPress database name",
24
 
      "Type": "String",
25
 
      "MinLength": "1",
26
 
      "MaxLength": "64",
27
 
      "AllowedPattern": "[a-zA-Z][a-zA-Z0-9]*",
28
 
      "ConstraintDescription": "must begin with a letter and contain only alphanumeric characters."
29
 
    },
30
 
 
31
 
    "DBUsername": {
32
 
      "Default": "admin",
33
 
      "NoEcho": "true",
34
 
      "Description": "The WordPress database admin account username",
35
 
      "Type": "String",
36
 
      "MinLength": "1",
37
 
      "MaxLength": "16",
38
 
      "AllowedPattern": "[a-zA-Z][a-zA-Z0-9]*",
39
 
      "ConstraintDescription": "must begin with a letter and contain only alphanumeric characters."
40
 
    },
41
 
 
42
 
    "DBPassword": {
43
 
      "Default": "admin",
44
 
      "NoEcho": "true",
45
 
      "Description": "The WordPress database admin account password",
46
 
      "Type": "String",
47
 
      "MinLength": "1",
48
 
      "MaxLength": "41",
49
 
      "AllowedPattern": "[a-zA-Z0-9]*",
50
 
      "ConstraintDescription": "must contain only alphanumeric characters."
51
 
    },
52
 
 
53
 
    "DBRootPassword": {
54
 
      "Default": "admin",
55
 
      "NoEcho": "true",
56
 
      "Description": "Root password for MySQL",
57
 
      "Type": "String",
58
 
      "MinLength": "1",
59
 
      "MaxLength": "41",
60
 
      "AllowedPattern": "[a-zA-Z0-9]*",
61
 
      "ConstraintDescription": "must contain only alphanumeric characters."
62
 
    },
63
 
    "LinuxDistribution": {
64
 
      "Default": "F17",
65
 
      "Description": "Distribution of choice",
66
 
      "Type": "String",
67
 
      "AllowedValues": [ "F18", "F17", "U10", "RHEL-6.1", "RHEL-6.2", "RHEL-6.3" ]
68
 
    }
69
 
  },
70
 
 
71
 
  "Mappings": {
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" }
83
 
    },
84
 
    "DistroArch2AMI": {
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" }
91
 
    }
92
 
  },
93
 
 
94
 
  "Resources": {
95
 
    "DatabaseServer": {
96
 
      "Type": "AWS::CloudFormation::Stack",
97
 
      "Properties": {
98
 
        "TemplateURL": "https://raw.github.com/openstack/heat/master/templates/MySQL_Single_Instance.template",
99
 
        "Parameters": {
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" }
107
 
        }
108
 
      }
109
 
    },
110
 
 
111
 
    "WikiServerOne": {
112
 
      "Type": "AWS::EC2::Instance",
113
 
      "DependsOn" : "DatabaseServer",
114
 
      "Metadata": {
115
 
        "AWS::CloudFormation::Init": {
116
 
          "config": {
117
 
            "packages": {
118
 
              "yum": {
119
 
                "httpd"        : [],
120
 
                "wordpress"    : []
121
 
              }
122
 
            },
123
 
            "services": {
124
 
              "systemd": {
125
 
                "httpd"    : { "enabled": "true", "ensureRunning": "true" }
126
 
              }
127
 
            }
128
 
          }
129
 
        }
130
 
      },
131
 
      "Properties": {
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": ["", [
137
 
          "#!/bin/bash -v\n",
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"
146
 
        ]]}}
147
 
      }
148
 
    },
149
 
 
150
 
    "LoadBalancer" : {
151
 
      "Type" : "AWS::ElasticLoadBalancing::LoadBalancer",
152
 
      "Properties" : {
153
 
        "AvailabilityZones" : { "Fn::GetAZs" : "" },
154
 
        "Instances" : [{"Ref": "WikiServerOne"}],
155
 
        "Listeners" : [ {
156
 
          "LoadBalancerPort" : "80",
157
 
          "InstancePort" : "80",
158
 
          "Protocol" : "HTTP"
159
 
        }]
160
 
      }
161
 
    }
162
 
  },
163
 
 
164
 
  "Outputs": {
165
 
    "WebsiteURL": {
166
 
      "Value": { "Fn::Join": ["", ["http://", { "Fn::GetAtt": [ "LoadBalancer", "DNSName" ]}, "/wordpress"]] },
167
 
      "Description": "URL for Wordpress wiki"
168
 
    }
169
 
  }
170
 
}