0
votes

I have an autoscaling group with coreOS instances. When I bootstrap them I specify the cloud-config inside the launch configuration's UserData. I usually work with Ubuntu instances and want to know if there is a way I can use cfn-init and cfn-signal inside the UserData instead of the cloud-config? I want to do this to execute a cfn-init to call the ConfigSets to install files (from a secure S3 bucket). Example:

"cfn-init -v -s ", { "Ref" : "AWS::StackName" },
                        " -r ServiceInstance",
                        " --configsets server_setup",
                        " --region ", { "Ref" : "AWS::Region" }, "\n"

Is this possible using CoreOS? If not, how would I securely download from a S3 bucket in CoreOS? I know about the write_files section in the cloud-config.yaml but don't see how I can make the download secure.

Any help would be appreciated.

1
You can use some Docker image containing the cfn-signal script, e.g. like mine: github.com/hjacobs/docker-aws-cfn-signal Example usage (CoreOS Container Linux running Kubernetes): github.com/zalando-incubator/kubernetes-on-aws/pull/438Henning Jacobs

1 Answers

2
votes

The cfn-signal and cfn-init functions work on CoreOS.

You could give the EC2-instances an IAM-Role that allows them to access S3.