Utilize list comprehension to output EC2 ARNs.
This commit is contained in:
parent
b927d6346a
commit
5ae1a3d752
@ -5,7 +5,7 @@
|
||||
|
||||
# filter {
|
||||
# name = "name"
|
||||
# values = var.compute_ami
|
||||
# values = ["amazon linux"]
|
||||
# }
|
||||
|
||||
# filter {
|
||||
@ -18,3 +18,6 @@
|
||||
# values = ["x86_64"]
|
||||
# }
|
||||
# }
|
||||
|
||||
# data "" "ec2_arns" {
|
||||
# }
|
@ -1,4 +1,5 @@
|
||||
terraform {
|
||||
required_version = ">= 0.13.1"
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
|
@ -1,9 +1,10 @@
|
||||
output "compute_ami" {
|
||||
description = "Prints the image AMI installed on our EC2s."
|
||||
value = data.aws_ami.compute_ami
|
||||
}
|
||||
# output "compute_ami" {
|
||||
# description = "Prints the image AMI installed on our EC2s."
|
||||
# value = data.aws_ami.compute_ami
|
||||
# }
|
||||
|
||||
# Extract EC2 ARN from each instance, into a new map.
|
||||
output "public_ec2" {
|
||||
description = "Prints the ARN for the publicly accessible EC2"
|
||||
value = module.standalone_ec2.arn
|
||||
}
|
||||
description = "Prints the ARN for the publicly accessible EC2(s)"
|
||||
value = [for idx, val in module.standalone_ec2 : val.arn]
|
||||
}
|
Loading…
Reference in New Issue
Block a user