0

I have a running CoreOS instance triggered by AWS CloudFormation. I updated the CloudFormation template via CF designer, but found out that user-data of the existing instance was not updated. Is there a way to update a running (old) CoreOS instance's user-data?

  • User-data only gets run on first boot anyway, so why does this matter? – EEAA Jun 22 '16 at 18:17
  • When userdata is a script, it only is executed on first boot. But you can stop an instance and change the user data. The change is reflected in anything looking at the userdata. But it won't run as a script again. – Matt Houser Jun 23 '16 at 0:45
  • Hey guys, Thanks for info. But I remember this "Your cloud-config is processed during each boot" from CoreOS document. – zeck Jun 23 '16 at 4:01
  • You cannot update the user data but it will not take effect untill you stop and start the instance. Another way is add a cron job that will run on the server reboot. – error2007s Jun 23 '16 at 12:07
1

You need to configure the cfn-hup daemon in your template to listen for updates to your instance metadata. This walkthrough shows how you can configure the cfn-hup daemon: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/updating.stacks.walkthrough.html

Since you're not using Amazon Linux, you'll probably have to install the Cloudformation helper scripts as part of your initial Cloudformation template as well. You can find S3 locations for those script distributions here: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-helper-scripts-reference.html

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.