generated from cloudposse/terraform-example-module
-
Notifications
You must be signed in to change notification settings - Fork 8
/
README.yaml
152 lines (129 loc) · 6.03 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name: terraform-tfe-cloud-infrastructure-automation
# Logo for this project
#logo: docs/logo.png
# License of this project
license: "APACHE2"
# Copyrights
copyrights:
- name: "Cloud Posse, LLC"
url: "https://cloudposse.com"
year: "2020"
# Canonical GitHub repo
github_repo: cloudposse/terraform-tfe-cloud-infrastructure-automation
# Badges to display
badges:
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/terraform-tfe-cloud-infrastructure-automation.svg"
url: "https://github.com/cloudposse/terraform-tfe-cloud-infrastructure-automation/releases/latest"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"
- name: "Discourse Forum"
image: "https://img.shields.io/discourse/https/ask.sweetops.com/posts.svg"
url: "https://ask.sweetops.com/"
related:
- name: "terraform-kubernetes-tfc-cloud-agent"
description: "Installs the Terraform Cloud Agent on an existing Kubernetes cluster."
url: "https://github.com/cloudposse/terraform-kubernetes-tfc-cloud-agent"
# List any resources helpful for someone to get started. For example, link to the hashicorp documentation or AWS documentation.
references:
- name: "Terraform Version Pinning"
description: "The required_version setting can be used to constrain which versions of the Terraform CLI can be used with your configuration"
url: "https://www.terraform.io/docs/configuration/terraform.html#specifying-a-required-terraform-version"
- name: "Terraform Cloud"
description: "Terraform Cloud is an application that helps teams use Terraform together."
url: "https://app.terraform.io/signup/account"
- name: "Terraform Enterprise/Cloud Documentation"
description: ""
url: "https://registry.terraform.io/providers/hashicorp/tfe/latest/docs"
# Short description of this project
description: |-
Terraform module to provision workspaces & configurations in Terraform Cloud via YAML configuration.
NOTE: Requires [Terraform Cloud or Terraform Enterprise](https://www.hashicorp.com/products/terraform/pricing).
# Introduction to the project
#introduction: |-
# This is an introduction.
# How to use this module. Should be an easy example to copy and paste.
usage: |-
Here's how to invoke this example module in your projects:
```hcl
provider "tfe" {
version = ">= 0.21.0"
}
module "example" {
source = "https://github.com/cloudposse/terraform-tfe-cloud-infrastructure-automation.git?ref=master"
# Directory containing all YAML configurations
config_file_path = "config"
organization = var.organization
vcs_repo = {
branch = "main"
ingress_submodules = true
# We recommend exporting the `FOOBAR` environment variable instead of passing a variable
oauth_token_id = var.oauth_token_id
}
}
```
# Example usage
examples: |-
Here is an example of using this module:
- [`examples/complete`](https://github.com/cloudposse/terraform-tfe-cloud-infrastructure-automation/) - complete example of using this module
We use YAML for the configuration files in order to separate configuration settings from business logic. It's also a portable format that can be used across multiple tools. Our convention is to name files by `$env-$stage.yaml` (e.g. `ue2-testing.yaml`), so for example an `$env` could be `ue2` (for `us-east-2`) and the `$stage` might be `testing`. Workspace names are derived from the `$env-$stage-$project`, which looks like `ue2-testing-eks`.
```yaml
# Projects are all the top-level root modules
projects:
# Globals are exported as TF_VAR_... environment variables in every workspace
globals:
# Used to determine the name of the workspace (e.g. the 'testing' in 'ue2-testing')
stage: testing
# Used to determine the name of the workspace (e.g. the 'ue2' in 'ue2-testing')
environment: ue2
# The configuration file format is designed to be used across multiple tools.
# All terraform projects should be listed under this section.
terraform:
# List one or more Terraform projects here
first-project:
# Controls whether or not this workspace should be created
# NOTE: If set to 'false', you cannot reference this workspace via `triggers` in another workspace!
workspace_enabled: true
# Override the version of Terraform for this workspace (defaults to the latest in Terraform Cloud/Enterprise)
terraform_version: 0.13.4
# Controls the `auto_apply` setting within this workspace
auto_apply: true
# Optional filename triggers to match (default is *.tf)
filename_triggers:
- "*.*"
# Add extra 'Run Triggers' to this workspace, beyond the parent workspace, which is created by default
# These triggers mean this project workspace will be automatically planned if any of these workspaces are applied.
triggers:
- uw2-testing-example2
- gbl-root-example1
# Set the Terraform input variable values for this project. Complex types like maps and lists are supported.
vars:
my_input_var: "Hello world! This is a value that needs to be passed to my `first-project` Terraform project."
# Every project should be uniquely named and correspond to a folder in the `projects/` directory
second-project:
workspace_enabled: true
# Specify a custom project folder (defalts to the project name if not specified)
custom_project_folder: my-custom-project-folder
vars:
my_input_var: "Hello world! This is another example!"
```
# How to get started quickly
#quickstart: |-
# Here's how to get started...
# Other files to include in this README from the project folder
include:
- "docs/targets.md"
- "docs/terraform.md"
# Contributors to this project
contributors:
- name: "Erik Osterman"
github: "osterman"
- name: "Dan Meyers"
github: "danjbh"