forked from pulumi/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.json
61 lines (61 loc) · 1.4 KB
/
Main.json
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
{
"Configuration": {
"InstanceType": {
"type": "String",
"default": "t3.micro"
}
},
"Resources": {
"WebSecGrp": {
"Type": "aws:ec2:SecurityGroup",
"Properties": {
"ingress": [
{
"protocol": "tcp",
"fromPort": 80,
"toPort": 80,
"cidrBlocks": ["0.0.0.0/0"]
}
]
},
"Options": {
"Version": "4.37.1"
}
},
"WebServer": {
"Type": "aws:ec2:Instance",
"Properties": {
"instanceType": "${InstanceType}",
"ami": {
"fn::invoke": {
"Function": "aws:getAmi",
"Arguments": {
"filters": [
{ "name": "name", "values": ["amzn-ami-hvm-*-x86_64-ebs"] }
],
"owners": ["137112412989"],
"mostRecent": true
},
"Return": "id"
}
},
"userData": {
"Fn::Join": [
"\n",
[
"#!/bin/bash",
"echo 'Hello, World from ${WebSecGrp.arn}!' > index.html",
"nohup python -m SimpleHTTPServer 80 &"
]
]
},
"vpcSecurityGroupIds": ["${WebSecGrp.id}"]
}
}
},
"Outputs": {
"InstanceId": "${WebServer.id}",
"PublicIp": "${WebServer.publicIp}",
"PublicHostName": "${WebServer.publicDns}"
}
}