Project

cfn-hup

0.0
No commit activity in last 3 years
No release in over 3 years
cfn-hup configset: configures and ensures cfn-hup is running
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 2.0
~> 10.0
~> 3.0
 Project Readme

cfn-hup configset

CodeBuild

BoltOps Badge

Why?

Configsets are essentially configuration management. Use configsets to configure and update your EC2 instances automatically. Lono allows you to use configsets in a reusable way.

Configsets work with AWS::CloudFormation::Init and cfn-init. Configsets do not magically get applied after being added to the CloudFormation template though. The cfn-init script must be called to apply the configset.

Usually the cfn-init script is called in the UserData script. This ensures configsets are applied when instances are launched.

Additionally, the cfn-hup script can be set up to apply configsets continuously.

This configset configures and runs the cfn-hup daemon. The cfn-auto-reloader.conf is configured to detect changes every 1 minute. When the stack Metatdata AWS::CloudFormation::Init changes, cfn-hup detects this and updates the EC2 instance. This ensures that the EC2 instance will always be up-to-date.

The cfn-hup configset should usually be one of the first things to be setup.

What are lono configsets?

Lono configsets allow CloudFormation cfn-init configsets that are typically embedded in the template to be reusable. More info: Lono Configsets docs.

Usage

Use configset to enable the configset for the blueprint. Example:

configs/demo/configsets/base.rb:

configset("cfn-hup", resource: "Instance")

This adds the configset to the resource with the logical id Instance in your CloudFormation template. The configset is added to the Resources[].Metadata.AWS::CloudFormation::Init attribute of the Instance resource.

Here's an example adding to a LaunchConfig resource:

configset("cfn-hup", resource: "LaunchConfig")

Here's an example adding to a LaunchTemplate resource:

configset("cfn-hup", resource: "LaunchTemplate")