/
getBundle.go
190 lines (168 loc) · 5.87 KB
/
getBundle.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
// 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 workspaces
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Retrieve information about an AWS WorkSpaces bundle.
//
// ## Example Usage
// ### By ID
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/workspaces"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := workspaces.GetBundle(ctx, &workspaces.GetBundleArgs{
// BundleId: pulumi.StringRef("wsb-b0s22j3d7"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### By Owner & Name
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/workspaces"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := workspaces.GetBundle(ctx, &workspaces.GetBundleArgs{
// Name: pulumi.StringRef("Value with Windows 10 and Office 2016"),
// Owner: pulumi.StringRef("AMAZON"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetBundle(ctx *pulumi.Context, args *GetBundleArgs, opts ...pulumi.InvokeOption) (*GetBundleResult, error) {
var rv GetBundleResult
err := ctx.Invoke("aws:workspaces/getBundle:getBundle", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getBundle.
type GetBundleArgs struct {
// ID of the bundle.
BundleId *string `pulumi:"bundleId"`
// Name of the bundle. You cannot combine this parameter with `bundleId`.
Name *string `pulumi:"name"`
// Owner of the bundles. You have to leave it blank for own bundles. You cannot combine this parameter with `bundleId`.
Owner *string `pulumi:"owner"`
}
// A collection of values returned by getBundle.
type GetBundleResult struct {
// The ID of the bundle.
BundleId *string `pulumi:"bundleId"`
// The compute type. See supported fields below.
ComputeTypes []GetBundleComputeType `pulumi:"computeTypes"`
// The description of the bundle.
Description string `pulumi:"description"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Name of the compute type.
Name *string `pulumi:"name"`
// The owner of the bundle.
Owner *string `pulumi:"owner"`
// The root volume. See supported fields below.
RootStorages []GetBundleRootStorage `pulumi:"rootStorages"`
// The user storage. See supported fields below.
UserStorages []GetBundleUserStorage `pulumi:"userStorages"`
}
func GetBundleOutput(ctx *pulumi.Context, args GetBundleOutputArgs, opts ...pulumi.InvokeOption) GetBundleResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetBundleResult, error) {
args := v.(GetBundleArgs)
r, err := GetBundle(ctx, &args, opts...)
var s GetBundleResult
if r != nil {
s = *r
}
return s, err
}).(GetBundleResultOutput)
}
// A collection of arguments for invoking getBundle.
type GetBundleOutputArgs struct {
// ID of the bundle.
BundleId pulumi.StringPtrInput `pulumi:"bundleId"`
// Name of the bundle. You cannot combine this parameter with `bundleId`.
Name pulumi.StringPtrInput `pulumi:"name"`
// Owner of the bundles. You have to leave it blank for own bundles. You cannot combine this parameter with `bundleId`.
Owner pulumi.StringPtrInput `pulumi:"owner"`
}
func (GetBundleOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetBundleArgs)(nil)).Elem()
}
// A collection of values returned by getBundle.
type GetBundleResultOutput struct{ *pulumi.OutputState }
func (GetBundleResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetBundleResult)(nil)).Elem()
}
func (o GetBundleResultOutput) ToGetBundleResultOutput() GetBundleResultOutput {
return o
}
func (o GetBundleResultOutput) ToGetBundleResultOutputWithContext(ctx context.Context) GetBundleResultOutput {
return o
}
// The ID of the bundle.
func (o GetBundleResultOutput) BundleId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetBundleResult) *string { return v.BundleId }).(pulumi.StringPtrOutput)
}
// The compute type. See supported fields below.
func (o GetBundleResultOutput) ComputeTypes() GetBundleComputeTypeArrayOutput {
return o.ApplyT(func(v GetBundleResult) []GetBundleComputeType { return v.ComputeTypes }).(GetBundleComputeTypeArrayOutput)
}
// The description of the bundle.
func (o GetBundleResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v GetBundleResult) string { return v.Description }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetBundleResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetBundleResult) string { return v.Id }).(pulumi.StringOutput)
}
// Name of the compute type.
func (o GetBundleResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetBundleResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
// The owner of the bundle.
func (o GetBundleResultOutput) Owner() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetBundleResult) *string { return v.Owner }).(pulumi.StringPtrOutput)
}
// The root volume. See supported fields below.
func (o GetBundleResultOutput) RootStorages() GetBundleRootStorageArrayOutput {
return o.ApplyT(func(v GetBundleResult) []GetBundleRootStorage { return v.RootStorages }).(GetBundleRootStorageArrayOutput)
}
// The user storage. See supported fields below.
func (o GetBundleResultOutput) UserStorages() GetBundleUserStorageArrayOutput {
return o.ApplyT(func(v GetBundleResult) []GetBundleUserStorage { return v.UserStorages }).(GetBundleUserStorageArrayOutput)
}
func init() {
pulumi.RegisterOutputType(GetBundleResultOutput{})
}