Skip to content

Commit

Permalink
fix account_id
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Aug 1, 2025
1 parent d6a6a2b commit 3b8b928
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions rolesanywhere/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ module "myrole3" {
| [local_file.aws_config_file](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource |
| [aws_arn.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/arn) | data source |
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_iam_account_alias.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_account_alias) | data source |
| [aws_iam_policy_document.role_anywhere_assume](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
| [aws_ssm_parameters_by_path.trust_east](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssm_parameters_by_path) | data source |
Expand Down
1 change: 1 addition & 0 deletions rolesanywhere/aws_config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "local_file" "aws_config_file" {
file_permission = "0644"
directory_permission = "0755"
content = templatefile("${path.module}/aws_config.tpl", {
account_id = local.account_id
account_alias = local.account_alias
role_name = local.role_name
role_arn = aws_iam_role.role.arn
Expand Down
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_alias}.${role_name}]
[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}

0 comments on commit 3b8b928

Please sign in to comment.