-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-instance.yml
41 lines (41 loc) · 1.07 KB
/
single-instance.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
---
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
IamInstanceProfile:
Description: IAM profile for instance
Type: String
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 amazon-linux-extras install nginx1 -y
sudo service nginx start
ImageId: ami-087c17d1fe0178315
InstanceType:
Ref: InstanceType
SecurityGroupIds:
- Ref: SecurityGroup
SubnetId:
Ref: Subnet
IamInstanceProfile:
Ref: IamInstanceProfile