forked from krishnan-mani/the-cf-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
story_1-template.yaml
45 lines (39 loc) · 1023 Bytes
/
story_1-template.yaml
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
Description: Deploys a single webserver instance
Resources:
webServer:
Type: AWS::EC2::Instance
Metadata:
AWS::CloudFormation::Init:
config:
packages:
yum:
httpd: []
services:
sysvinit:
httpd:
enabled: true
ensureRunning: true
Properties:
ImageId: ami-7c87d913
InstanceType: t2.micro
SecurityGroups:
- !Ref securityGroup
UserData:
Fn::Base64:
!Sub |
#!/bin/bash -xe
yum install -y aws-cfn-bootstrap
/opt/aws/bin/cfn-init -s ${AWS::StackId} -r webServer --region ${AWS::Region} -v
securityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: access web application
SecurityGroupIngress:
-
IpProtocol: tcp
CidrIp: 0.0.0.0/0
FromPort: 80
ToPort: 80
Outputs:
webserverIPAddress:
Value: !Sub ${webServer.PublicIp}