question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for AWS::CloudFormation::Init

See original GitHub issue

TypeScript CDK 0.9.2

How to write AWS::CloudFormation::Init metadata with AWS Construct Library for cfn-init ? I want to add AWS::CloudFormation::Init metadata to AutoScalingGroup.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:20
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

8reactions
eladbcommented, Oct 2, 2019

Still relevant

4reactions
0xdevaliascommented, Nov 6, 2018

Any updates/likely merge time on https://github.com/awslabs/aws-cdk/pull/792 , or at least a worked example of how to add AWS::CloudFormation::Init to an autoscaling.AutoScalingGroup?

The following template shows that it should be added to the AWS::AutoScaling::LaunchConfiguration in the CloudFormation:

I see that https://github.com/awslabs/aws-cdk/issues/606 makes reference to being able to find/modify children since 0.10.0. Following the syntax there… it looks like the following should work for us…:

// Ref: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-init.html
// Ref: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/example-templates-autoscaling.html
const asgLaunchConfig = asg.findChild('LaunchConfig') as autoscaling.cloudformation.LaunchConfigurationResource;
asgLaunchConfig.addOverride("Metadata", {
    "AWS::CloudFormation::Init": {
        "FOO": "BAR",
    }
});

Running cdk synth, I get the following, which implies it is working as expected:

AutoScalingGroupLaunchConfigDEEB160C:
  Type: 'AWS::AutoScaling::LaunchConfiguration'
  ..snip..
  Metadata:
      'AWS::CloudFormation::Init':
          FOO: BAR
Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS::CloudFormation::Init
Use the AWS::CloudFormation::Init type to include metadata on an Amazon EC2 instance for the cfn-init helper script. If your template calls the cfn-init...
Read more >
cfn-init - CloudFormation - AWS Documentation
The cfn-init helper script reads template metadata from the AWS::CloudFormation::Init key and acts accordingly to: ... If you use cfn-init to update an...
Read more >
Bootstrapping AWS CloudFormation Windows stacks
This topic describes how to bootstrap a Windows stack and troubleshoot stack creation issues. If you will be creating your own Windows image...
Read more >
Troubleshoot helper scripts that won't bootstrap in AWS ...
In a Windows instance, UserData that runs as a child process of EC2ConfigService invokes cfn-init.exe. Certain steps that cfn-init.exe ...
Read more >
Deploying applications on Amazon EC2 with AWS ...
Automatically install, configure, and start up your application on Amazon EC2 with AWS CloudFormation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found