Try AWS Native preview for resources not in the classic version.
aws.ec2.getInternetGateway
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
aws.ec2.InternetGateway
provides details about a specific Internet Gateway.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const config = new pulumi.Config();
const vpcId = config.requireObject("vpcId");
const default = aws.ec2.getInternetGateway({
filters: [{
name: "attachment.vpc-id",
values: [vpcId],
}],
});
import pulumi
import pulumi_aws as aws
config = pulumi.Config()
vpc_id = config.require_object("vpcId")
default = aws.ec2.get_internet_gateway(filters=[{
"name": "attachment.vpc-id",
"values": [vpc_id],
}])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
vpcId := cfg.RequireObject("vpcId")
_, err := ec2.LookupInternetGateway(ctx, &ec2.LookupInternetGatewayArgs{
Filters: []ec2.GetInternetGatewayFilter{
{
Name: "attachment.vpc-id",
Values: interface{}{
vpcId,
},
},
},
}, nil);
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var vpcId = config.RequireObject<dynamic>("vpcId");
var @default = Aws.Ec2.GetInternetGateway.Invoke(new()
{
Filters = new[]
{
new Aws.Ec2.Inputs.GetInternetGatewayFilterInputArgs
{
Name = "attachment.vpc-id",
Values = new[]
{
vpcId,
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetInternetGatewayArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var vpcId = config.get("vpcId");
final var default = Ec2Functions.getInternetGateway(GetInternetGatewayArgs.builder()
.filters(GetInternetGatewayFilterArgs.builder()
.name("attachment.vpc-id")
.values(vpcId)
.build())
.build());
}
}
configuration:
vpcId:
type: dynamic
variables:
default:
fn::invoke:
Function: aws:ec2:getInternetGateway
Arguments:
filters:
- name: attachment.vpc-id
values:
- ${vpcId}
Using getInternetGateway
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getInternetGateway(args: GetInternetGatewayArgs, opts?: InvokeOptions): Promise<GetInternetGatewayResult>
function getInternetGatewayOutput(args: GetInternetGatewayOutputArgs, opts?: InvokeOptions): Output<GetInternetGatewayResult>
def get_internet_gateway(filters: Optional[Sequence[GetInternetGatewayFilter]] = None,
internet_gateway_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetInternetGatewayResult
def get_internet_gateway_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetInternetGatewayFilterArgs]]]] = None,
internet_gateway_id: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetInternetGatewayResult]
func LookupInternetGateway(ctx *Context, args *LookupInternetGatewayArgs, opts ...InvokeOption) (*LookupInternetGatewayResult, error)
func LookupInternetGatewayOutput(ctx *Context, args *LookupInternetGatewayOutputArgs, opts ...InvokeOption) LookupInternetGatewayResultOutput
> Note: This function is named LookupInternetGateway
in the Go SDK.
public static class GetInternetGateway
{
public static Task<GetInternetGatewayResult> InvokeAsync(GetInternetGatewayArgs args, InvokeOptions? opts = null)
public static Output<GetInternetGatewayResult> Invoke(GetInternetGatewayInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInternetGatewayResult> getInternetGateway(GetInternetGatewayArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:ec2/getInternetGateway:getInternetGateway
arguments:
# arguments dictionary
The following arguments are supported:
- Filters
List<Get
Internet Gateway Filter> Custom filter block as described below.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:- Internet
Gateway stringId - ID of the specific Internet Gateway to retrieve.
- Dictionary<string, string>
- Map of tags, each pair of which must exactly match a pair on the desired Internet Gateway.
- Filters
[]Get
Internet Gateway Filter Custom filter block as described below.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:- Internet
Gateway stringId - ID of the specific Internet Gateway to retrieve.
- map[string]string
- Map of tags, each pair of which must exactly match a pair on the desired Internet Gateway.
- filters
List<Get
Internet Gateway Filter> Custom filter block as described below.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:- internet
Gateway StringId - ID of the specific Internet Gateway to retrieve.
- Map<String,String>
- Map of tags, each pair of which must exactly match a pair on the desired Internet Gateway.
- filters
Get
Internet Gateway Filter[] Custom filter block as described below.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:- internet
Gateway stringId - ID of the specific Internet Gateway to retrieve.
- {[key: string]: string}
- Map of tags, each pair of which must exactly match a pair on the desired Internet Gateway.
- filters
Sequence[Get
Internet Gateway Filter] Custom filter block as described below.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:- internet_
gateway_ strid - ID of the specific Internet Gateway to retrieve.
- Mapping[str, str]
- Map of tags, each pair of which must exactly match a pair on the desired Internet Gateway.
- filters List<Property Map>
Custom filter block as described below.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:- internet
Gateway StringId - ID of the specific Internet Gateway to retrieve.
- Map<String>
- Map of tags, each pair of which must exactly match a pair on the desired Internet Gateway.
getInternetGateway Result
The following output properties are available:
- Arn string
- ARN of the Internet Gateway.
- Attachments
List<Get
Internet Gateway Attachment> - Id string
- The provider-assigned unique ID for this managed resource.
- Internet
Gateway stringId - Owner
Id string - ID of the AWS account that owns the internet gateway.
- Dictionary<string, string>
- Filters
List<Get
Internet Gateway Filter>
- Arn string
- ARN of the Internet Gateway.
- Attachments
[]Get
Internet Gateway Attachment Type - Id string
- The provider-assigned unique ID for this managed resource.
- Internet
Gateway stringId - Owner
Id string - ID of the AWS account that owns the internet gateway.
- map[string]string
- Filters
[]Get
Internet Gateway Filter
- arn String
- ARN of the Internet Gateway.
- attachments
List<Get
Internet Gateway Attachment> - id String
- The provider-assigned unique ID for this managed resource.
- internet
Gateway StringId - owner
Id String - ID of the AWS account that owns the internet gateway.
- Map<String,String>
- filters
List<Get
Internet Gateway Filter>
- arn string
- ARN of the Internet Gateway.
- attachments
Get
Internet Gateway Attachment[] - id string
- The provider-assigned unique ID for this managed resource.
- internet
Gateway stringId - owner
Id string - ID of the AWS account that owns the internet gateway.
- {[key: string]: string}
- filters
Get
Internet Gateway Filter[]
- arn str
- ARN of the Internet Gateway.
- attachments
Sequence[Get
Internet Gateway Attachment] - id str
- The provider-assigned unique ID for this managed resource.
- internet_
gateway_ strid - owner_
id str - ID of the AWS account that owns the internet gateway.
- Mapping[str, str]
- filters
Sequence[Get
Internet Gateway Filter]
- arn String
- ARN of the Internet Gateway.
- attachments List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- internet
Gateway StringId - owner
Id String - ID of the AWS account that owns the internet gateway.
- Map<String>
- filters List<Property Map>
Supporting Types
GetInternetGatewayAttachment
GetInternetGatewayFilter
- Name string
- Name of the field to filter by, as defined by the underlying AWS API.
- Values List<string>
- Set of values that are accepted for the given field. An Internet Gateway will be selected if any one of the given values matches.
- Name string
- Name of the field to filter by, as defined by the underlying AWS API.
- Values []string
- Set of values that are accepted for the given field. An Internet Gateway will be selected if any one of the given values matches.
- name String
- Name of the field to filter by, as defined by the underlying AWS API.
- values List<String>
- Set of values that are accepted for the given field. An Internet Gateway will be selected if any one of the given values matches.
- name string
- Name of the field to filter by, as defined by the underlying AWS API.
- values string[]
- Set of values that are accepted for the given field. An Internet Gateway will be selected if any one of the given values matches.
- name str
- Name of the field to filter by, as defined by the underlying AWS API.
- values Sequence[str]
- Set of values that are accepted for the given field. An Internet Gateway will be selected if any one of the given values matches.
- name String
- Name of the field to filter by, as defined by the underlying AWS API.
- values List<String>
- Set of values that are accepted for the given field. An Internet Gateway will be selected if any one of the given values matches.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.