From 763172d25e393f4ede4b3a30ce813a632a392d70 Mon Sep 17 00:00:00 2001 From: X82 Softworks Admin <72248103+X82Softworks@users.noreply.github.com> Date: Thu, 4 Feb 2021 19:12:55 +0200 Subject: [PATCH] Expose ARN for service so we don't have to manually construct it (#96) * Expose ARN for service so we don't have to manually construct it * fix: sweetops recommended changes as arn is not exported and is under id instead * Update outputs.tf Co-authored-by: Vladimir * fix: update with make Co-authored-by: Tiamarch Co-authored-by: Vladimir --- README.md | 1 + docs/terraform.md | 1 + outputs.tf | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 3256f50..e87cc39 100644 --- a/README.md +++ b/README.md @@ -331,6 +331,7 @@ Available targets: |------|-------------| | ecs\_exec\_role\_policy\_id | The ECS service role policy ID, in the form of `role_name:role_policy_name` | | ecs\_exec\_role\_policy\_name | ECS service role name | +| service\_arn | ECS Service ARN | | service\_name | ECS Service name | | service\_role\_arn | ECS Service role ARN | | service\_security\_group\_id | Security Group ID of the ECS task | diff --git a/docs/terraform.md b/docs/terraform.md index 01f2b53..a336d8b 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -83,6 +83,7 @@ |------|-------------| | ecs\_exec\_role\_policy\_id | The ECS service role policy ID, in the form of `role_name:role_policy_name` | | ecs\_exec\_role\_policy\_name | ECS service role name | +| service\_arn | ECS Service ARN | | service\_name | ECS Service name | | service\_role\_arn | ECS Service role ARN | | service\_security\_group\_id | Security Group ID of the ECS task | diff --git a/outputs.tf b/outputs.tf index e209935..ad2c055 100644 --- a/outputs.tf +++ b/outputs.tf @@ -13,6 +13,11 @@ output "service_name" { value = join("", aws_ecs_service.default.*.name) != "" ? join("", aws_ecs_service.default.*.name) : join("", aws_ecs_service.ignore_changes_task_definition.*.name) } +output "service_arn" { + description = "ECS Service ARN" + value = join("", aws_ecs_service.default.*.id) != "" ? join("", aws_ecs_service.default.*.id) : join("", aws_ecs_service.ignore_changes_task_definition.*.id) +} + output "service_role_arn" { description = "ECS Service role ARN" value = join("", aws_iam_role.ecs_service.*.arn)