-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
bugThis issue is a bug.This issue is a bug.
Description
Describe the bug
There's no way to have complete control over your generic Linux's userdata, #!/bin/bash gets injected as the first line. There are scenarios where a user would want #cloud-boothook as the first line instead for example, or to specify a different shell
To Reproduce
this._asg = new autoscaling.AutoScalingGroup(this, 'ASG', {
minCapacity: 1,
maxCapacity: 1,
vpc: vpc.Vpc,
vpcSubnets: {
subnetType: ec2.SubnetType.Public
},
instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Micro),
machineImage: new ec2.GenericLinuxImage({
'us-west-2': 'ami-xxxx',
})
},
elbProps : {
...
});
const userData = "#cloud-boothook\n#!/bin/bash\nsudo echo hello";
this._asg.addUserData(userData);Creates this CFN:
ASGLaunchConfigC00AF12B:
Type: AWS::AutoScaling::LaunchConfiguration
Properties:
ImageId: ami-xxxxxxx
InstanceType: t2.micro
UserData:
Fn::Base64: |-
#!/bin/bash
#cloud-boothook
#!/bin/bash
echo helloExpected behavior
I would have expected my CFN to look like
UserData:
Fn::Base64: |-
#cloud-boothook
#!/bin/bash
echo helloor to at least have a parameter I can set to omit #!/bin/bash, or somewhere I can setUserData() instead of addUserData()
Version:
- OS: OSX
- Programming Language: TypeScript
- CDK Version: 0.32.0
fimbulvetr and hoegertn
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.