Configuration file
Fogg reads its configuration from a fogg.yml file in the root of your terraform repository.
Example fogg.yml
version: 2
accounts:
logging-account:
providers:
aws:
account_id: '123456789123'
additional_regions: &id001
- us-east-1
- us-west-2
role: terraform-role
main-account:
providers:
aws:
account_id: '987654321321'
additional_regions: *id001
defaults:
backend:
account_id: '987654321321'
bucket: terraform-state-bucket
dynamodb_table: terraform-statelocks
profile: terraform-profile
region: us-west-2
extra_vars:
globalvariable: 'value'
owner: infra-eng@mydomain.com
project: shared-infra
providers:
aws:
account_id: '987654321321'
region: us-west-2
version: 2.65.0
role: terraform-role
terraform_version: 0.12.25
tools:
circle_ci:
command: lint
enabled: true
tflint:
enabled: true
envs:
development:
components:
webserver:
module_source: terraform/modules/webserver
database:
providers:
datadog:
version: v2.9.0
extra_vars:
database_username: dev_website
production:
components:
webserver:
module_source: terraform/modules/webserver
database:
providers:
datadog:
version: v2.9.0
extra_vars:
database_username: prod_website
modules:
webserver: {}
Top Level Arguments
version- Required, the current fogg config version is 2accounts- Specify a map of workspaces to manage interraform/accountswhose state outputs are available to all other workspaces.defaults- Default workspace arguments that are applied to every workspace unless overridden by that workspace.envs- Create separate environments that don’t share configmodules- Manage modules interraform/modulesthat can be invoked in any workspace for better code reuse.
Common workspace arguments
The following config paths all accept a standard workspace configuration spec:
accounts.{accountname}envs.{envname}.{component}defaults
Arguments
backend- Configure the terraform remote state backendextra_vars- Any extra terraform variables to add to the workspaceowner- Set thevar.ownerterraform variable to this string (email address recommended)project- Set thevar.projectterraform variable to this stringproviders- Preconfigure any terraform providersterraform_version- Which terraform version to use for this workspace.tools- En/Disable CI for this workspace
backend
Defines terraform remote state storage for a workspace
For S3 backends:
account_id- AWS Account IDbucket- Name of the S3 bucket for state storagedynamodb_table- Name of the DynamoDB table for state locksprofile- AWS profile to use for authenticationrole- AWS role to assume for state storageregion- AWS region
For Terraform Enterprise / Terraform Cloud backends
host_name- Hostname of the Terraform Cloud/Enterprise instance.organization- Organization this repository belongs to.
providers
Providers is a map of provider names to provider configuration values.
The currently supported providers are:
awsaccount_id- AWS Account IDadditional_regions- List of regions to generate provider aliases forprofile- AWS profile to useregion- Primary AWS regionversion- Version of the provider to use
blessaws_profile- AWS profile to useaws_region- AWS region to useadditional_regions- List of regions to generate provider aliases forversion- Version of the provider to use
datadogversion- Version of the provider to use
githuborganization- GitHub Organizationbase_url- URL for on-premise GitHub installationsversion- Version of the provider to use
herokuversion- Version of the provider to use
oktaorg_name- Okta organization nameversion- Version of the provider to use
snowflakeaccount- Snowflake accountrole- Role to useregion- Regionversion- Version of the provider to use
tfe- Terraform Enterprisehostname- Hostname for the Terraform Enterprise instanceversion- Version of the provider to use
tools
Define CI integrations.
The currently supported CI tools are:
travis_ciaws_iam_role_name- Configure the CI toole to assume this role before running checkstest_buckets- Whether to run checkscommand- Which makefile target to use to validate the workspace (default is “check”)enabled- boolean, enable this CI tool
circle_ciaws_iam_role_name-test_buckets-command-ssh_key_fingerprints-enabled- boolean, enable this CI tool
github_actions_ciaws_iam_role_name-test_buckets-command-enabled- boolean, enable this CI toolssh_key_secrets- list of strings, github actions secrets containing ssh keys for pulling code from private repos
tflintenabled- boolean, enable this CI tool
envs
Fogg manages workspaces within environments (think “dev”, “staging” and “prod” for example) that don’t share state between them.
Each workspace within an environment is called a component
env arguments
components- This is a map of workspace names to workspace configurations
component arguments
In addition to the common workspace arguments, components also support the following arguments:
eks- Object that contains acluster_namekey to point terraform to a kubectl contextkind- String, onlyterraformis supported (DEPRECATED)module_source- String, path to a terraform module to use for this component. If this is a relative path such asterraform/modules/webserver, fogg will generate a main.tf in this component with a full invocation to this module.module_name- If module_source is supplied, this is the name to use for the module invocation resource.