-
Notifications
You must be signed in to change notification settings - Fork 35
fix: add iam:CreateServiceLinkedRole #12
base: master
Are you sure you want to change the base?
Conversation
Hi @mpgo13 ! Thanks (again) for your contributions! I'm not sure about the approach of this solution… 🤔 I know that How about creating a service-linked role in the CloudFormation template? (see docs) ServiceLinkedRole:
Type: 'AWS::IAM::ServiceLinkedRole'
Properties:
AWSServiceName: !Sub 'ec2.${AWS::URLSuffix}' # TODO: check if this is correct!!
CustomSuffix: !Sub '-${AWS::StackName}'
Description: !Sub 'Service-Linked Role for EC2 Spot Instances - ${AWS::StackName}'
Condition: 'UseSpotInstances' Or, at least, grant that permission in EC2 Instance Profile only if |
Good point @fquffio , I'll have a look at it. |
This worked now for me :) The fix will create the service linked role and cloudformation will automatically attach the managed policy |
Tested creating two stacks and got:
|
Thanks a lot, @mpgo13! I'll run a couple of tests today! |
See issue #7