-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for AWS::CloudFormation::Init #777
Comments
We don't have this modeled as an L2 right now. You can instantiate a |
It should include support for environment variables, by writing them to a script in Need to do research to see if all ways of starting a program source the files there well enough. |
I'm trying to convert this template with cdk. environment variables are in l.1008 |
Any updates/likely merge time on #792 , or at least a worked example of how to add
The following template shows that it should be added to the I see that #606 makes reference to being able to find/modify children since // 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 AutoScalingGroupLaunchConfigDEEB160C:
Type: 'AWS::AutoScaling::LaunchConfiguration'
..snip..
Metadata:
'AWS::CloudFormation::Init':
FOO: BAR |
Closed PR for now. Reopen as needed. |
Sad that that PR didn’t land.. :( |
We'll get there. It's an important feature... Just got too much on our table RN... |
Still relevant |
I haven't taken a stab at an L2 construct, but I put together a template I might be able to refactor out into something easier. I needed a shell script to be put onto the machine and be executed. The construct for I put it up on a gist instead of here. Hopefully this is helpful if someone writes the L2, to see how I tackled this use case. I'd like to spend time on an L2 but not sure I'll have the time for a while. https://gist.github.com/brettswift/6e48a70d808a28614438520682459f0c |
I updated the gist above adding in a builder class to help us reduce code re-use. Definitely not feature complete for cfn-init, however it's one take to solve just our use case still. If this is a strategy that people like, I might have time to contribute to a PR into CDK. |
any update on this? @rix0rrr |
Yeah, I'd really like to see this feature ship soon. Using escape hatches to accomplish this task is very cumbersome. |
Please, keep things going on this @rix0rrr |
With regard to another issue about adding metadata, this seems to be a work around at the moment: Modifying the AWS CloudFormation resource behind AWS constructs |
I saw this is documented on the AWS CDK API under Configuring Instances using CloudFormation Init (cfn-init) |
|
i tried to use this and got When applying CloudFormationInit, you must also configure signals by supplying 'signals' at instantiation time. |
TypeScript CDK 0.9.2
How to write
AWS::CloudFormation::Init
metadata with AWS Construct Library forcfn-init
?I want to add
AWS::CloudFormation::Init
metadata toAutoScalingGroup
.The text was updated successfully, but these errors were encountered: