Output variable:
In this example, I refer Attributes Reference value on AWS_VPC resource.
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc#attributes-reference
variable "inputname" {
type = string
description = "set the name of the vpc"
}
resource "aws_vpc" "myvpc" {
cidr_block = "10.0.0.0/16"
tags = {
Name = var.inputname
}
}
output "vpcid" {
value = aws_vpc.myvpc.id
}
No comments:
Post a Comment