github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/networkmanager/getConnections.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 networkmanager 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 // Retrieve information about connections. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkmanager" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := networkmanager.GetConnections(ctx, &networkmanager.GetConnectionsArgs{ 32 // GlobalNetworkId: globalNetworkId, 33 // Tags: map[string]interface{}{ 34 // "Env": "test", 35 // }, 36 // }, nil) 37 // if err != nil { 38 // return err 39 // } 40 // return nil 41 // }) 42 // } 43 // 44 // ``` 45 // <!--End PulumiCodeChooser --> 46 func GetConnections(ctx *pulumi.Context, args *GetConnectionsArgs, opts ...pulumi.InvokeOption) (*GetConnectionsResult, error) { 47 opts = internal.PkgInvokeDefaultOpts(opts) 48 var rv GetConnectionsResult 49 err := ctx.Invoke("aws:networkmanager/getConnections:getConnections", args, &rv, opts...) 50 if err != nil { 51 return nil, err 52 } 53 return &rv, nil 54 } 55 56 // A collection of arguments for invoking getConnections. 57 type GetConnectionsArgs struct { 58 // ID of the device of the connections to retrieve. 59 DeviceId *string `pulumi:"deviceId"` 60 // ID of the Global Network of the connections to retrieve. 61 GlobalNetworkId string `pulumi:"globalNetworkId"` 62 // Restricts the list to the connections with these tags. 63 Tags map[string]string `pulumi:"tags"` 64 } 65 66 // A collection of values returned by getConnections. 67 type GetConnectionsResult struct { 68 DeviceId *string `pulumi:"deviceId"` 69 GlobalNetworkId string `pulumi:"globalNetworkId"` 70 // The provider-assigned unique ID for this managed resource. 71 Id string `pulumi:"id"` 72 // IDs of the connections. 73 Ids []string `pulumi:"ids"` 74 Tags map[string]string `pulumi:"tags"` 75 } 76 77 func GetConnectionsOutput(ctx *pulumi.Context, args GetConnectionsOutputArgs, opts ...pulumi.InvokeOption) GetConnectionsResultOutput { 78 return pulumi.ToOutputWithContext(context.Background(), args). 79 ApplyT(func(v interface{}) (GetConnectionsResult, error) { 80 args := v.(GetConnectionsArgs) 81 r, err := GetConnections(ctx, &args, opts...) 82 var s GetConnectionsResult 83 if r != nil { 84 s = *r 85 } 86 return s, err 87 }).(GetConnectionsResultOutput) 88 } 89 90 // A collection of arguments for invoking getConnections. 91 type GetConnectionsOutputArgs struct { 92 // ID of the device of the connections to retrieve. 93 DeviceId pulumi.StringPtrInput `pulumi:"deviceId"` 94 // ID of the Global Network of the connections to retrieve. 95 GlobalNetworkId pulumi.StringInput `pulumi:"globalNetworkId"` 96 // Restricts the list to the connections with these tags. 97 Tags pulumi.StringMapInput `pulumi:"tags"` 98 } 99 100 func (GetConnectionsOutputArgs) ElementType() reflect.Type { 101 return reflect.TypeOf((*GetConnectionsArgs)(nil)).Elem() 102 } 103 104 // A collection of values returned by getConnections. 105 type GetConnectionsResultOutput struct{ *pulumi.OutputState } 106 107 func (GetConnectionsResultOutput) ElementType() reflect.Type { 108 return reflect.TypeOf((*GetConnectionsResult)(nil)).Elem() 109 } 110 111 func (o GetConnectionsResultOutput) ToGetConnectionsResultOutput() GetConnectionsResultOutput { 112 return o 113 } 114 115 func (o GetConnectionsResultOutput) ToGetConnectionsResultOutputWithContext(ctx context.Context) GetConnectionsResultOutput { 116 return o 117 } 118 119 func (o GetConnectionsResultOutput) DeviceId() pulumi.StringPtrOutput { 120 return o.ApplyT(func(v GetConnectionsResult) *string { return v.DeviceId }).(pulumi.StringPtrOutput) 121 } 122 123 func (o GetConnectionsResultOutput) GlobalNetworkId() pulumi.StringOutput { 124 return o.ApplyT(func(v GetConnectionsResult) string { return v.GlobalNetworkId }).(pulumi.StringOutput) 125 } 126 127 // The provider-assigned unique ID for this managed resource. 128 func (o GetConnectionsResultOutput) Id() pulumi.StringOutput { 129 return o.ApplyT(func(v GetConnectionsResult) string { return v.Id }).(pulumi.StringOutput) 130 } 131 132 // IDs of the connections. 133 func (o GetConnectionsResultOutput) Ids() pulumi.StringArrayOutput { 134 return o.ApplyT(func(v GetConnectionsResult) []string { return v.Ids }).(pulumi.StringArrayOutput) 135 } 136 137 func (o GetConnectionsResultOutput) Tags() pulumi.StringMapOutput { 138 return o.ApplyT(func(v GetConnectionsResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 139 } 140 141 func init() { 142 pulumi.RegisterOutputType(GetConnectionsResultOutput{}) 143 }