github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2transitgateway/getVpcAttachment.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package ec2transitgateway
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Get information on an EC2 Transit Gateway VPC Attachment.
    15  //
    16  // ## Example Usage
    17  //
    18  // ### By Filter
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := ec2transitgateway.LookupVpcAttachment(ctx, &ec2transitgateway.LookupVpcAttachmentArgs{
    34  //				Filters: []ec2transitgateway.GetVpcAttachmentFilter{
    35  //					{
    36  //						Name: "vpc-id",
    37  //						Values: []string{
    38  //							"vpc-12345678",
    39  //						},
    40  //					},
    41  //				},
    42  //			}, nil)
    43  //			if err != nil {
    44  //				return err
    45  //			}
    46  //			return nil
    47  //		})
    48  //	}
    49  //
    50  // ```
    51  // <!--End PulumiCodeChooser -->
    52  //
    53  // ### By Identifier
    54  //
    55  // <!--Start PulumiCodeChooser -->
    56  // ```go
    57  // package main
    58  //
    59  // import (
    60  //
    61  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
    62  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    63  //
    64  // )
    65  //
    66  //	func main() {
    67  //		pulumi.Run(func(ctx *pulumi.Context) error {
    68  //			_, err := ec2transitgateway.LookupVpcAttachment(ctx, &ec2transitgateway.LookupVpcAttachmentArgs{
    69  //				Id: pulumi.StringRef("tgw-attach-12345678"),
    70  //			}, nil)
    71  //			if err != nil {
    72  //				return err
    73  //			}
    74  //			return nil
    75  //		})
    76  //	}
    77  //
    78  // ```
    79  // <!--End PulumiCodeChooser -->
    80  func LookupVpcAttachment(ctx *pulumi.Context, args *LookupVpcAttachmentArgs, opts ...pulumi.InvokeOption) (*LookupVpcAttachmentResult, error) {
    81  	opts = internal.PkgInvokeDefaultOpts(opts)
    82  	var rv LookupVpcAttachmentResult
    83  	err := ctx.Invoke("aws:ec2transitgateway/getVpcAttachment:getVpcAttachment", args, &rv, opts...)
    84  	if err != nil {
    85  		return nil, err
    86  	}
    87  	return &rv, nil
    88  }
    89  
    90  // A collection of arguments for invoking getVpcAttachment.
    91  type LookupVpcAttachmentArgs struct {
    92  	// One or more configuration blocks containing name-values filters. Detailed below.
    93  	Filters []GetVpcAttachmentFilter `pulumi:"filters"`
    94  	// Identifier of the EC2 Transit Gateway VPC Attachment.
    95  	Id *string `pulumi:"id"`
    96  	// Key-value tags for the EC2 Transit Gateway VPC Attachment
    97  	Tags map[string]string `pulumi:"tags"`
    98  }
    99  
   100  // A collection of values returned by getVpcAttachment.
   101  type LookupVpcAttachmentResult struct {
   102  	// Whether Appliance Mode support is enabled.
   103  	ApplianceModeSupport string `pulumi:"applianceModeSupport"`
   104  	// Whether DNS support is enabled.
   105  	DnsSupport string                   `pulumi:"dnsSupport"`
   106  	Filters    []GetVpcAttachmentFilter `pulumi:"filters"`
   107  	// EC2 Transit Gateway VPC Attachment identifier
   108  	Id string `pulumi:"id"`
   109  	// Whether IPv6 support is enabled.
   110  	Ipv6Support string `pulumi:"ipv6Support"`
   111  	// Identifiers of EC2 Subnets.
   112  	SubnetIds []string `pulumi:"subnetIds"`
   113  	// Key-value tags for the EC2 Transit Gateway VPC Attachment
   114  	Tags map[string]string `pulumi:"tags"`
   115  	// EC2 Transit Gateway identifier
   116  	TransitGatewayId string `pulumi:"transitGatewayId"`
   117  	// Identifier of EC2 VPC.
   118  	VpcId string `pulumi:"vpcId"`
   119  	// Identifier of the AWS account that owns the EC2 VPC.
   120  	VpcOwnerId string `pulumi:"vpcOwnerId"`
   121  }
   122  
   123  func LookupVpcAttachmentOutput(ctx *pulumi.Context, args LookupVpcAttachmentOutputArgs, opts ...pulumi.InvokeOption) LookupVpcAttachmentResultOutput {
   124  	return pulumi.ToOutputWithContext(context.Background(), args).
   125  		ApplyT(func(v interface{}) (LookupVpcAttachmentResult, error) {
   126  			args := v.(LookupVpcAttachmentArgs)
   127  			r, err := LookupVpcAttachment(ctx, &args, opts...)
   128  			var s LookupVpcAttachmentResult
   129  			if r != nil {
   130  				s = *r
   131  			}
   132  			return s, err
   133  		}).(LookupVpcAttachmentResultOutput)
   134  }
   135  
   136  // A collection of arguments for invoking getVpcAttachment.
   137  type LookupVpcAttachmentOutputArgs struct {
   138  	// One or more configuration blocks containing name-values filters. Detailed below.
   139  	Filters GetVpcAttachmentFilterArrayInput `pulumi:"filters"`
   140  	// Identifier of the EC2 Transit Gateway VPC Attachment.
   141  	Id pulumi.StringPtrInput `pulumi:"id"`
   142  	// Key-value tags for the EC2 Transit Gateway VPC Attachment
   143  	Tags pulumi.StringMapInput `pulumi:"tags"`
   144  }
   145  
   146  func (LookupVpcAttachmentOutputArgs) ElementType() reflect.Type {
   147  	return reflect.TypeOf((*LookupVpcAttachmentArgs)(nil)).Elem()
   148  }
   149  
   150  // A collection of values returned by getVpcAttachment.
   151  type LookupVpcAttachmentResultOutput struct{ *pulumi.OutputState }
   152  
   153  func (LookupVpcAttachmentResultOutput) ElementType() reflect.Type {
   154  	return reflect.TypeOf((*LookupVpcAttachmentResult)(nil)).Elem()
   155  }
   156  
   157  func (o LookupVpcAttachmentResultOutput) ToLookupVpcAttachmentResultOutput() LookupVpcAttachmentResultOutput {
   158  	return o
   159  }
   160  
   161  func (o LookupVpcAttachmentResultOutput) ToLookupVpcAttachmentResultOutputWithContext(ctx context.Context) LookupVpcAttachmentResultOutput {
   162  	return o
   163  }
   164  
   165  // Whether Appliance Mode support is enabled.
   166  func (o LookupVpcAttachmentResultOutput) ApplianceModeSupport() pulumi.StringOutput {
   167  	return o.ApplyT(func(v LookupVpcAttachmentResult) string { return v.ApplianceModeSupport }).(pulumi.StringOutput)
   168  }
   169  
   170  // Whether DNS support is enabled.
   171  func (o LookupVpcAttachmentResultOutput) DnsSupport() pulumi.StringOutput {
   172  	return o.ApplyT(func(v LookupVpcAttachmentResult) string { return v.DnsSupport }).(pulumi.StringOutput)
   173  }
   174  
   175  func (o LookupVpcAttachmentResultOutput) Filters() GetVpcAttachmentFilterArrayOutput {
   176  	return o.ApplyT(func(v LookupVpcAttachmentResult) []GetVpcAttachmentFilter { return v.Filters }).(GetVpcAttachmentFilterArrayOutput)
   177  }
   178  
   179  // EC2 Transit Gateway VPC Attachment identifier
   180  func (o LookupVpcAttachmentResultOutput) Id() pulumi.StringOutput {
   181  	return o.ApplyT(func(v LookupVpcAttachmentResult) string { return v.Id }).(pulumi.StringOutput)
   182  }
   183  
   184  // Whether IPv6 support is enabled.
   185  func (o LookupVpcAttachmentResultOutput) Ipv6Support() pulumi.StringOutput {
   186  	return o.ApplyT(func(v LookupVpcAttachmentResult) string { return v.Ipv6Support }).(pulumi.StringOutput)
   187  }
   188  
   189  // Identifiers of EC2 Subnets.
   190  func (o LookupVpcAttachmentResultOutput) SubnetIds() pulumi.StringArrayOutput {
   191  	return o.ApplyT(func(v LookupVpcAttachmentResult) []string { return v.SubnetIds }).(pulumi.StringArrayOutput)
   192  }
   193  
   194  // Key-value tags for the EC2 Transit Gateway VPC Attachment
   195  func (o LookupVpcAttachmentResultOutput) Tags() pulumi.StringMapOutput {
   196  	return o.ApplyT(func(v LookupVpcAttachmentResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   197  }
   198  
   199  // EC2 Transit Gateway identifier
   200  func (o LookupVpcAttachmentResultOutput) TransitGatewayId() pulumi.StringOutput {
   201  	return o.ApplyT(func(v LookupVpcAttachmentResult) string { return v.TransitGatewayId }).(pulumi.StringOutput)
   202  }
   203  
   204  // Identifier of EC2 VPC.
   205  func (o LookupVpcAttachmentResultOutput) VpcId() pulumi.StringOutput {
   206  	return o.ApplyT(func(v LookupVpcAttachmentResult) string { return v.VpcId }).(pulumi.StringOutput)
   207  }
   208  
   209  // Identifier of the AWS account that owns the EC2 VPC.
   210  func (o LookupVpcAttachmentResultOutput) VpcOwnerId() pulumi.StringOutput {
   211  	return o.ApplyT(func(v LookupVpcAttachmentResult) string { return v.VpcOwnerId }).(pulumi.StringOutput)
   212  }
   213  
   214  func init() {
   215  	pulumi.RegisterOutputType(LookupVpcAttachmentResultOutput{})
   216  }