Skip to content
This repository was archived by the owner on Nov 8, 2021. It is now read-only.

Commit 35be431

Browse files
vincetsemichaelwittig
authored andcommitted
Explicitly associate public DNS name and IP (#26)
1 parent cc83a2f commit 35be431

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

showcase.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,18 @@ Resources:
185185
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
186186
IamInstanceProfile: !Ref InstanceProfile
187187
InstanceType: 't2.micro'
188-
SecurityGroupIds:
189-
- !Ref SecurityGroup
190-
SubnetId: !Ref Subnet
191188
UserData:
192189
'Fn::Base64': !Sub |
193190
#!/bin/bash -x
194191
/opt/aws/bin/cfn-init --verbose --stack=${AWS::StackName} --region=${AWS::Region} --resource=Instance
195192
/opt/aws/bin/cfn-signal --exit-code=$? --stack=${AWS::StackName} --region=${AWS::Region} --resource=Instance
193+
NetworkInterfaces:
194+
- AssociatePublicIpAddress: true
195+
DeleteOnTermination: true
196+
SubnetId: !Ref Subnet
197+
DeviceIndex: 0
198+
GroupSet:
199+
- !Ref SecurityGroup
196200
Tags:
197201
- Key: Name
198202
Value: 'AWS EC2 SSH access with IAM showcase'

0 commit comments

Comments
 (0)