-
Notifications
You must be signed in to change notification settings - Fork 51
/
getSharedImageVersion.go
198 lines (171 loc) · 8.57 KB
/
getSharedImageVersion.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
// 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/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Version of a 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.LookupSharedImageVersion(ctx, &compute.LookupSharedImageVersionArgs{
// GalleryName: "my-image-gallery",
// ImageName: "my-image",
// Name: "1.0.0",
// ResourceGroupName: "example-resources",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupSharedImageVersion(ctx *pulumi.Context, args *LookupSharedImageVersionArgs, opts ...pulumi.InvokeOption) (*LookupSharedImageVersionResult, error) {
var rv LookupSharedImageVersionResult
err := ctx.Invoke("azure:compute/getSharedImageVersion:getSharedImageVersion", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSharedImageVersion.
type LookupSharedImageVersionArgs struct {
// The name of the Shared Image Gallery in which the Shared Image exists.
GalleryName string `pulumi:"galleryName"`
// The name of the Shared Image in which this Version exists.
ImageName string `pulumi:"imageName"`
// The name of the Image Version.
Name string `pulumi:"name"`
// The name of the Resource Group in which the Shared Image Gallery exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Sort available versions taking SemVer versioning scheme into account. Defaults to `false`.
SortVersionsBySemver *bool `pulumi:"sortVersionsBySemver"`
}
// A collection of values returned by getSharedImageVersion.
type LookupSharedImageVersionResult struct {
// Is this Image Version excluded from the `latest` filter?
ExcludeFromLatest bool `pulumi:"excludeFromLatest"`
GalleryName string `pulumi:"galleryName"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
ImageName string `pulumi:"imageName"`
// The supported Azure location where the Shared Image Gallery exists.
Location string `pulumi:"location"`
// The ID of the Managed Image which was the source of this Shared Image Version.
ManagedImageId string `pulumi:"managedImageId"`
// The Azure Region in which this Image Version exists.
Name string `pulumi:"name"`
// The size of the OS disk snapshot (in Gigabytes) which was the source of this Shared Image Version.
OsDiskImageSizeGb int `pulumi:"osDiskImageSizeGb"`
// The ID of the OS disk snapshot which was the source of this Shared Image Version.
OsDiskSnapshotId string `pulumi:"osDiskSnapshotId"`
ResourceGroupName string `pulumi:"resourceGroupName"`
SortVersionsBySemver *bool `pulumi:"sortVersionsBySemver"`
// A mapping of tags assigned to the Shared Image.
Tags map[string]string `pulumi:"tags"`
// One or more `targetRegion` blocks as documented below.
TargetRegions []GetSharedImageVersionTargetRegion `pulumi:"targetRegions"`
}
func LookupSharedImageVersionOutput(ctx *pulumi.Context, args LookupSharedImageVersionOutputArgs, opts ...pulumi.InvokeOption) LookupSharedImageVersionResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupSharedImageVersionResult, error) {
args := v.(LookupSharedImageVersionArgs)
r, err := LookupSharedImageVersion(ctx, &args, opts...)
var s LookupSharedImageVersionResult
if r != nil {
s = *r
}
return s, err
}).(LookupSharedImageVersionResultOutput)
}
// A collection of arguments for invoking getSharedImageVersion.
type LookupSharedImageVersionOutputArgs 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 in which this Version exists.
ImageName pulumi.StringInput `pulumi:"imageName"`
// The name of the Image Version.
Name pulumi.StringInput `pulumi:"name"`
// The name of the Resource Group in which the Shared Image Gallery exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
// Sort available versions taking SemVer versioning scheme into account. Defaults to `false`.
SortVersionsBySemver pulumi.BoolPtrInput `pulumi:"sortVersionsBySemver"`
}
func (LookupSharedImageVersionOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSharedImageVersionArgs)(nil)).Elem()
}
// A collection of values returned by getSharedImageVersion.
type LookupSharedImageVersionResultOutput struct{ *pulumi.OutputState }
func (LookupSharedImageVersionResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSharedImageVersionResult)(nil)).Elem()
}
func (o LookupSharedImageVersionResultOutput) ToLookupSharedImageVersionResultOutput() LookupSharedImageVersionResultOutput {
return o
}
func (o LookupSharedImageVersionResultOutput) ToLookupSharedImageVersionResultOutputWithContext(ctx context.Context) LookupSharedImageVersionResultOutput {
return o
}
// Is this Image Version excluded from the `latest` filter?
func (o LookupSharedImageVersionResultOutput) ExcludeFromLatest() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) bool { return v.ExcludeFromLatest }).(pulumi.BoolOutput)
}
func (o LookupSharedImageVersionResultOutput) GalleryName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) string { return v.GalleryName }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupSharedImageVersionResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupSharedImageVersionResultOutput) ImageName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) string { return v.ImageName }).(pulumi.StringOutput)
}
// The supported Azure location where the Shared Image Gallery exists.
func (o LookupSharedImageVersionResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) string { return v.Location }).(pulumi.StringOutput)
}
// The ID of the Managed Image which was the source of this Shared Image Version.
func (o LookupSharedImageVersionResultOutput) ManagedImageId() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) string { return v.ManagedImageId }).(pulumi.StringOutput)
}
// The Azure Region in which this Image Version exists.
func (o LookupSharedImageVersionResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) string { return v.Name }).(pulumi.StringOutput)
}
// The size of the OS disk snapshot (in Gigabytes) which was the source of this Shared Image Version.
func (o LookupSharedImageVersionResultOutput) OsDiskImageSizeGb() pulumi.IntOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) int { return v.OsDiskImageSizeGb }).(pulumi.IntOutput)
}
// The ID of the OS disk snapshot which was the source of this Shared Image Version.
func (o LookupSharedImageVersionResultOutput) OsDiskSnapshotId() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) string { return v.OsDiskSnapshotId }).(pulumi.StringOutput)
}
func (o LookupSharedImageVersionResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
func (o LookupSharedImageVersionResultOutput) SortVersionsBySemver() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) *bool { return v.SortVersionsBySemver }).(pulumi.BoolPtrOutput)
}
// A mapping of tags assigned to the Shared Image.
func (o LookupSharedImageVersionResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// One or more `targetRegion` blocks as documented below.
func (o LookupSharedImageVersionResultOutput) TargetRegions() GetSharedImageVersionTargetRegionArrayOutput {
return o.ApplyT(func(v LookupSharedImageVersionResult) []GetSharedImageVersionTargetRegion { return v.TargetRegions }).(GetSharedImageVersionTargetRegionArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupSharedImageVersionResultOutput{})
}