This repository was archived by the owner on Jul 11, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +67
-0
lines changed
modules/tf-cloud-credential Expand file tree Collapse file tree 5 files changed +67
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## TF Cloud AWS credentials
2
+
3
+ This module associates credential values as environmental variables to
4
+ a tfe workspace.
Original file line number Diff line number Diff line change
1
+ resource "tfe_workspace" "workspace" {
2
+ name = var. workspace_name_prefix
3
+ organization = var. organization
4
+ }
Original file line number Diff line number Diff line change
1
+ resource "tfe_variable" "workspace_aws_access_key_id" {
2
+ workspace_id = " ${ tfe_workspace . workspace . id } "
3
+ key = " AWS_ACCESS_KEY_ID"
4
+ value = var. iam_access_key . id
5
+ category = " env"
6
+ sensitive = true
7
+ }
8
+
9
+ resource "tfe_variable" "workspace_aws_secret_access_key_id" {
10
+ workspace_id = " ${ tfe_workspace . workspace . id } "
11
+ key = " AWS_SECRET_ACCESS_KEY"
12
+ value = var. iam_access_key . secret
13
+ category = " env"
14
+ sensitive = true
15
+ }
16
+
17
+ resource "tfe_variable" "workspace_aws_default_region" {
18
+ workspace_id = " ${ tfe_workspace . workspace . id } "
19
+ key = " AWS_DEFAULT_REGION"
20
+ value = var. region
21
+ category = " env"
22
+ sensitive = false
23
+ }
Original file line number Diff line number Diff line change
1
+ output "workspace_aws_access_key_id" {
2
+ value = tfe_variable. workspace_aws_access_key_id . id
3
+ description = " Access key tfe_variable id"
4
+ }
5
+
6
+ output "workspace_aws_secret_access_key_id" {
7
+ value = tfe_variable. workspace_aws_secret_access_key_id . id
8
+ description = " Access secret tfe_variable id"
9
+ }
10
+
11
+ output "workspace_aws_default_region" {
12
+ value = tfe_variable. workspace_aws_default_region . id
13
+ description = " Region tfe_variable id"
14
+ }
Original file line number Diff line number Diff line change
1
+ variable "name_prefix" {
2
+ type = string
3
+ description = " The name prefix to use for the workspace"
4
+ }
5
+
6
+ variable "organization" {
7
+ type = string
8
+ description = " The workspace organization"
9
+ }
10
+
11
+ variable "iam_access_key" {
12
+ type = object ({
13
+ id = string
14
+ secret = string
15
+ })
16
+ description = " The aws_iam_access_key id/secret pair to use as credentials for the workspace."
17
+ }
18
+
19
+ variable "region" {
20
+ type = string
21
+ description = " The aws region"
22
+ }
You can’t perform that action at this time.
0 commit comments