/
getSubnets.go
111 lines (93 loc) · 3.67 KB
/
getSubnets.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package ec2
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This resource can be useful for getting back a set of subnet IDs.
func GetSubnets(ctx *pulumi.Context, args *GetSubnetsArgs, opts ...pulumi.InvokeOption) (*GetSubnetsResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetSubnetsResult
err := ctx.Invoke("aws:ec2/getSubnets:getSubnets", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSubnets.
type GetSubnetsArgs struct {
// Custom filter block as described below.
Filters []GetSubnetsFilter `pulumi:"filters"`
// Map of tags, each pair of which must exactly match
// a pair on the desired subnets.
//
// More complex filters can be expressed using one or more `filter` sub-blocks,
// which take the following arguments:
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getSubnets.
type GetSubnetsResult struct {
Filters []GetSubnetsFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// List of all the subnet ids found.
Ids []string `pulumi:"ids"`
Tags map[string]string `pulumi:"tags"`
}
func GetSubnetsOutput(ctx *pulumi.Context, args GetSubnetsOutputArgs, opts ...pulumi.InvokeOption) GetSubnetsResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetSubnetsResult, error) {
args := v.(GetSubnetsArgs)
r, err := GetSubnets(ctx, &args, opts...)
var s GetSubnetsResult
if r != nil {
s = *r
}
return s, err
}).(GetSubnetsResultOutput)
}
// A collection of arguments for invoking getSubnets.
type GetSubnetsOutputArgs struct {
// Custom filter block as described below.
Filters GetSubnetsFilterArrayInput `pulumi:"filters"`
// Map of tags, each pair of which must exactly match
// a pair on the desired subnets.
//
// More complex filters can be expressed using one or more `filter` sub-blocks,
// which take the following arguments:
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (GetSubnetsOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetSubnetsArgs)(nil)).Elem()
}
// A collection of values returned by getSubnets.
type GetSubnetsResultOutput struct{ *pulumi.OutputState }
func (GetSubnetsResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetSubnetsResult)(nil)).Elem()
}
func (o GetSubnetsResultOutput) ToGetSubnetsResultOutput() GetSubnetsResultOutput {
return o
}
func (o GetSubnetsResultOutput) ToGetSubnetsResultOutputWithContext(ctx context.Context) GetSubnetsResultOutput {
return o
}
func (o GetSubnetsResultOutput) Filters() GetSubnetsFilterArrayOutput {
return o.ApplyT(func(v GetSubnetsResult) []GetSubnetsFilter { return v.Filters }).(GetSubnetsFilterArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetSubnetsResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetSubnetsResult) string { return v.Id }).(pulumi.StringOutput)
}
// List of all the subnet ids found.
func (o GetSubnetsResultOutput) Ids() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetSubnetsResult) []string { return v.Ids }).(pulumi.StringArrayOutput)
}
func (o GetSubnetsResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v GetSubnetsResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(GetSubnetsResultOutput{})
}