-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: updating and adding some outputs
- Loading branch information
Showing
4 changed files
with
37 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1 @@ | ||
data "terraform_remote_state" "this" { | ||
backend = "s3" | ||
|
||
config = { | ||
bucket = format("%s-tfstate", local.tf_state_bucket) | ||
key = format("%s.tfstate", var.repository) | ||
|
||
## We can assume via the web identity token if it is provided | ||
assume_role_with_web_identity = var.web_identity_token_file != null ? { | ||
role_arn = local.role_arn | ||
web_identity_token_file = var.web_identity_token_file | ||
} : null | ||
|
||
## We can assume via the reader role if no web identity token is provided | ||
assume_role = var.web_identity_token_file == null ? { | ||
role_arn = local.role_arn | ||
} : null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
output "outputs" { | ||
value = data.terraform_remote_state.this.outputs | ||
description = "The outputs from the terraform_remote_state data source." | ||
value = data.terraform_remote_state.this.outputs | ||
} | ||
|
||
output "bucket_name" { | ||
description = "The name of the S3 bucket where the Terraform state is stored." | ||
value = local.tf_state_bucket | ||
} | ||
|
||
output "bucket_key" { | ||
description = "The key of the S3 bucket where the Terraform state is stored." | ||
value = local.tf_state_key | ||
} |