Reputation: 2292
I am starting to learn terraform. I created a vpc thusly:
resource "aws_vpc" "my-vpc" {
cidr_block = "10.0.0.0/16"
tags = {
terraform = "true"
}
}
I thought it would be named my-vpc
in the management console but it wasn't. The name is blank. And on the documentation page there is no "name" attribute: when I tried setting a name
I got an error during the apply (An argument named "name" is not expected here.)
I can't believe you can't set a name?! What am I missing?
Upvotes: 7
Views: 2900
Reputation: 238081
Name of a VPC is just a tag called Name
:
resource "aws_vpc" "my-vpc" {
cidr_block = "10.0.0.0/16"
tags = {
terraform = "true"
Name = "myvpc"
}
}
Upvotes: 16