-
Notifications
You must be signed in to change notification settings - Fork 336
/
Copy pathec2_getatt.yaml
76 lines (42 loc) · 1.08 KB
/
ec2_getatt.yaml
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
AWSTemplateFormatVersion: "2010-09-09"
Description: "Create EC2 instance"
Parameters:
InstanceTypeParameter:
Description: Select instance type
Type: String
Default: t2.micro
AllowedValues:
- t2.micro
- t2.small
- t2.large
Description: Enter t2.micro, m1.small, or m1.large. Default is t2.micro.
Resources:
Instance:
Type: AWS::EC2::Instance
Properties:
InstanceType: !Ref InstanceTypeParameter
ImageId: ami-0dba2cb6798deb6d8
Tags:
- Key: Name
Value: cf-demo
NewVolume:
Type: AWS::EC2::Volume
Properties:
Size: 100
AvailabilityZone:
!GetAtt Instance.AvailabilityZone
MountPoint:
Type: AWS::EC2::VolumeAttachment
Properties:
InstanceId:
!Ref Instance
VolumeId:
!Ref NewVolume
Device: /dev/sdh
Outputs:
InstanceName:
Value: !Ref Instance
DNSName:
Value: !GetAtt Instance.PublicDnsName
# Fn::GetAtt: [ logicalNameResource, attributeName ]
# !GetAtt logicalNameResource.attributeName