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