-
Notifications
You must be signed in to change notification settings - Fork 51
/
getSharedImage.go
217 lines (187 loc) · 8.78 KB
/
getSharedImage.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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
// 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 compute
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Shared Image within a Shared Image Gallery.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := compute.LookupSharedImage(ctx, &compute.LookupSharedImageArgs{
// Name: "my-image",
// GalleryName: "my-image-gallery",
// ResourceGroupName: "example-resources",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupSharedImage(ctx *pulumi.Context, args *LookupSharedImageArgs, opts ...pulumi.InvokeOption) (*LookupSharedImageResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupSharedImageResult
err := ctx.Invoke("azure:compute/getSharedImage:getSharedImage", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSharedImage.
type LookupSharedImageArgs struct {
// The name of the Shared Image Gallery in which the Shared Image exists.
GalleryName string `pulumi:"galleryName"`
// The name of the Shared Image.
Name string `pulumi:"name"`
// The name of the Resource Group in which the Shared Image Gallery exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getSharedImage.
type LookupSharedImageResult struct {
Architecture string `pulumi:"architecture"`
// The description of this Shared Image.
Description string `pulumi:"description"`
// The End User Licence Agreement for the Shared Image.
Eula string `pulumi:"eula"`
GalleryName string `pulumi:"galleryName"`
// The generation of HyperV that the Virtual Machine used to create the Shared Image is based on.
HyperVGeneration string `pulumi:"hyperVGeneration"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// An `identifier` block as defined below.
Identifiers []GetSharedImageIdentifier `pulumi:"identifiers"`
// The supported Azure location where the Shared Image Gallery exists.
Location string `pulumi:"location"`
// (Required) The Purchase Plan Name for this Shared Image.
Name string `pulumi:"name"`
// The type of Operating System present in this Shared Image.
OsType string `pulumi:"osType"`
// The URI containing the Privacy Statement for this Shared Image.
PrivacyStatementUri string `pulumi:"privacyStatementUri"`
// (Optional) A `purchasePlan` block as defined below.
PurchasePlans []GetSharedImagePurchasePlan `pulumi:"purchasePlans"`
// The URI containing the Release Notes for this Shared Image.
ReleaseNoteUri string `pulumi:"releaseNoteUri"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// Specifies that the Operating System used inside this Image has not been Generalized (for example, `sysprep` on Windows has not been run).
Specialized bool `pulumi:"specialized"`
// A mapping of tags assigned to the Shared Image.
Tags map[string]string `pulumi:"tags"`
}
func LookupSharedImageOutput(ctx *pulumi.Context, args LookupSharedImageOutputArgs, opts ...pulumi.InvokeOption) LookupSharedImageResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupSharedImageResult, error) {
args := v.(LookupSharedImageArgs)
r, err := LookupSharedImage(ctx, &args, opts...)
var s LookupSharedImageResult
if r != nil {
s = *r
}
return s, err
}).(LookupSharedImageResultOutput)
}
// A collection of arguments for invoking getSharedImage.
type LookupSharedImageOutputArgs struct {
// The name of the Shared Image Gallery in which the Shared Image exists.
GalleryName pulumi.StringInput `pulumi:"galleryName"`
// The name of the Shared Image.
Name pulumi.StringInput `pulumi:"name"`
// The name of the Resource Group in which the Shared Image Gallery exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupSharedImageOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSharedImageArgs)(nil)).Elem()
}
// A collection of values returned by getSharedImage.
type LookupSharedImageResultOutput struct{ *pulumi.OutputState }
func (LookupSharedImageResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSharedImageResult)(nil)).Elem()
}
func (o LookupSharedImageResultOutput) ToLookupSharedImageResultOutput() LookupSharedImageResultOutput {
return o
}
func (o LookupSharedImageResultOutput) ToLookupSharedImageResultOutputWithContext(ctx context.Context) LookupSharedImageResultOutput {
return o
}
func (o LookupSharedImageResultOutput) Architecture() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.Architecture }).(pulumi.StringOutput)
}
// The description of this Shared Image.
func (o LookupSharedImageResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.Description }).(pulumi.StringOutput)
}
// The End User Licence Agreement for the Shared Image.
func (o LookupSharedImageResultOutput) Eula() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.Eula }).(pulumi.StringOutput)
}
func (o LookupSharedImageResultOutput) GalleryName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.GalleryName }).(pulumi.StringOutput)
}
// The generation of HyperV that the Virtual Machine used to create the Shared Image is based on.
func (o LookupSharedImageResultOutput) HyperVGeneration() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.HyperVGeneration }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupSharedImageResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.Id }).(pulumi.StringOutput)
}
// An `identifier` block as defined below.
func (o LookupSharedImageResultOutput) Identifiers() GetSharedImageIdentifierArrayOutput {
return o.ApplyT(func(v LookupSharedImageResult) []GetSharedImageIdentifier { return v.Identifiers }).(GetSharedImageIdentifierArrayOutput)
}
// The supported Azure location where the Shared Image Gallery exists.
func (o LookupSharedImageResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.Location }).(pulumi.StringOutput)
}
// (Required) The Purchase Plan Name for this Shared Image.
func (o LookupSharedImageResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.Name }).(pulumi.StringOutput)
}
// The type of Operating System present in this Shared Image.
func (o LookupSharedImageResultOutput) OsType() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.OsType }).(pulumi.StringOutput)
}
// The URI containing the Privacy Statement for this Shared Image.
func (o LookupSharedImageResultOutput) PrivacyStatementUri() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.PrivacyStatementUri }).(pulumi.StringOutput)
}
// (Optional) A `purchasePlan` block as defined below.
func (o LookupSharedImageResultOutput) PurchasePlans() GetSharedImagePurchasePlanArrayOutput {
return o.ApplyT(func(v LookupSharedImageResult) []GetSharedImagePurchasePlan { return v.PurchasePlans }).(GetSharedImagePurchasePlanArrayOutput)
}
// The URI containing the Release Notes for this Shared Image.
func (o LookupSharedImageResultOutput) ReleaseNoteUri() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.ReleaseNoteUri }).(pulumi.StringOutput)
}
func (o LookupSharedImageResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// Specifies that the Operating System used inside this Image has not been Generalized (for example, `sysprep` on Windows has not been run).
func (o LookupSharedImageResultOutput) Specialized() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSharedImageResult) bool { return v.Specialized }).(pulumi.BoolOutput)
}
// A mapping of tags assigned to the Shared Image.
func (o LookupSharedImageResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupSharedImageResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupSharedImageResultOutput{})
}