This repository has been archived by the owner on Sep 11, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yml
73 lines (66 loc) · 1.74 KB
/
template.yml
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
AWSTemplateFormatVersion: 2010-09-09
Description: "Pac-Man Overflow stack"
Parameters:
KeyPair:
Description: Private SSH KeyPair
Type: AWS::EC2::KeyPair::KeyName
Resources:
SSHSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Enable SSH access via port 22
SecurityGroupIngress:
- CidrIp: 0.0.0.0/0
FromPort: 22
IpProtocol: tcp
ToPort: 22
HTTPTrafficSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Enable incoming HTTP and HTTPS access
SecurityGroupIngress:
- CidrIp: 0.0.0.0/0
FromPort: 80
IpProtocol: tcp
ToPort: 80
- CidrIp: 0.0.0.0/0
FromPort: 443
IpProtocol: tcp
ToPort: 443
EC2Instance:
Type: AWS::EC2::Instance
Properties:
KeyName: !Ref KeyPair
ImageId: ami-0b0ea68c435eb488d
InstanceType: t3.micro
Monitoring: true
SecurityGroups:
- !Ref SSHSecurityGroup
- !Ref HTTPTrafficSecurityGroup
Tags:
- Key: Name
Value: pacman-overflow-ec2
ElasticIP:
Type: AWS::EC2::EIP
Properties:
InstanceId: !Ref EC2Instance
RecordSetGroup:
Type: AWS::Route53::RecordSetGroup
Properties:
Comment: Route 53 records for Pac-Man Overflow
HostedZoneName: pacman-overflow.com.
RecordSets:
- Name: pacman-overflow.com
ResourceRecords:
- !Ref ElasticIP
TTL: 900
Type: A
- Name: www.pacman-overflow.com
ResourceRecords:
- !Ref ElasticIP
TTL: 900
Type: A
Outputs:
IPAddress:
Description: Elastic IP Address associated with EC2 Instance
Value: !Ref ElasticIP