Skip to content

Commit

Permalink
Merge pull request #8 from Samseppiol/master
Browse files Browse the repository at this point in the history
Add spot functionality to bastion
  • Loading branch information
Guslington authored May 22, 2019
2 parents 690b295 + 22cd5fd commit 7acb524
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions bastion.cfhighlander.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ComponentParam 'EnvironmentName', 'dev', isGlobal: true
ComponentParam 'EnvironmentType', 'development', isGlobal: true
ComponentParam 'Ami', type: 'AWS::EC2::Image::Id'
ComponentParam 'SpotPrice', ''
MappingParam('InstanceType') do
map 'EnvironmentType'
attribute 'BastionInstanceType'
Expand Down
2 changes: 2 additions & 0 deletions bastion.cfndsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Condition('HostedZoneNameProvided', FnNot(FnEquals(Ref('HostedZoneName'), '')))
Condition('RecordNameProvided', FnNot(FnEquals(Ref('RecordName'), '')))
Condition("SpotPriceSet", FnNot(FnEquals(Ref('SpotPrice'), '')))

EC2_SecurityGroup('SecurityGroupBastion') do
GroupDescription FnJoin(' ', [ Ref('EnvironmentName'), component_name ])
Expand Down Expand Up @@ -46,6 +47,7 @@
AssociatePublicIpAddress true
IamInstanceProfile Ref('InstanceProfile')
KeyName Ref('KeyName')
SpotPrice FnIf('SpotPriceSet', Ref('SpotPrice'), Ref('AWS::NoValue'))
SecurityGroups [ Ref('SecurityGroupBastion') ]
UserData FnBase64(FnJoin("",[
"#!/bin/bash\n",
Expand Down

0 comments on commit 7acb524

Please sign in to comment.