Monday, 26 October 2020

Output variable for terraform


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

Configure EKS Persistent Static Storage With Elastic File System Using Terraform

  checkout :https://youtu.be/QuUIgQWBBZM