Skip to content

Commit

Permalink
feat: Added id of iam assumable role to outputs (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
msharma24 authored Sep 16, 2021
1 parent 5407865 commit 88d01b5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/iam-assumable-role/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ No inputs.

| Name | Description |
|------|-------------|
| <a name="output_iam_instance_profile_id"></a> [iam\_instance\_profile\_id](#output\_iam\_instance\_profile\_id) | IAM Instance profile's ID. |
| <a name="output_iam_role_arn"></a> [iam\_role\_arn](#output\_iam\_role\_arn) | ARN of IAM role |
| <a name="output_iam_role_name"></a> [iam\_role\_name](#output\_iam\_role\_name) | Name of IAM role |
| <a name="output_iam_role_path"></a> [iam\_role\_path](#output\_iam\_role\_path) | Path of IAM role |
Expand Down
3 changes: 2 additions & 1 deletion examples/iam-assumable-role/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ module "iam_assumable_role_admin" {
"codedeploy.amazonaws.com"
]

create_role = true
create_role = true
create_instance_profile = true

role_name = "admin"
role_requires_mfa = true
Expand Down
5 changes: 5 additions & 0 deletions examples/iam-assumable-role/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ output "role_requires_mfa" {
description = "Whether admin IAM role requires MFA"
value = module.iam_assumable_role_admin.role_requires_mfa
}

output "iam_instance_profile_id" {
description = "IAM Instance profile's ID."
value = module.iam_assumable_role_admin.iam_instance_profile_id
}
1 change: 1 addition & 0 deletions modules/iam-assumable-role/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_iam_instance_profile_arn"></a> [iam\_instance\_profile\_arn](#output\_iam\_instance\_profile\_arn) | ARN of IAM instance profile |
| <a name="output_iam_instance_profile_id"></a> [iam\_instance\_profile\_id](#output\_iam\_instance\_profile\_id) | IAM Instance profile's ID. |
| <a name="output_iam_instance_profile_name"></a> [iam\_instance\_profile\_name](#output\_iam\_instance\_profile\_name) | Name of IAM instance profile |
| <a name="output_iam_instance_profile_path"></a> [iam\_instance\_profile\_path](#output\_iam\_instance\_profile\_path) | Path of IAM instance profile |
| <a name="output_iam_role_arn"></a> [iam\_role\_arn](#output\_iam\_role\_arn) | ARN of IAM role |
Expand Down
5 changes: 5 additions & 0 deletions modules/iam-assumable-role/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ output "iam_instance_profile_name" {
value = element(concat(aws_iam_instance_profile.this.*.name, [""]), 0)
}

output "iam_instance_profile_id" {
description = "IAM Instance profile's ID."
value = element(concat(aws_iam_instance_profile.this.*.id, [""]), 0)
}

output "iam_instance_profile_path" {
description = "Path of IAM instance profile"
value = element(concat(aws_iam_instance_profile.this.*.path, [""]), 0)
Expand Down

0 comments on commit 88d01b5

Please sign in to comment.