Skip to content

(aws-ec2): cfn-init includeRole is incomplete #16501

@maafk

Description

@maafk

#16121 is incomplete and passes the incorrect role to the --role flag in the cfn-init command

Reproduction Steps

new autoscaling.AutoScalingGroup(this, 'ASG', {
  // ...

  init: ec2.CloudFormationInit.fromElements(
    ec2.InitFile.fromString('/etc/my_instance', 'This got written during instance startup'),
  ),
  initOptions: autoscaling. ApplyCloudFormationInitOptions(
    includeRole: true,
    includeUrl: true
  ) 
  signals: autoscaling.Signals.waitForAll({
    timeout: Duration.minutes(10),
  }),
});

What did you expect to happen?

EC2 instance in ASG bootstrapped with cfn-init fails to run

What actually happened?

The value generated for --role is incorrect, causing a 404 when running the cfn-init command

Environment

  • CDK CLI Version : 1.122.0
  • Framework Version:
  • Node.js Version: v14.16.1
  • OS : Darwin
  • Language (Version): all

Other

I have a PR ready


This is 🐛 Bug Report

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-ec2Related to Amazon Elastic Compute CloudbugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions