-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.yaml
122 lines (99 loc) · 4.35 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
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name: terraform-provider-context
# 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: "2024"
# Canonical GitHub repo
github_repo: cloudposse/terraform-provider-context
# Badges to display
badges:
- name: Latest Release
image: https://img.shields.io/github/release/cloudposse/terraform-provider-context.svg?style=for-the-badge
url: https://github.com/cloudposse/terraform-provider-context/releases/latest
- name: Last Updated
image: https://img.shields.io/github/last-commit/cloudposse/terraform-provider-context.svg?style=for-the-badge
url: https://github.com/cloudposse/terraform-provider-context/commits
- name: Slack Community
image: https://slack.cloudposse.com/for-the-badge.svg
url: https://slack.cloudposse.com
# List any related terraform modules that this module may be used with or that this module depends on.
# related: []
# List any resources helpful for someone to get started. For example, link to the hashicorp documentation or AWS documentation.
references:
- name: "Terraform Plugins"
description: "Terraform is logically split into two main parts: Terraform Core and Terraform Plugins. Each plugin exposes an implementation for a specific service, such as the AWS provider or the cloud-init provider."
url: "https://www.terraform.io/docs/extend/plugin-types.html#providers"
# Short description of this project
description: |-
Terrform provider for managing a context in Terraform. A context, in this case, is a set of key-value pairs that can
be used to enable or disable a module, as well as generating consistent resource names and tags for cloud resources.
introduction: |-
Terrform provider for managing a context in Terraform. A context, in this case, is a set of key-value pairs that can
be used to enable or disable a module, as well as generating consistent resource names and tags for cloud resources.
This provider is intended to be a replacement for Cloud Posse's
[terraform-null-label](https://github.com/cloudposse/terraform-null-label) Terraform module as well as the
[context.tf](https://github.com/cloudposse/terraform-null-label/blob/main/exports/context.tf) export from that module,
which is copied into all of Cloud Posse's modules and components (root modules) via automation.
The provider is designed to be more flexible and easier to use than the `terraform-null-label` module, and to provide
a consistent way to manage context across all of Cloud Posse's modules and components via a provider, rather than a
Terraform module. This provider also allows flexibility in the property names that can be used to generate labels and
tags, where the previous module-based solution was limited to a fixed set of properties (namespace, tenant, stage,
environment, name and attributes).
# How to use this module. Should be an easy example to copy and paste.
usage: |-
Here is how to use this provider in your own Terraform code:
```hcl
provider "context" {
delimiter = "~"
enabled = false
properties = {
namespace = {}
tenant = {}
stage = {}
environment = {}
name = {}
}
property_order = ["namespace", "tenant", "stage", "environment", "name"]
values = {
"namespace" = "cp"
"tenant" = "core"
"stage" = "prod"
"environment" = "ue1"
"name" = "example"
}
}
data "context_label" "example" {
values = {
"tenant" = "plat"
"stage" = "dev"
}
}
data "context_label" "example" {
template = "{{.namespace}}/{{.tenant}}/{{.stage}}/{{.name}}"
values = {
"tenant" = "plat"
"stage" = "dev"
}
}
```
See the [Docs](./docs) for additional information.
# Example usage
examples: |-
Here are some additional examples:
- [`examples/data-sources/config`](/examples/data-sources/config/)
- [`examples/data-sources/label-delimited`](/examples/data-sources/label-delimited/)
- [`examples/data-sources/label-templated`](/examples/data-sources/label-templated/)
- [`examples/data-sources/tags`](/examples/data-sources/tags/)
include: []
# Contributors to this project
contributors: [""]