Skip to content

Commit

Permalink
CC-2017: [count.index]/[each.key] -> [*], added try().
Browse files Browse the repository at this point in the history
  • Loading branch information
mmgovuk committed Aug 21, 2023
1 parent 5930ed5 commit 0e0cea4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
22 changes: 11 additions & 11 deletions terraform/environments/ccms-ebs/ccms-certificates-outputs.tf
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
output "aws_acm_certificate-external-arn" {
description = "aws_acm_certificate external arn"
value = aws_acm_certificate.external[count.index].arn
value = try(aws_acm_certificate.external[*].arn, "None")
}

output "aws_acm_certificate-external-domain_name" {
description = "aws_acm_certificate external domain_name"
value = aws_acm_certificate.external[count.index].domain_name
value = try(aws_acm_certificate.external[*].domain_name, "None")
}

output "aws_acm_certificate-external-not_after" {
description = "aws_acm_certificate external not_after"
value = aws_acm_certificate.external[count.index].not_after
value = try(try(aws_acm_certificate.external[*].not_after, "None"), "None")
}

output "aws_acm_certificate-external-status" {
description = "aws_acm_certificate external status"
value = aws_acm_certificate.external[count.index].status
value = try(aws_acm_certificate.external[*].status, "None")
}

#

output "aws_acm_certificate-external-service-arn" {
description = "aws_acm_certificate external-service arn"
value = aws_acm_certificate.external-service[count.index].arn
value = try(aws_acm_certificate.external-service[*].arn, "None")
}

output "aws_acm_certificate-external-service-domain_name" {
description = "aws_acm_certificate external-service domain_name"
value = aws_acm_certificate.external-service[count.index].domain_name
value = try(aws_acm_certificate.external-service[*].domain_name, "None")
}

output "aws_acm_certificate-external-service-not_after" {
description = "aws_acm_certificate external-service not_after"
value = aws_acm_certificate.external-service[count.index].not_after
value = try(aws_acm_certificate.external-service[*].not_after, "None")
}

output "aws_acm_certificate-external-service-status" {
description = "aws_acm_certificate external-service status"
value = aws_acm_certificate.external-service[count.index].status
value = try(aws_acm_certificate.external-service[*].status, "None")
}

#

output "aws_route53_record-external_validation-fqdn" {
description = "aws_route53_record external_validation fqdn"
value = aws_route53_record.external_validation[count.index].fqdn
value = try(aws_route53_record.external_validation[*].fqdn, "None")
}

output "aws_route53_record-external_validation-name" {
description = "aws_route53_record external_validation name"
value = aws_route53_record.external_validation[count.index].name
value = try(aws_route53_record.external_validation[*].name, "None")
}

#

output "aws_acm_certificate_validation-external-id" {
description = "aws_acm_certificate_validation external id"
value = aws_acm_certificate_validation.external[count.index].id
value = try(aws_acm_certificate_validation.external[*].id, "None")
}
2 changes: 1 addition & 1 deletion terraform/environments/ccms-ebs/ccms-cloudwatch-outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ output "aws_ssm_document_cloud_watch_agent_description" {

output "aws_cloudwatch_log_group_groups_arn" {
description = "aws_cloudwatch_log_group groups arn"
value = aws_cloudwatch_log_group.groups[each.key].arn
value = try(aws_cloudwatch_log_group.groups[*].arn, "None")
}

#
Expand Down
14 changes: 7 additions & 7 deletions terraform/environments/ccms-ebs/ccms-dlm-outputs.tf
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
output "aws_iam_role_dlm_lifecycle_role_arn" {
description = "aws_iam_role dlm_lifecycle_role arn"
value = aws_iam_role.dlm_lifecycle_role[count.index].arn
value = try(aws_iam_role.dlm_lifecycle_role[*].arn, "None")
}

output "aws_iam_role_dlm_lifecycle_role_name" {
description = "aws_iam_role dlm_lifecycle_role name"
value = aws_iam_role.dlm_lifecycle_role[count.index].name
value = try(aws_iam_role.dlm_lifecycle_role[*].name, "None")
}

#

output "aws_iam_role_policy_dlm_lifecycle_id" {
description = "aws_iam_role_policy dlm_lifecycle id"
value = aws_iam_role_policy.dlm_lifecycle[count.index].id
value = try(aws_iam_role_policy.dlm_lifecycle[*].id, "None")
}

output "aws_iam_role_policy_dlm_lifecycle_name" {
description = "aws_iam_role_policy dlm_lifecycle name"
value = aws_iam_role_policy.dlm_lifecycle[count.index].name
value = try(aws_iam_role_policy.dlm_lifecycle[*].name, "None")
}

output "aws_iam_role_policy_dlm_lifecycle_policy" {
description = "aws_iam_role_policy dlm_lifecycle policy"
value = aws_iam_role_policy.dlm_lifecycle[count.index].policy
value = try(aws_iam_role_policy.dlm_lifecycle[*].policy, "None")
}

output "aws_iam_role_policy_dlm_lifecycle_role" {
description = "aws_iam_role_policy dlm_lifecycle role"
value = aws_iam_role_policy.dlm_lifecycle[count.index].role
value = try(aws_iam_role_policy.dlm_lifecycle[*].role, "None")
}

#

output "aws_dlm_lifecycle_policy_lifecyclerole_arn" {
description = "aws_dlm_lifecycle_policy lifecyclerole arn"
value = aws_dlm_lifecycle_policy.lifecyclerole[count.index].arn
value = try(aws_dlm_lifecycle_policy.lifecyclerole[*].arn, "None")
}

0 comments on commit 0e0cea4

Please sign in to comment.