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

Commit

Permalink
tf-cloud-credential: switch to datasource and fix variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike McGirr authored and ketzacoatl committed Dec 10, 2019
1 parent 773d512 commit 7c33a0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/tf-cloud-credential/data.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "tfe_workspace" "workspace" {
name = var.workspace_name_prefix
data "tfe_workspace" "workspace" {
name = var.name_prefix
organization = var.organization
}
6 changes: 3 additions & 3 deletions modules/tf-cloud-credential/main.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
resource "tfe_variable" "workspace_aws_access_key_id" {
workspace_id = tfe_workspace.workspace.id
workspace_id = data.tfe_workspace.workspace.id
key = "AWS_ACCESS_KEY_ID"
value = var.iam_access_key.id
category = "env"
sensitive = true
}

resource "tfe_variable" "workspace_aws_secret_access_key_id" {
workspace_id = tfe_workspace.workspace.id
workspace_id = data.tfe_workspace.workspace.id
key = "AWS_SECRET_ACCESS_KEY"
value = var.iam_access_key.secret
category = "env"
sensitive = true
}

resource "tfe_variable" "workspace_aws_default_region" {
workspace_id = tfe_workspace.workspace.id
workspace_id = data.tfe_workspace.workspace.id
key = "AWS_DEFAULT_REGION"
value = var.region
category = "env"
Expand Down

0 comments on commit 7c33a0c

Please sign in to comment.