-
Notifications
You must be signed in to change notification settings - Fork 58
/
instance_cf.json
36 lines (36 loc) · 940 Bytes
/
instance_cf.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
---
AWSTemplateFormatVersion: '2010-09-09'
Description: A test stack for demonstrating Cloudformation
Parameters:
Subnet:
Description: Subnet in which to place the resources
Type: AWS::EC2::Subnet::Id
SecurityGroup:
Description: This group will be applied to both the ELB and instances in the ASG
Type: AWS::EC2::SecurityGroup::Id
InstanceType:
Description: The instance type for the Launch Config
Type: String
Default: t2.micro
AllowedValues:
- t2.nano
- t2.micro
- t2.small
- t2.medium
- t2.large
Resources:
MyInstance:
Type: AWS::EC2::Instance
Properties:
UserData:
Fn::Base64: !Sub |
#!/bin/bash -xe
sudo yum install nginx -y
sudo service nginx start
ImageId: ami-087c17d1fe0178315
InstanceType:
Ref: InstanceType
SecurityGroupIds:
- Ref: SecurityGroup
SubnetId:
Ref: Subnet