Skip to content

Commit 28828a7

Browse files
committed
feat(contrib/ec2): add optional support for IAM instance profiles
1 parent 6884604 commit 28828a7

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

contrib/ec2/deis.template.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
"Description": "Number of nodes in cluster (3-12).",
1818
"Type": "Number"
1919
},
20+
"IamInstanceProfile" : {
21+
"Description" : "(Optional) Set IAM instance profile for Deis hosts (default: none)",
22+
"Type" : "String",
23+
"Default": ""
24+
},
2025
"SSHFrom" : {
2126
"Description" : "Lockdown SSH access to the Deis hosts (default: can be accessed from anywhere)",
2227
"Type" : "String",
@@ -106,6 +111,17 @@
106111
}
107112
},
108113

114+
"Conditions" : {
115+
"UseIamInstanceProfile" : {
116+
"Fn::Not" : [{
117+
"Fn::Equals" : [
118+
{ "Ref" : "IamInstanceProfile" },
119+
""
120+
]
121+
}]
122+
}
123+
},
124+
109125
"Resources" : {
110126
"VPC" : {
111127
"Type" : "AWS::EC2::VPC",
@@ -221,6 +237,13 @@
221237
"Properties": {
222238
"ImageId" : { "Fn::FindInMap" : [ "CoreOSAMIs", { "Ref" : "AWS::Region" }, { "Ref" : "EC2VirtualizationType" }]},
223239
"InstanceType": {"Ref": "InstanceType"},
240+
"IamInstanceProfile" : {
241+
"Fn::If" : [
242+
"UseIamInstanceProfile",
243+
{ "Ref" : "IamInstanceProfile" },
244+
{ "Ref" : "AWS::NoValue" }
245+
]
246+
},
224247
"KeyName": {"Ref": "KeyPair"},
225248
"UserData" : { "Fn::Base64": { "Fn::Join": [ "", [ ] ] } },
226249
"AssociatePublicIpAddress": {"Ref": "AssociatePublicIP"},

0 commit comments

Comments
 (0)