terraform-aws-bastion
terraform-aws-bastion copied to clipboard
Clarify or improve output type/value of output bastion_host_security_group
If I understand correctly, since the bastion host security group could be provided as input, it is not necessarily created
Is there no way to ensure either the provided security_group_id or the created security_group.id be exported as a single string output ?
Currently, If I understand correctly, we need to use module.given_name.bastion_host_security_group[0] to get the security group ID and this works only when the SG is created inside the module right ?
Can't we instead do something like
output "bastion_host_security_group" {
value = flatten([var.bastion_security_group_id, resource.aws_security_group.bastion_host_security_group])[0]
}
to export a single value that is either the provided or the generated security group id ? Or am I getting something wrong ? (in which case it could be helpful to add a description to this output)