Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Istrati committed Apr 26, 2024
1 parent 29601df commit faf59d2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
11 changes: 0 additions & 11 deletions iac/fraud/s3_runtime/data.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
data "terraform_remote_state" "iam" {
backend = "s3"
config = {
skip_region_validation = true

region = data.aws_region.this.name
bucket = var.backend_bucket[data.aws_region.this.name]
key = format(var.backend_pattern, "iam_role_assume")
}
}

data "terraform_remote_state" "s3" {
count = (
data.aws_region.this.name == element(keys(var.backend_bucket), 1)
Expand Down
1 change: 1 addition & 0 deletions iac/fraud/s3_runtime/default.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ q = {
sse_algorithm = "AES256" # "aws:kms"
versioning_status = "Enabled"
logs_prefix = "s3_runtime_logs"
assume_role_name = "spf-cicd-assume-role"
}
1 change: 0 additions & 1 deletion iac/fraud/s3_runtime/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ locals {
data.aws_region.this.name == element(keys(var.backend_bucket), 0)
? random_id.this.hex : data.terraform_remote_state.s3.0.outputs.spf_gid
) : var.spf_gid)
role_name = data.terraform_remote_state.iam.outputs.name
}
2 changes: 1 addition & 1 deletion iac/fraud/s3_runtime/state.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ output "region2" {
}

output "role_name" {
value = local.role_name
value = format("%s-%s-%s", var.q.assume_role_name, aws_s3_bucket.this.region, local.spf_gid)
}

output "spf_gid" {
Expand Down

0 comments on commit faf59d2

Please sign in to comment.