Skip to main content

mixins

This is a collection of Terraform mixins are drop in files intended to be used with multiple components.

Usage

Typically this is not a component you will use directly but will instead vendor in particular files for a given component.

e.g.


apiVersion: atmos/v1
kind: ComponentVendorConfig
spec:
# ...
mixins:
- uri: https://raw.githubusercontent.com/cloudposse-terraform-components/mixins/{{ .Version }}/src/mixins/github-actions-iam-role/github-actions-iam-role.mixin.tf
version: v0.1.0
filename: github-actions-iam-role.mixin.tf

or the full yaml file

# 'ecr' component vendoring config

# 'component.yaml' in the component folder is processed by the 'atmos' commands
# 'atmos vendor pull -c ecr' or 'atmos vendor pull --component ecr'

apiVersion: atmos/v1
kind: ComponentVendorConfig
spec:
source:
# 'uri' supports all protocols (local files, Git, Mercurial, HTTP, HTTPS, Amazon S3, Google GCP),
# and all URL and archive formats as described in https://github.com/hashicorp/go-getter
# In 'uri', Golang templates are supported https://pkg.go.dev/text/template
# If 'version' is provided, '{{ .Version }}' will be replaced with the 'version' value before pulling the files from 'uri'
uri: github.com/cloudposse-terraform-components/aws-ecr.git//src?ref={{ .Version }}
version: v1.538.0
# Only include the files that match the 'included_paths' patterns
# If 'included_paths' is not specified, all files will be matched except those that match the patterns from 'excluded_paths'
# 'included_paths' support POSIX-style Globs for file names/paths (double-star `**` is supported)
# https://en.wikipedia.org/wiki/Glob_(programming)
# https://github.com/bmatcuk/doublestar#patterns
included_paths:
- "**/**"
# Exclude the files that match any of the 'excluded_paths' patterns
# Note that we are excluding 'context.tf' since a newer version of it will be downloaded using 'mixins'
# 'excluded_paths' support POSIX-style Globs for file names/paths (double-star `**` is supported)
excluded_paths: []
# Mixins override files from 'source' with the same 'filename' (e.g. 'context.tf' will override 'context.tf' from the 'source')
# All mixins are processed in the order they are declared in the list.
mixins:
# https://github.com/hashicorp/go-getter/issues/98
- uri: https://raw.githubusercontent.com/cloudposse-terraform-components/mixins/{{ .Version }}/src/mixins/github-actions-iam-role/github-actions-iam-role.mixin.tf
version: v0.1.0
filename: github-actions-iam-role.mixin.tf
- uri: https://raw.githubusercontent.com/cloudposse-terraform-components/aws-ecr/refs/tags/{{ .Version }}/mixins/github-actions-iam-policy.tf
version: v1.538.0
filename: github-actions-iam-policy.tf

Variables

Required Variables

Context Variables

The following variables are defined in the context.tf file of this module and part of the terraform-null-label pattern.

Dependencies