github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/servicecatalog/getProduct.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 servicecatalog 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 retrieve information about a Service Catalog product. 15 // 16 // > **NOTE:** A "provisioning artifact" is also known as a "version," and a "distributor" is also known as a "vendor." 17 // 18 // ## Example Usage 19 // 20 // ### Basic Usage 21 // 22 // <!--Start PulumiCodeChooser --> 23 // ```go 24 // package main 25 // 26 // import ( 27 // 28 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/servicecatalog" 29 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 30 // 31 // ) 32 // 33 // func main() { 34 // pulumi.Run(func(ctx *pulumi.Context) error { 35 // _, err := servicecatalog.LookupProduct(ctx, &servicecatalog.LookupProductArgs{ 36 // Id: "prod-dnigbtea24ste", 37 // }, nil) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 func LookupProduct(ctx *pulumi.Context, args *LookupProductArgs, opts ...pulumi.InvokeOption) (*LookupProductResult, error) { 48 opts = internal.PkgInvokeDefaultOpts(opts) 49 var rv LookupProductResult 50 err := ctx.Invoke("aws:servicecatalog/getProduct:getProduct", args, &rv, opts...) 51 if err != nil { 52 return nil, err 53 } 54 return &rv, nil 55 } 56 57 // A collection of arguments for invoking getProduct. 58 type LookupProductArgs struct { 59 // Language code. Valid values are `en` (English), `jp` (Japanese), `zh` (Chinese). The default value is `en`. 60 AcceptLanguage *string `pulumi:"acceptLanguage"` 61 // ID of the product. 62 // 63 // The following arguments are optional: 64 Id string `pulumi:"id"` 65 // Tags applied to the product. 66 Tags map[string]string `pulumi:"tags"` 67 } 68 69 // A collection of values returned by getProduct. 70 type LookupProductResult struct { 71 AcceptLanguage *string `pulumi:"acceptLanguage"` 72 // ARN of the product. 73 Arn string `pulumi:"arn"` 74 // Time when the product was created. 75 CreatedTime string `pulumi:"createdTime"` 76 // Description of the product. 77 Description string `pulumi:"description"` 78 // Vendor of the product. 79 Distributor string `pulumi:"distributor"` 80 // Whether the product has a default path. 81 HasDefaultPath bool `pulumi:"hasDefaultPath"` 82 Id string `pulumi:"id"` 83 // Name of the product. 84 Name string `pulumi:"name"` 85 // Owner of the product. 86 Owner string `pulumi:"owner"` 87 // Status of the product. 88 Status string `pulumi:"status"` 89 // Field that provides support information about the product. 90 SupportDescription string `pulumi:"supportDescription"` 91 // Contact email for product support. 92 SupportEmail string `pulumi:"supportEmail"` 93 // Contact URL for product support. 94 SupportUrl string `pulumi:"supportUrl"` 95 // Tags applied to the product. 96 Tags map[string]string `pulumi:"tags"` 97 // Type of product. 98 Type string `pulumi:"type"` 99 } 100 101 func LookupProductOutput(ctx *pulumi.Context, args LookupProductOutputArgs, opts ...pulumi.InvokeOption) LookupProductResultOutput { 102 return pulumi.ToOutputWithContext(context.Background(), args). 103 ApplyT(func(v interface{}) (LookupProductResult, error) { 104 args := v.(LookupProductArgs) 105 r, err := LookupProduct(ctx, &args, opts...) 106 var s LookupProductResult 107 if r != nil { 108 s = *r 109 } 110 return s, err 111 }).(LookupProductResultOutput) 112 } 113 114 // A collection of arguments for invoking getProduct. 115 type LookupProductOutputArgs struct { 116 // Language code. Valid values are `en` (English), `jp` (Japanese), `zh` (Chinese). The default value is `en`. 117 AcceptLanguage pulumi.StringPtrInput `pulumi:"acceptLanguage"` 118 // ID of the product. 119 // 120 // The following arguments are optional: 121 Id pulumi.StringInput `pulumi:"id"` 122 // Tags applied to the product. 123 Tags pulumi.StringMapInput `pulumi:"tags"` 124 } 125 126 func (LookupProductOutputArgs) ElementType() reflect.Type { 127 return reflect.TypeOf((*LookupProductArgs)(nil)).Elem() 128 } 129 130 // A collection of values returned by getProduct. 131 type LookupProductResultOutput struct{ *pulumi.OutputState } 132 133 func (LookupProductResultOutput) ElementType() reflect.Type { 134 return reflect.TypeOf((*LookupProductResult)(nil)).Elem() 135 } 136 137 func (o LookupProductResultOutput) ToLookupProductResultOutput() LookupProductResultOutput { 138 return o 139 } 140 141 func (o LookupProductResultOutput) ToLookupProductResultOutputWithContext(ctx context.Context) LookupProductResultOutput { 142 return o 143 } 144 145 func (o LookupProductResultOutput) AcceptLanguage() pulumi.StringPtrOutput { 146 return o.ApplyT(func(v LookupProductResult) *string { return v.AcceptLanguage }).(pulumi.StringPtrOutput) 147 } 148 149 // ARN of the product. 150 func (o LookupProductResultOutput) Arn() pulumi.StringOutput { 151 return o.ApplyT(func(v LookupProductResult) string { return v.Arn }).(pulumi.StringOutput) 152 } 153 154 // Time when the product was created. 155 func (o LookupProductResultOutput) CreatedTime() pulumi.StringOutput { 156 return o.ApplyT(func(v LookupProductResult) string { return v.CreatedTime }).(pulumi.StringOutput) 157 } 158 159 // Description of the product. 160 func (o LookupProductResultOutput) Description() pulumi.StringOutput { 161 return o.ApplyT(func(v LookupProductResult) string { return v.Description }).(pulumi.StringOutput) 162 } 163 164 // Vendor of the product. 165 func (o LookupProductResultOutput) Distributor() pulumi.StringOutput { 166 return o.ApplyT(func(v LookupProductResult) string { return v.Distributor }).(pulumi.StringOutput) 167 } 168 169 // Whether the product has a default path. 170 func (o LookupProductResultOutput) HasDefaultPath() pulumi.BoolOutput { 171 return o.ApplyT(func(v LookupProductResult) bool { return v.HasDefaultPath }).(pulumi.BoolOutput) 172 } 173 174 func (o LookupProductResultOutput) Id() pulumi.StringOutput { 175 return o.ApplyT(func(v LookupProductResult) string { return v.Id }).(pulumi.StringOutput) 176 } 177 178 // Name of the product. 179 func (o LookupProductResultOutput) Name() pulumi.StringOutput { 180 return o.ApplyT(func(v LookupProductResult) string { return v.Name }).(pulumi.StringOutput) 181 } 182 183 // Owner of the product. 184 func (o LookupProductResultOutput) Owner() pulumi.StringOutput { 185 return o.ApplyT(func(v LookupProductResult) string { return v.Owner }).(pulumi.StringOutput) 186 } 187 188 // Status of the product. 189 func (o LookupProductResultOutput) Status() pulumi.StringOutput { 190 return o.ApplyT(func(v LookupProductResult) string { return v.Status }).(pulumi.StringOutput) 191 } 192 193 // Field that provides support information about the product. 194 func (o LookupProductResultOutput) SupportDescription() pulumi.StringOutput { 195 return o.ApplyT(func(v LookupProductResult) string { return v.SupportDescription }).(pulumi.StringOutput) 196 } 197 198 // Contact email for product support. 199 func (o LookupProductResultOutput) SupportEmail() pulumi.StringOutput { 200 return o.ApplyT(func(v LookupProductResult) string { return v.SupportEmail }).(pulumi.StringOutput) 201 } 202 203 // Contact URL for product support. 204 func (o LookupProductResultOutput) SupportUrl() pulumi.StringOutput { 205 return o.ApplyT(func(v LookupProductResult) string { return v.SupportUrl }).(pulumi.StringOutput) 206 } 207 208 // Tags applied to the product. 209 func (o LookupProductResultOutput) Tags() pulumi.StringMapOutput { 210 return o.ApplyT(func(v LookupProductResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 211 } 212 213 // Type of product. 214 func (o LookupProductResultOutput) Type() pulumi.StringOutput { 215 return o.ApplyT(func(v LookupProductResult) string { return v.Type }).(pulumi.StringOutput) 216 } 217 218 func init() { 219 pulumi.RegisterOutputType(LookupProductResultOutput{}) 220 }