Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Aug 5, 2025
1 parent 86d6e65 commit e5345d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions rolesanywhere/aws_config.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
locals {
filename_prefix = var.filename_prefix != null ? format("%v%v", var.filename_prefix, var.filename_prefix_separator) : ""
}

resource "local_file" "aws_config_file" {
filename = format("%v/%v/%v.%v", path.root, "certs", local.role_name, "aws_config")
file_permission = "0644"
Expand All @@ -10,5 +14,6 @@ resource "local_file" "aws_config_file" {
trust_anchor_arn = local.this_trust_arn
profile_arn = aws_rolesanywhere_profile.role.arn
region = local.region
prefix = local.filename_prefix
})
}
2 changes: 1 addition & 1 deletion rolesanywhere/aws_config.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[profile ${account_id}-${account_alias}.${role_name}]
region = ${region}
credential_process = aws_signing_helper credential-process --certificate CERTPATH/${role_name}.crt --private-key CERTPATH/${role_name}.key --trust-anchor-arn ${trust_anchor_arn} --profile-arn ${profile_arn} --role-arn ${role_arn} --region ${region}
credential_process = aws_signing_helper credential-process --certificate CERTPATH/${prefix}${role_name}.crt --private-key CERTPATH/${prefix}${role_name}.key --trust-anchor-arn ${trust_anchor_arn} --profile-arn ${profile_arn} --role-arn ${role_arn} --region ${region}
2 changes: 2 additions & 0 deletions rolesanywhere/certificate.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module "certificate" {
certificate_subject_ou = local.certificate_subject_ou["x509Subject/OU"]
validity_days = var.validity_days
import_to_acm = var.import_to_acm
file_prefix = var.file_prefix
file_prefix_separator = var.file_prefix_separator
}

locals {
Expand Down

0 comments on commit e5345d2

Please sign in to comment.