github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/workspaces/getBundle.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 workspaces 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 an AWS WorkSpaces bundle. 15 // 16 // ## Example Usage 17 // 18 // ### By ID 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/workspaces" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // _, err := workspaces.GetBundle(ctx, &workspaces.GetBundleArgs{ 34 // BundleId: pulumi.StringRef("wsb-b0s22j3d7"), 35 // }, nil) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 // 46 // ### By Owner & Name 47 // 48 // <!--Start PulumiCodeChooser --> 49 // ```go 50 // package main 51 // 52 // import ( 53 // 54 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/workspaces" 55 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 56 // 57 // ) 58 // 59 // func main() { 60 // pulumi.Run(func(ctx *pulumi.Context) error { 61 // _, err := workspaces.GetBundle(ctx, &workspaces.GetBundleArgs{ 62 // Owner: pulumi.StringRef("AMAZON"), 63 // Name: pulumi.StringRef("Value with Windows 10 and Office 2016"), 64 // }, nil) 65 // if err != nil { 66 // return err 67 // } 68 // return nil 69 // }) 70 // } 71 // 72 // ``` 73 // <!--End PulumiCodeChooser --> 74 func GetBundle(ctx *pulumi.Context, args *GetBundleArgs, opts ...pulumi.InvokeOption) (*GetBundleResult, error) { 75 opts = internal.PkgInvokeDefaultOpts(opts) 76 var rv GetBundleResult 77 err := ctx.Invoke("aws:workspaces/getBundle:getBundle", args, &rv, opts...) 78 if err != nil { 79 return nil, err 80 } 81 return &rv, nil 82 } 83 84 // A collection of arguments for invoking getBundle. 85 type GetBundleArgs struct { 86 // ID of the bundle. 87 BundleId *string `pulumi:"bundleId"` 88 // Name of the bundle. You cannot combine this parameter with `bundleId`. 89 Name *string `pulumi:"name"` 90 // Owner of the bundles. You have to leave it blank for own bundles. You cannot combine this parameter with `bundleId`. 91 Owner *string `pulumi:"owner"` 92 } 93 94 // A collection of values returned by getBundle. 95 type GetBundleResult struct { 96 // The ID of the bundle. 97 BundleId *string `pulumi:"bundleId"` 98 // The compute type. See supported fields below. 99 ComputeTypes []GetBundleComputeType `pulumi:"computeTypes"` 100 // The description of the bundle. 101 Description string `pulumi:"description"` 102 // The provider-assigned unique ID for this managed resource. 103 Id string `pulumi:"id"` 104 // Name of the compute type. 105 Name *string `pulumi:"name"` 106 // The owner of the bundle. 107 Owner *string `pulumi:"owner"` 108 // The root volume. See supported fields below. 109 RootStorages []GetBundleRootStorage `pulumi:"rootStorages"` 110 // The user storage. See supported fields below. 111 UserStorages []GetBundleUserStorage `pulumi:"userStorages"` 112 } 113 114 func GetBundleOutput(ctx *pulumi.Context, args GetBundleOutputArgs, opts ...pulumi.InvokeOption) GetBundleResultOutput { 115 return pulumi.ToOutputWithContext(context.Background(), args). 116 ApplyT(func(v interface{}) (GetBundleResult, error) { 117 args := v.(GetBundleArgs) 118 r, err := GetBundle(ctx, &args, opts...) 119 var s GetBundleResult 120 if r != nil { 121 s = *r 122 } 123 return s, err 124 }).(GetBundleResultOutput) 125 } 126 127 // A collection of arguments for invoking getBundle. 128 type GetBundleOutputArgs struct { 129 // ID of the bundle. 130 BundleId pulumi.StringPtrInput `pulumi:"bundleId"` 131 // Name of the bundle. You cannot combine this parameter with `bundleId`. 132 Name pulumi.StringPtrInput `pulumi:"name"` 133 // Owner of the bundles. You have to leave it blank for own bundles. You cannot combine this parameter with `bundleId`. 134 Owner pulumi.StringPtrInput `pulumi:"owner"` 135 } 136 137 func (GetBundleOutputArgs) ElementType() reflect.Type { 138 return reflect.TypeOf((*GetBundleArgs)(nil)).Elem() 139 } 140 141 // A collection of values returned by getBundle. 142 type GetBundleResultOutput struct{ *pulumi.OutputState } 143 144 func (GetBundleResultOutput) ElementType() reflect.Type { 145 return reflect.TypeOf((*GetBundleResult)(nil)).Elem() 146 } 147 148 func (o GetBundleResultOutput) ToGetBundleResultOutput() GetBundleResultOutput { 149 return o 150 } 151 152 func (o GetBundleResultOutput) ToGetBundleResultOutputWithContext(ctx context.Context) GetBundleResultOutput { 153 return o 154 } 155 156 // The ID of the bundle. 157 func (o GetBundleResultOutput) BundleId() pulumi.StringPtrOutput { 158 return o.ApplyT(func(v GetBundleResult) *string { return v.BundleId }).(pulumi.StringPtrOutput) 159 } 160 161 // The compute type. See supported fields below. 162 func (o GetBundleResultOutput) ComputeTypes() GetBundleComputeTypeArrayOutput { 163 return o.ApplyT(func(v GetBundleResult) []GetBundleComputeType { return v.ComputeTypes }).(GetBundleComputeTypeArrayOutput) 164 } 165 166 // The description of the bundle. 167 func (o GetBundleResultOutput) Description() pulumi.StringOutput { 168 return o.ApplyT(func(v GetBundleResult) string { return v.Description }).(pulumi.StringOutput) 169 } 170 171 // The provider-assigned unique ID for this managed resource. 172 func (o GetBundleResultOutput) Id() pulumi.StringOutput { 173 return o.ApplyT(func(v GetBundleResult) string { return v.Id }).(pulumi.StringOutput) 174 } 175 176 // Name of the compute type. 177 func (o GetBundleResultOutput) Name() pulumi.StringPtrOutput { 178 return o.ApplyT(func(v GetBundleResult) *string { return v.Name }).(pulumi.StringPtrOutput) 179 } 180 181 // The owner of the bundle. 182 func (o GetBundleResultOutput) Owner() pulumi.StringPtrOutput { 183 return o.ApplyT(func(v GetBundleResult) *string { return v.Owner }).(pulumi.StringPtrOutput) 184 } 185 186 // The root volume. See supported fields below. 187 func (o GetBundleResultOutput) RootStorages() GetBundleRootStorageArrayOutput { 188 return o.ApplyT(func(v GetBundleResult) []GetBundleRootStorage { return v.RootStorages }).(GetBundleRootStorageArrayOutput) 189 } 190 191 // The user storage. See supported fields below. 192 func (o GetBundleResultOutput) UserStorages() GetBundleUserStorageArrayOutput { 193 return o.ApplyT(func(v GetBundleResult) []GetBundleUserStorage { return v.UserStorages }).(GetBundleUserStorageArrayOutput) 194 } 195 196 func init() { 197 pulumi.RegisterOutputType(GetBundleResultOutput{}) 198 }