From 3530d3f86ab2fe54aadd1dad729f4f54cb7683a8 Mon Sep 17 00:00:00 2001 From: John Barney Date: Sat, 11 Apr 2020 00:52:16 +0800 Subject: [PATCH 1/5] Add Outpost Local Gateway support --- aws/data_source_aws_local_gateway.go | 117 +++++++++++++++++++++ aws/data_source_aws_local_gateway_test.go | 48 +++++++++ aws/data_source_aws_local_gateways.go | 75 +++++++++++++ aws/data_source_aws_local_gateways_test.go | 23 ++++ aws/provider.go | 2 + 5 files changed, 265 insertions(+) create mode 100644 aws/data_source_aws_local_gateway.go create mode 100644 aws/data_source_aws_local_gateway_test.go create mode 100644 aws/data_source_aws_local_gateways.go create mode 100644 aws/data_source_aws_local_gateways_test.go diff --git a/aws/data_source_aws_local_gateway.go b/aws/data_source_aws_local_gateway.go new file mode 100644 index 00000000000..277649dc799 --- /dev/null +++ b/aws/data_source_aws_local_gateway.go @@ -0,0 +1,117 @@ +package aws + +import ( + "fmt" + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +func dataSourceAwsLocalGateway() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsLocalGatewayRead, + + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + "outpost_arn": { + Type: schema.TypeString, + Computed: true, + }, + + "filter": ec2CustomFiltersSchema(), + + "state": { + Type: schema.TypeString, + Computed: true, + }, + + "tags": tagsSchemaComputed(), + + "owner_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataSourceAwsLocalGatewayRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + req := &ec2.DescribeLocalGatewaysInput{} + + var id string + if cid, ok := d.GetOk("id"); ok { + id = cid.(string) + } + + if id != "" { + req.LocalGatewayIds = []*string{aws.String(id)} + } + + req.Filters = buildEC2AttributeFilterList( + map[string]string{ + "outpost_arn": d.Get("outpost_arn").(string), + "owner_id": d.Get("owner_id").(string), + "state": d.Get("state").(string), + }, + ) + + if tags, tagsOk := d.GetOk("tags"); tagsOk { + req.Filters = append(req.Filters, buildEC2TagFilterList( + keyvaluetags.New(tags.(map[string]interface{})).Ec2Tags(), + )...) + } + + req.Filters = append(req.Filters, buildEC2CustomFilterList( + d.Get("filter").(*schema.Set), + )...) + if len(req.Filters) == 0 { + // Don't send an empty filters list; the EC2 API won't accept it. + req.Filters = nil + } + + log.Printf("[DEBUG] Reading AWS LOCAL GATEWAY: %s", req) + resp, err := conn.DescribeLocalGateways(req) + if err != nil { + return err + } + if resp == nil || len(resp.LocalGateways) == 0 { + return fmt.Errorf("no matching VPC found") + } + if len(resp.LocalGateways) > 1 { + return fmt.Errorf("multiple Local Gateways matched; use additional constraints to reduce matches to a single VPC") + } + + localGateway := resp.LocalGateways[0] + + d.SetId(aws.StringValue(localGateway.LocalGatewayId)) + d.Set("outpost_arn", localGateway.OutpostArn) + d.Set("state", localGateway.State) + + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(localGateway.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + d.Set("owner_id", localGateway.OwnerId) + + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "outposts", + Region: meta.(*AWSClient).region, + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("outpost/%s", d.Id()), + }.String() + d.Set("arn", arn) + + return nil +} diff --git a/aws/data_source_aws_local_gateway_test.go b/aws/data_source_aws_local_gateway_test.go new file mode 100644 index 00000000000..f42d31a8872 --- /dev/null +++ b/aws/data_source_aws_local_gateway_test.go @@ -0,0 +1,48 @@ +package aws + +import ( + "fmt" + "os" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccDataSourceAwsLocalGateway_basic(t *testing.T) { + dsResourceName := "data.aws_local_gateway.by_id" + + localGatewayId := os.Getenv("AWS_LOCAL_GATEWAY_ID") + if localGatewayId == "" { + t.Skip( + "Environment variable AWS_LOCAL_GATEWAY_ID is not set. " + + "This environment variable must be set to the ID of " + + "a deployed Local Gateway to enable this test.") + } + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsLocalGatewayConfig(localGatewayId), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + dsResourceName, "id", localGatewayId), + testAccCheckResourceAttrAccountID(dsResourceName, "owner_id"), + resource.TestCheckResourceAttrSet( + dsResourceName, "state"), + resource.TestCheckResourceAttrSet( + dsResourceName, "outpost_arn"), + ), + }, + }, + }) +} + +func testAccDataSourceAwsLocalGatewayConfig(localGatewayId string) string { + return fmt.Sprintf(` +data "aws_local_gateway" "by_id" { + id = "%s" +} +`, localGatewayId) +} diff --git a/aws/data_source_aws_local_gateways.go b/aws/data_source_aws_local_gateways.go new file mode 100644 index 00000000000..fdca1de6ef0 --- /dev/null +++ b/aws/data_source_aws_local_gateways.go @@ -0,0 +1,75 @@ +package aws + +import ( + "fmt" + "log" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +func dataSourceAwsLocalGateways() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsLocalGatewaysRead, + Schema: map[string]*schema.Schema{ + "filter": ec2CustomFiltersSchema(), + + "tags": tagsSchemaComputed(), + + "ids": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + }, + } +} + +func dataSourceAwsLocalGatewaysRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + req := &ec2.DescribeLocalGatewaysInput{} + + if tags, tagsOk := d.GetOk("tags"); tagsOk { + req.Filters = append(req.Filters, buildEC2TagFilterList( + keyvaluetags.New(tags.(map[string]interface{})).Ec2Tags(), + )...) + } + + if filters, filtersOk := d.GetOk("filter"); filtersOk { + req.Filters = append(req.Filters, buildEC2CustomFilterList( + filters.(*schema.Set), + )...) + } + if len(req.Filters) == 0 { + // Don't send an empty filters list; the EC2 API won't accept it. + req.Filters = nil + } + + log.Printf("[DEBUG] DescribeLocalGateways %s\n", req) + resp, err := conn.DescribeLocalGateways(req) + if err != nil { + return err + } + + if resp == nil || len(resp.LocalGateways) == 0 { + return fmt.Errorf("no matching VPC found") + } + + localgateways := make([]string, 0) + + for _, localgateway := range resp.LocalGateways { + localgateways = append(localgateways, aws.StringValue(localgateway.LocalGatewayId)) + } + + d.SetId(time.Now().UTC().String()) + if err := d.Set("ids", localgateways); err != nil { + return fmt.Errorf("Error setting local gateway ids: %s", err) + } + + return nil +} diff --git a/aws/data_source_aws_local_gateways_test.go b/aws/data_source_aws_local_gateways_test.go new file mode 100644 index 00000000000..723a3acfe61 --- /dev/null +++ b/aws/data_source_aws_local_gateways_test.go @@ -0,0 +1,23 @@ +package aws + +import ( + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "testing" +) + +func TestAccDataSourceAwsLocalGateways_basic(t *testing.T) { + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsLocalGatewaysConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsVpcsDataSourceExists("data.aws_local_gateways.all"), + ), + }, + }, + }) +} + +const testAccDataSourceAwsLocalGatewaysConfig = `data "aws_local_gateways" "all" {}` diff --git a/aws/provider.go b/aws/provider.go index f44c84c4609..2099ceec14d 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -265,6 +265,8 @@ func Provider() terraform.ResourceProvider { "aws_mq_broker": dataSourceAwsMqBroker(), "aws_msk_cluster": dataSourceAwsMskCluster(), "aws_msk_configuration": dataSourceAwsMskConfiguration(), + "aws_local_gateways": dataSourceAwsLocalGateways(), + "aws_local_gateway": dataSourceAwsLocalGateway(), "aws_nat_gateway": dataSourceAwsNatGateway(), "aws_network_acls": dataSourceAwsNetworkAcls(), "aws_network_interface": dataSourceAwsNetworkInterface(), From 22ea4dd1038acc0aef513afc554d6d9a177accaf Mon Sep 17 00:00:00 2001 From: John Barney Date: Sat, 11 Apr 2020 01:08:02 +0800 Subject: [PATCH 2/5] Add docs, accept state filter --- aws/data_source_aws_local_gateway.go | 3 +- website/docs/d/local_gateway.html.markdown | 61 +++++++++++++++++++++ website/docs/d/local_gateways.html.markdown | 47 ++++++++++++++++ 3 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 website/docs/d/local_gateway.html.markdown create mode 100644 website/docs/d/local_gateways.html.markdown diff --git a/aws/data_source_aws_local_gateway.go b/aws/data_source_aws_local_gateway.go index 277649dc799..f1535806e65 100644 --- a/aws/data_source_aws_local_gateway.go +++ b/aws/data_source_aws_local_gateway.go @@ -31,6 +31,7 @@ func dataSourceAwsLocalGateway() *schema.Resource { "state": { Type: schema.TypeString, + Optional: true, Computed: true, }, @@ -60,8 +61,6 @@ func dataSourceAwsLocalGatewayRead(d *schema.ResourceData, meta interface{}) err req.Filters = buildEC2AttributeFilterList( map[string]string{ - "outpost_arn": d.Get("outpost_arn").(string), - "owner_id": d.Get("owner_id").(string), "state": d.Get("state").(string), }, ) diff --git a/website/docs/d/local_gateway.html.markdown b/website/docs/d/local_gateway.html.markdown new file mode 100644 index 00000000000..75308f6757e --- /dev/null +++ b/website/docs/d/local_gateway.html.markdown @@ -0,0 +1,61 @@ +--- +subcategory: "VPC" +layout: "aws" +page_title: "AWS: aws_local_gateway" +description: |- + Provides details about a specific Local Gateway +--- + +# Data Source: aws_vpc + +`aws_local_gateway` provides details about a specific Local Gateway. + +## Example Usage + +The following example shows how one might accept a Local Gateway Id as a variable. + +```hcl +variable "local_gateway_id" {} + +data "aws_local_gateway" "selected" { + id = "${var.local_gateway_id}" +} +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available +VPCs in the current region. The given filters must match exactly one +VPC whose data will be exported as attributes. + +* `filter` - (Optional) Custom filter block as described below. + +* `id` - (Optional) The id of the specific VPC to retrieve. + +* `state` - (Optional) The current state of the desired VPC. + Can be either `"pending"` or `"available"`. + +* `tags` - (Optional) A mapping of tags, each pair of which must exactly match + a pair on the desired VPC. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) The name of the field to filter by, as defined by + [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLocalGateways.html). + +* `values` - (Required) Set of values that are accepted for the given field. + A VPC will be selected if any one of the given values matches. + +## Attributes Reference + +All of the argument attributes except `filter` blocks are also exported as +result attributes. This data source will complete the data by populating +any fields that are not included in the configuration with the data for +the selected VPC. + +The following attribute is additionally exported: + +* `outpost_arn` - Amazon Resource Name (ARN) of VPC +* `owner_id` - The ID of the AWS account that owns the VPC. +* `state` - The State of the local gateway. diff --git a/website/docs/d/local_gateways.html.markdown b/website/docs/d/local_gateways.html.markdown new file mode 100644 index 00000000000..a7a4e2487ed --- /dev/null +++ b/website/docs/d/local_gateways.html.markdown @@ -0,0 +1,47 @@ +--- +subcategory: "VPC" +layout: "aws" +page_title: "AWS: aws_local_gateways" +description: |- + Provides a list local gateways in a region +--- + +# Data Source: aws_local_gateways + +This resource can be useful for getting back a list of Local Gateway Ids for a region. + +## Example Usage + +The following example retrieves a list of Local Gateway Ids with a custom tag of `service` set to a value of "production". + +```hcl +data "aws_local_gateways" "foo" { + tags = { + service = "production" + } +} + +output "foo" { + value = "${data.aws_local_gateways.foo.ids}" +} +``` + +## Argument Reference + +* `tags` - (Optional) A mapping of tags, each pair of which must exactly match + a pair on the desired vpcs. + +* `filter` - (Optional) Custom filter block as described below. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) The name of the field to filter by, as defined by + [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLocalGateways.html). + +* `values` - (Required) Set of values that are accepted for the given field. + A VPC will be selected if any one of the given values matches. + +## Attributes Reference + +* `ids` - A list of all the VPC Ids found. This data source will fail if none are found. From 5dcffc1c757930a1d1fbd7ba607eaeff6f2d1b69 Mon Sep 17 00:00:00 2001 From: John Barney Date: Sat, 11 Apr 2020 12:53:49 +0800 Subject: [PATCH 3/5] Add new docs to index. Run gofmt --- aws/data_source_aws_local_gateway.go | 2 +- website/aws.erb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/aws/data_source_aws_local_gateway.go b/aws/data_source_aws_local_gateway.go index f1535806e65..7ee4bdcd464 100644 --- a/aws/data_source_aws_local_gateway.go +++ b/aws/data_source_aws_local_gateway.go @@ -61,7 +61,7 @@ func dataSourceAwsLocalGatewayRead(d *schema.ResourceData, meta interface{}) err req.Filters = buildEC2AttributeFilterList( map[string]string{ - "state": d.Get("state").(string), + "state": d.Get("state").(string), }, ) diff --git a/website/aws.erb b/website/aws.erb index 8e1aeebabcb..b30a169d52d 100644 --- a/website/aws.erb +++ b/website/aws.erb @@ -3153,6 +3153,12 @@
  • aws_internet_gateway
  • +
  • + aws_local_gateway +
  • +
  • + aws_local_gateways +
  • aws_nat_gateway
  • From 536ae75d3213387e18bb34309bda75b63bc4f4e5 Mon Sep 17 00:00:00 2001 From: John Barney Date: Thu, 16 Apr 2020 21:22:24 +0800 Subject: [PATCH 4/5] Break dependency on VPC tests --- aws/data_source_aws_local_gateways_test.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/aws/data_source_aws_local_gateways_test.go b/aws/data_source_aws_local_gateways_test.go index 723a3acfe61..d92d7f07c22 100644 --- a/aws/data_source_aws_local_gateways_test.go +++ b/aws/data_source_aws_local_gateways_test.go @@ -1,7 +1,9 @@ package aws import ( + "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" "testing" ) @@ -13,11 +15,25 @@ func TestAccDataSourceAwsLocalGateways_basic(t *testing.T) { { Config: testAccDataSourceAwsLocalGatewaysConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAwsVpcsDataSourceExists("data.aws_local_gateways.all"), + testAccCheckAwsLocalGatewaysDataSourceExists("data.aws_local_gateways.all"), ), }, }, }) } +func testAccCheckAwsLocalGatewaysDataSourceExists(n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Can't find aws_local_gateways data source: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("aws_local_gateways data source ID not set") + } + return nil + } +} + const testAccDataSourceAwsLocalGatewaysConfig = `data "aws_local_gateways" "all" {}` From 1b9b7d97d7cc066d531220d95122fdfa00a4fec3 Mon Sep 17 00:00:00 2001 From: John Barney Date: Fri, 24 Apr 2020 17:23:48 +0800 Subject: [PATCH 5/5] Fix some overlooked text --- aws/data_source_aws_local_gateway.go | 4 ++-- aws/data_source_aws_local_gateway_test.go | 9 +++------ aws/data_source_aws_local_gateways.go | 2 +- website/docs/d/local_gateway.html.markdown | 22 ++++++++++----------- website/docs/d/local_gateways.html.markdown | 6 +++--- 5 files changed, 20 insertions(+), 23 deletions(-) diff --git a/aws/data_source_aws_local_gateway.go b/aws/data_source_aws_local_gateway.go index 7ee4bdcd464..50d74ac1b12 100644 --- a/aws/data_source_aws_local_gateway.go +++ b/aws/data_source_aws_local_gateway.go @@ -85,10 +85,10 @@ func dataSourceAwsLocalGatewayRead(d *schema.ResourceData, meta interface{}) err return err } if resp == nil || len(resp.LocalGateways) == 0 { - return fmt.Errorf("no matching VPC found") + return fmt.Errorf("no matching Local Gateway found") } if len(resp.LocalGateways) > 1 { - return fmt.Errorf("multiple Local Gateways matched; use additional constraints to reduce matches to a single VPC") + return fmt.Errorf("multiple Local Gateways matched; use additional constraints to reduce matches to a single Local Gateway") } localGateway := resp.LocalGateways[0] diff --git a/aws/data_source_aws_local_gateway_test.go b/aws/data_source_aws_local_gateway_test.go index f42d31a8872..2da377d38e2 100644 --- a/aws/data_source_aws_local_gateway_test.go +++ b/aws/data_source_aws_local_gateway_test.go @@ -26,13 +26,10 @@ func TestAccDataSourceAwsLocalGateway_basic(t *testing.T) { { Config: testAccDataSourceAwsLocalGatewayConfig(localGatewayId), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr( - dsResourceName, "id", localGatewayId), + resource.TestCheckResourceAttr(dsResourceName, "id", localGatewayId), testAccCheckResourceAttrAccountID(dsResourceName, "owner_id"), - resource.TestCheckResourceAttrSet( - dsResourceName, "state"), - resource.TestCheckResourceAttrSet( - dsResourceName, "outpost_arn"), + resource.TestCheckResourceAttrSet(dsResourceName, "state"), + resource.TestCheckResourceAttrSet(dsResourceName, "outpost_arn"), ), }, }, diff --git a/aws/data_source_aws_local_gateways.go b/aws/data_source_aws_local_gateways.go index fdca1de6ef0..67d356efb2b 100644 --- a/aws/data_source_aws_local_gateways.go +++ b/aws/data_source_aws_local_gateways.go @@ -57,7 +57,7 @@ func dataSourceAwsLocalGatewaysRead(d *schema.ResourceData, meta interface{}) er } if resp == nil || len(resp.LocalGateways) == 0 { - return fmt.Errorf("no matching VPC found") + return fmt.Errorf("no matching Local Gateways found") } localgateways := make([]string, 0) diff --git a/website/docs/d/local_gateway.html.markdown b/website/docs/d/local_gateway.html.markdown index 75308f6757e..c8faf5fbd8f 100644 --- a/website/docs/d/local_gateway.html.markdown +++ b/website/docs/d/local_gateway.html.markdown @@ -6,13 +6,13 @@ description: |- Provides details about a specific Local Gateway --- -# Data Source: aws_vpc +# Data Source: aws_local_gateway `aws_local_gateway` provides details about a specific Local Gateway. ## Example Usage -The following example shows how one might accept a Local Gateway Id as a variable. +The following example shows how one might accept a local gateway id as a variable. ```hcl variable "local_gateway_id" {} @@ -25,18 +25,18 @@ data "aws_local_gateway" "selected" { ## Argument Reference The arguments of this data source act as filters for querying the available -VPCs in the current region. The given filters must match exactly one -VPC whose data will be exported as attributes. +Local Gateways in the current region. The given filters must match exactly one +Local Gateway whose data will be exported as attributes. * `filter` - (Optional) Custom filter block as described below. -* `id` - (Optional) The id of the specific VPC to retrieve. +* `id` - (Optional) The id of the specific Local Gateway to retrieve. -* `state` - (Optional) The current state of the desired VPC. +* `state` - (Optional) The current state of the desired Local Gateway. Can be either `"pending"` or `"available"`. * `tags` - (Optional) A mapping of tags, each pair of which must exactly match - a pair on the desired VPC. + a pair on the desired Local Gateway. More complex filters can be expressed using one or more `filter` sub-blocks, which take the following arguments: @@ -45,17 +45,17 @@ which take the following arguments: [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLocalGateways.html). * `values` - (Required) Set of values that are accepted for the given field. - A VPC will be selected if any one of the given values matches. + A Local Gateway will be selected if any one of the given values matches. ## Attributes Reference All of the argument attributes except `filter` blocks are also exported as result attributes. This data source will complete the data by populating any fields that are not included in the configuration with the data for -the selected VPC. +the selected Local Gateway. The following attribute is additionally exported: -* `outpost_arn` - Amazon Resource Name (ARN) of VPC -* `owner_id` - The ID of the AWS account that owns the VPC. +* `outpost_arn` - Amazon Resource Name (ARN) of Local Gateway +* `owner_id` - The ID of the AWS account that owns the Local Gateway. * `state` - The State of the local gateway. diff --git a/website/docs/d/local_gateways.html.markdown b/website/docs/d/local_gateways.html.markdown index a7a4e2487ed..1a1477692d0 100644 --- a/website/docs/d/local_gateways.html.markdown +++ b/website/docs/d/local_gateways.html.markdown @@ -29,7 +29,7 @@ output "foo" { ## Argument Reference * `tags` - (Optional) A mapping of tags, each pair of which must exactly match - a pair on the desired vpcs. + a pair on the desired local_gateways. * `filter` - (Optional) Custom filter block as described below. @@ -40,8 +40,8 @@ which take the following arguments: [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLocalGateways.html). * `values` - (Required) Set of values that are accepted for the given field. - A VPC will be selected if any one of the given values matches. + A Local Gateway will be selected if any one of the given values matches. ## Attributes Reference -* `ids` - A list of all the VPC Ids found. This data source will fail if none are found. +* `ids` - A list of all the Local Gateway Ids found. This data source will fail if none are found.