Overview
- Installing and configuring software using CF
AWS::CloudFormation::Init
- It is a special key put into template metadata
- Either on the template or individual resource level
- Defines instructions for cfn-init python script
- Sections
- ConfigSets
- Specify multiple "config" keys and allows to change order of execution (e.g. config1, config2)
- config keys may be embedded in one another
- Commands
- Execute Bash/cmd.exe command
- Parameters: command, env, cwd (working directory), test, ignoreErrors, waitAfterCompletion (windows only: used for rebooting)
- Execute Bash/cmd.exe command
- Files
- Create files
- Parameters: content, source (XOR with content), group, owner, mode
- Supports Mustache templates (require context parameter)
- Create files
- Packages
- Download and install packages
- Linux: yum, rpm, apt, rubygems, python
- Windows: msi
- May specify version
- Download and install packages
- Services
- Enable/Disable services
- Linux: syvinit
- Windows: SCM
- Parameters: files (restart service if touched), packages, ensureRunning, enabled
- Enable/Disable services
- Sources
- Download archive and unpack it to target directory
- Groups
- Users
- Create users
- Parameters: uid, groups, homedir
- Create users
- ConfigSets
cfn-init
- Default order
- packages, groups, users, sources, files, commands, services
- Injected via "UserData" property on EC2 instance
"/opt/aws/bin/cfn-init"
No comments:
Post a Comment