github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/workspaces/getImage.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 // Use this data source to get information about a Workspaces image. 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/workspaces" 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 := workspaces.GetImage(ctx, &workspaces.GetImageArgs{ 32 // ImageId: "wsi-ten5h0y19", 33 // }, nil) 34 // if err != nil { 35 // return err 36 // } 37 // return nil 38 // }) 39 // } 40 // 41 // ``` 42 // <!--End PulumiCodeChooser --> 43 func GetImage(ctx *pulumi.Context, args *GetImageArgs, opts ...pulumi.InvokeOption) (*GetImageResult, error) { 44 opts = internal.PkgInvokeDefaultOpts(opts) 45 var rv GetImageResult 46 err := ctx.Invoke("aws:workspaces/getImage:getImage", args, &rv, opts...) 47 if err != nil { 48 return nil, err 49 } 50 return &rv, nil 51 } 52 53 // A collection of arguments for invoking getImage. 54 type GetImageArgs struct { 55 // ID of the image. 56 ImageId string `pulumi:"imageId"` 57 } 58 59 // A collection of values returned by getImage. 60 type GetImageResult struct { 61 // The description of the image. 62 Description string `pulumi:"description"` 63 // The provider-assigned unique ID for this managed resource. 64 Id string `pulumi:"id"` 65 ImageId string `pulumi:"imageId"` 66 // The name of the image. 67 Name string `pulumi:"name"` 68 OperatingSystemType string `pulumi:"operatingSystemType"` 69 // Specifies whether the image is running on dedicated hardware. When Bring Your Own License (BYOL) is enabled, this value is set to DEDICATED. For more information, see [Bring Your Own Windows Desktop Images](https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html). 70 RequiredTenancy string `pulumi:"requiredTenancy"` 71 // The status of the image. 72 State string `pulumi:"state"` 73 } 74 75 func GetImageOutput(ctx *pulumi.Context, args GetImageOutputArgs, opts ...pulumi.InvokeOption) GetImageResultOutput { 76 return pulumi.ToOutputWithContext(context.Background(), args). 77 ApplyT(func(v interface{}) (GetImageResult, error) { 78 args := v.(GetImageArgs) 79 r, err := GetImage(ctx, &args, opts...) 80 var s GetImageResult 81 if r != nil { 82 s = *r 83 } 84 return s, err 85 }).(GetImageResultOutput) 86 } 87 88 // A collection of arguments for invoking getImage. 89 type GetImageOutputArgs struct { 90 // ID of the image. 91 ImageId pulumi.StringInput `pulumi:"imageId"` 92 } 93 94 func (GetImageOutputArgs) ElementType() reflect.Type { 95 return reflect.TypeOf((*GetImageArgs)(nil)).Elem() 96 } 97 98 // A collection of values returned by getImage. 99 type GetImageResultOutput struct{ *pulumi.OutputState } 100 101 func (GetImageResultOutput) ElementType() reflect.Type { 102 return reflect.TypeOf((*GetImageResult)(nil)).Elem() 103 } 104 105 func (o GetImageResultOutput) ToGetImageResultOutput() GetImageResultOutput { 106 return o 107 } 108 109 func (o GetImageResultOutput) ToGetImageResultOutputWithContext(ctx context.Context) GetImageResultOutput { 110 return o 111 } 112 113 // The description of the image. 114 func (o GetImageResultOutput) Description() pulumi.StringOutput { 115 return o.ApplyT(func(v GetImageResult) string { return v.Description }).(pulumi.StringOutput) 116 } 117 118 // The provider-assigned unique ID for this managed resource. 119 func (o GetImageResultOutput) Id() pulumi.StringOutput { 120 return o.ApplyT(func(v GetImageResult) string { return v.Id }).(pulumi.StringOutput) 121 } 122 123 func (o GetImageResultOutput) ImageId() pulumi.StringOutput { 124 return o.ApplyT(func(v GetImageResult) string { return v.ImageId }).(pulumi.StringOutput) 125 } 126 127 // The name of the image. 128 func (o GetImageResultOutput) Name() pulumi.StringOutput { 129 return o.ApplyT(func(v GetImageResult) string { return v.Name }).(pulumi.StringOutput) 130 } 131 132 func (o GetImageResultOutput) OperatingSystemType() pulumi.StringOutput { 133 return o.ApplyT(func(v GetImageResult) string { return v.OperatingSystemType }).(pulumi.StringOutput) 134 } 135 136 // Specifies whether the image is running on dedicated hardware. When Bring Your Own License (BYOL) is enabled, this value is set to DEDICATED. For more information, see [Bring Your Own Windows Desktop Images](https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html). 137 func (o GetImageResultOutput) RequiredTenancy() pulumi.StringOutput { 138 return o.ApplyT(func(v GetImageResult) string { return v.RequiredTenancy }).(pulumi.StringOutput) 139 } 140 141 // The status of the image. 142 func (o GetImageResultOutput) State() pulumi.StringOutput { 143 return o.ApplyT(func(v GetImageResult) string { return v.State }).(pulumi.StringOutput) 144 } 145 146 func init() { 147 pulumi.RegisterOutputType(GetImageResultOutput{}) 148 }