github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2transitgateway/getVpcAttachments.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 EC2 Transit Gateway VPC Attachments. 15 // 16 // ## Example Usage 17 func GetVpcAttachments(ctx *pulumi.Context, args *GetVpcAttachmentsArgs, opts ...pulumi.InvokeOption) (*GetVpcAttachmentsResult, error) { 18 opts = internal.PkgInvokeDefaultOpts(opts) 19 var rv GetVpcAttachmentsResult 20 err := ctx.Invoke("aws:ec2transitgateway/getVpcAttachments:getVpcAttachments", args, &rv, opts...) 21 if err != nil { 22 return nil, err 23 } 24 return &rv, nil 25 } 26 27 // A collection of arguments for invoking getVpcAttachments. 28 type GetVpcAttachmentsArgs struct { 29 // One or more configuration blocks containing name-values filters. Detailed below. 30 Filters []GetVpcAttachmentsFilter `pulumi:"filters"` 31 } 32 33 // A collection of values returned by getVpcAttachments. 34 type GetVpcAttachmentsResult struct { 35 Filters []GetVpcAttachmentsFilter `pulumi:"filters"` 36 // The provider-assigned unique ID for this managed resource. 37 Id string `pulumi:"id"` 38 // A list of all attachments ids matching the filter. You can retrieve more information about the attachment using the [ec2transitgateway.VpcAttachment][2] data source, searching by identifier. 39 Ids []string `pulumi:"ids"` 40 } 41 42 func GetVpcAttachmentsOutput(ctx *pulumi.Context, args GetVpcAttachmentsOutputArgs, opts ...pulumi.InvokeOption) GetVpcAttachmentsResultOutput { 43 return pulumi.ToOutputWithContext(context.Background(), args). 44 ApplyT(func(v interface{}) (GetVpcAttachmentsResult, error) { 45 args := v.(GetVpcAttachmentsArgs) 46 r, err := GetVpcAttachments(ctx, &args, opts...) 47 var s GetVpcAttachmentsResult 48 if r != nil { 49 s = *r 50 } 51 return s, err 52 }).(GetVpcAttachmentsResultOutput) 53 } 54 55 // A collection of arguments for invoking getVpcAttachments. 56 type GetVpcAttachmentsOutputArgs struct { 57 // One or more configuration blocks containing name-values filters. Detailed below. 58 Filters GetVpcAttachmentsFilterArrayInput `pulumi:"filters"` 59 } 60 61 func (GetVpcAttachmentsOutputArgs) ElementType() reflect.Type { 62 return reflect.TypeOf((*GetVpcAttachmentsArgs)(nil)).Elem() 63 } 64 65 // A collection of values returned by getVpcAttachments. 66 type GetVpcAttachmentsResultOutput struct{ *pulumi.OutputState } 67 68 func (GetVpcAttachmentsResultOutput) ElementType() reflect.Type { 69 return reflect.TypeOf((*GetVpcAttachmentsResult)(nil)).Elem() 70 } 71 72 func (o GetVpcAttachmentsResultOutput) ToGetVpcAttachmentsResultOutput() GetVpcAttachmentsResultOutput { 73 return o 74 } 75 76 func (o GetVpcAttachmentsResultOutput) ToGetVpcAttachmentsResultOutputWithContext(ctx context.Context) GetVpcAttachmentsResultOutput { 77 return o 78 } 79 80 func (o GetVpcAttachmentsResultOutput) Filters() GetVpcAttachmentsFilterArrayOutput { 81 return o.ApplyT(func(v GetVpcAttachmentsResult) []GetVpcAttachmentsFilter { return v.Filters }).(GetVpcAttachmentsFilterArrayOutput) 82 } 83 84 // The provider-assigned unique ID for this managed resource. 85 func (o GetVpcAttachmentsResultOutput) Id() pulumi.StringOutput { 86 return o.ApplyT(func(v GetVpcAttachmentsResult) string { return v.Id }).(pulumi.StringOutput) 87 } 88 89 // A list of all attachments ids matching the filter. You can retrieve more information about the attachment using the [ec2transitgateway.VpcAttachment][2] data source, searching by identifier. 90 func (o GetVpcAttachmentsResultOutput) Ids() pulumi.StringArrayOutput { 91 return o.ApplyT(func(v GetVpcAttachmentsResult) []string { return v.Ids }).(pulumi.StringArrayOutput) 92 } 93 94 func init() { 95 pulumi.RegisterOutputType(GetVpcAttachmentsResultOutput{}) 96 }