-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello-world-stack.yml
More file actions
86 lines (78 loc) · 2.36 KB
/
hello-world-stack.yml
File metadata and controls
86 lines (78 loc) · 2.36 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
AWSTemplateFormatVersion: 2010-09-09
Description: CloudFormation Template for AtlasWebServer and
AtlasKnowledgeEnvironment with EC2 Instances
Parameters:
MyIP:
Description: Your IP address in CIDR format (e.g. 203.0.113.1/32).
Type: String
MinLength: '9'
MaxLength: '18'
Default: 0.0.0.0/0
AllowedPattern: ^(\d{1,3}\.){3}\d{1,3}\/\d{1,2}$
ConstraintDescription: must be a valid IP CIDR range of the form x.x.x.x/x.
Resources:
ITSVPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.236.105.0/24
AtlasWebServerSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Allow HTTP access via my IP address
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 80
ToPort: 80
CidrIp: !Ref MyIP
KnowledgeEnvironmentSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Allow HTTP access via my IP address
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 80
ToPort: 80
CidrIp: !Ref MyIP
AtlasWebServer:
Type: AWS::EC2::Instance
Properties:
ImageId: ami-03dd3bb693a074abe
InstanceType: t2.large
SecurityGroupIds:
- !Ref AtlasWebServerSecurityGroup
KeyName: um-kpmp-2025
UserData: !Base64 |
#!/bin/bash
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
echo "<html><body><h1>Hello From Cloudformation! (Atlas Webserver)</h1></body></html>" > /var/www/html/index.html
KnowledgeEnvironment:
Type: AWS::EC2::Instance
Properties:
ImageId: ami-08b23e1bace4f480b
InstanceType: t2.2xlarge
KeyName: um-kpmp-2025
SecurityGroupIds:
- !Ref KnowledgeEnvironmentSecurityGroup
UserData: !Base64 |
#!/bin/bash
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
echo "<html><body><h1>Hello From Cloudformation! (Atlas KE)</h1></body></html>" > /var/www/html/index.html
Outputs:
AtlasWebserverURL:
Value: !Join
- ''
- - http://
- !GetAtt AtlasWebServer.PublicDnsName
Description: Atlas Webserver URL
KnowledgeEnvironmentURL:
Value: !Join
- ''
- - http://
- !GetAtt KnowledgeEnvironment.PublicDnsName
Description: KE URL