Terraform TGW VPC Attachment Data Source filter

I am trying to get TGW VPC Attachment data source using a vpc_owner_id filter.

I tried:

data "aws_ec2_transit_gateway_vpc_attachment" "attach" { filter { name = "vpc-owner-id" values = ["543265436543"]
}
}

and

data "aws_ec2_transit_gateway_vpc_attachment" "attach" { filter { name = "vpc_owner_id" values = ["543265436543"]
}
}

and

data "aws_ec2_transit_gateway_vpc_attachment" "attach" { filter { name = "resource-owner-id" values = ["543265436543"]
}
}

I get that the Value for the parameter Filter is invalid.
One of the attributes of the TGW VPC Attachment is vpc_owner_id.

Is that possible to get this data source using vpc owner id Filter?

1

1 Answer

There are no filters vpc_owner_id nor vpc-owner-id. The only valid one is resource-owner-id. For the list of valid filters please refer to AWS docs.

If any of the given filters does not suit you, you have to develop your own custom data source.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like