diff --git a/test/unit-test/outputs.tf b/test/unit-test/outputs.tf index f71b439..5bb2635 100644 --- a/test/unit-test/outputs.tf +++ b/test/unit-test/outputs.tf @@ -1,33 +1,19 @@ -output "bastion_security_group_1" { - description = "Security group of bastion" - value = module.bastion_linux[0].bastion_security_group +output "bastion_launch_template" { + description = "Bastion launch templates" + value = { for idx, bastion in module.bastion_linux : "bastion_${idx}" => bastion.bastion_launch_template } } -output "bastion_launch_template_1" { - description = "Launch template of bastion" - value = module.bastion_linux[0].bastion_launch_template +output "bastion_s3_bucket" { + description = "Bastion S3 buckets" + value = { for idx, bastion in module.bastion_linux : "bastion_${idx}" => bastion.bastion_s3_bucket } } -output "bastion_s3_bucket_1" { - description = "S3 bucket of bastion" - value = module.bastion_linux[0].bastion_s3_bucket -} - -output "bastion_security_group_2" { - description = "Security group of bastion" - value = module.bastion_linux[1].bastion_security_group -} - -output "bastion_launch_template_2" { - description = "Launch template of bastion" - value = module.bastion_linux[1].bastion_launch_template -} - -output "bastion_s3_bucket_2" { - description = "S3 bucket of bastion" - value = module.bastion_linux[1].bastion_s3_bucket +output "bastion_security_group" { + description = "Bastion security groups" + value = { for idx, bastion in module.bastion_linux : "bastion_${idx}" => bastion.bastion_security_group } } output "bastion_kms_key" { - value = { for idx, bastion in module.bastion_linux : "bastion_${idx}" => bastion.bastion_kms_key } + description = "Bastion KMS keys" + value = { for idx, bastion in module.bastion_linux : "bastion_${idx}" => bastion.bastion_kms_key } }