Configuration¶
This page documents all variables available in the terraform-aws-cloud-init module.
Required Variables¶
environment¶
Environment name passed as a Puppet fact.
- Type:
string - Required: Yes
Naming Convention
Must contain only lowercase letters, numbers, and underscores. Hyphens are not allowed. This follows Puppet naming conventions.
role¶
Puppet role passed as a fact.
- Type:
string - Required: Yes
Naming Convention
Must contain only lowercase letters, numbers, and underscores. Hyphens are not allowed.
Optional Variables¶
ubuntu_codename¶
Ubuntu version codename. Determines which InfraHouse repository to configure.
- Type:
string - Default:
"noble"
Supported Versions
Only Ubuntu LTS versions are supported. Currently: noble (24.04 LTS).
packages¶
Additional packages to install during bootstrap.
- Type:
list(string) - Default:
[]
Info
puppet-code and infrahouse-toolkit are always installed automatically.
custom_facts¶
Custom Puppet facts to inject into the instance.
- Type:
any - Default:
{}
Facts are written to /etc/puppetlabs/facter/facts.d/custom.json.
extra_files¶
Additional files to create on the instance.
- Type:
list(object) - Default:
[]
extra_files = [
{
content = "my config content"
path = "/etc/myapp/config.txt"
permissions = "0644"
}
]
extra_repos¶
Additional APT repositories to configure.
- Type:
map(object) - Default:
{}
Save Userdata Space
Use keyid instead of key to reduce userdata size by ~3KB per repository.
pre_runcmd¶
Commands to run before Puppet applies the manifest.
- Type:
list(string) - Default:
[]
post_runcmd¶
Commands to run after Puppet applies the manifest.
- Type:
list(string) - Default:
[]
ssh_host_keys¶
Pre-configured SSH host keys for consistent host identification.
- Type:
list(object) - Default:
[] - Sensitive: Yes
ssh_host_keys = [
{
type = "rsa"
private = file("keys/ssh_host_rsa_key")
public = file("keys/ssh_host_rsa_key.pub")
}
]
mounts¶
Volumes to mount before Puppet runs.
- Type:
list(list(string)) - Default:
[]
gzip_userdata¶
Whether to gzip compress the userdata.
- Type:
bool - Default:
false
Tip
Enable this if your userdata exceeds AWS limits (16KB compressed).
Puppet Configuration Variables¶
| Variable | Description | Default |
|---|---|---|
puppet_root_directory | Path where puppet code is hosted | /opt/puppet-code |
puppet_environmentpath | Path for directory environments | {root_directory}/environments |
puppet_hiera_config_path | Path to hiera configuration | {root_directory}/environments/{environment}/hiera.yaml |
puppet_module_path | Path to common puppet modules | {root_directory}/modules |
puppet_manifest | Path to puppet manifest | null (uses default) |
puppet_debug_logging | Enable debug logging | false |
cancel_instance_refresh_on_error | Cancel ASG refresh on error | false |
Outputs¶
userdata¶
Base64-encoded cloud-init configuration ready to use in launch templates.