Simply I'm trying to adopt some project tags to an existing internet gateway, by using data statements
data "aws_internet_gateway" "internet_gateway" {
filter {
name = "attachment.vpc-id"
values = [ aws_default_vpc.network[0].id ]
}
tags = var.tags
}
I've also checked with aws cli, here is the output
aws ec2 describe-internet-gateways
{
"InternetGateways": [
{
"Attachments": [
{
"State": "available",
"VpcId": "vpc-***"
}
],
"InternetGatewayId": "igw-***",
"OwnerId": "***",
"Tags": []
}
]
}
The filter I've used were in the example of terraform official documentation web page https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/internet_gateway