Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit 7c33a0c

Browse files
Mike McGirrketzacoatl
authored andcommitted
tf-cloud-credential: switch to datasource and fix variable
1 parent 773d512 commit 7c33a0c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
resource "tfe_workspace" "workspace" {
2-
name = var.workspace_name_prefix
1+
data "tfe_workspace" "workspace" {
2+
name = var.name_prefix
33
organization = var.organization
44
}

modules/tf-cloud-credential/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
resource "tfe_variable" "workspace_aws_access_key_id" {
2-
workspace_id = tfe_workspace.workspace.id
2+
workspace_id = data.tfe_workspace.workspace.id
33
key = "AWS_ACCESS_KEY_ID"
44
value = var.iam_access_key.id
55
category = "env"
66
sensitive = true
77
}
88

99
resource "tfe_variable" "workspace_aws_secret_access_key_id" {
10-
workspace_id = tfe_workspace.workspace.id
10+
workspace_id = data.tfe_workspace.workspace.id
1111
key = "AWS_SECRET_ACCESS_KEY"
1212
value = var.iam_access_key.secret
1313
category = "env"
1414
sensitive = true
1515
}
1616

1717
resource "tfe_variable" "workspace_aws_default_region" {
18-
workspace_id = tfe_workspace.workspace.id
18+
workspace_id = data.tfe_workspace.workspace.id
1919
key = "AWS_DEFAULT_REGION"
2020
value = var.region
2121
category = "env"

0 commit comments

Comments
 (0)