Skip to content

Commit f4652d6

Browse files
rafaelpereyrass1796awsimayagjohnsonrapgaws
authored
Fix Cloud9 Bootstrap issues (#287)
* Changes for EKS 1.27 * Reboot c9 instance after attaching instance profile * Add reboot permissions to lambda role --------- Co-authored-by: Sudheer Sangunni <sangunni@amazon.com> Co-authored-by: Imaya Kumar Jagannathan <ijaganna@amazon.com> Co-authored-by: gjohnson <garrjh@amazon.com> Co-authored-by: Rafael Pereyra <rapg@amazon.com>
1 parent 90dd0cd commit f4652d6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cloud9-cfn.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ Resources:
465465
- ec2:AssociateIamInstanceProfile
466466
- ec2:ModifyInstanceAttribute
467467
- ec2:ReplaceIamInstanceProfileAssociation
468+
- ec2:RebootInstances
468469
Resource: !Sub "arn:${AWS::Partition}:ec2:${AWS::Region}:${AWS::AccountId}:instance/*"
469470
- Effect: Allow
470471
Action:
@@ -595,7 +596,7 @@ Resources:
595596
# attach instance profile
596597
response = ec2.associate_iam_instance_profile(IamInstanceProfile=iam_instance_profile, InstanceId=instance['InstanceId'])
597598
logger.info('response - associate_iam_instance_profile: {}'.format(response))
598-
#r_ec2 = boto3.resource('ec2')
599+
ec2.reboot_instances(InstanceIds=[instance['InstanceId']], DryRun=False)
599600
600601
responseData = {'Success': 'Started bootstrapping for instance: '+instance['InstanceId']}
601602
cfnresponse.send(event, context, cfnresponse.SUCCESS, responseData, 'CustomResourcePhysicalID')

0 commit comments

Comments
 (0)