This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
registry.go
330 lines (306 loc) · 14 KB
/
registry.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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20191201preview
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// An object that represents a container registry.
type Registry struct {
pulumi.CustomResourceState
// The value that indicates whether the admin user is enabled.
AdminUserEnabled pulumi.BoolPtrOutput `pulumi:"adminUserEnabled"`
// The creation date of the container registry in ISO8601 format.
CreationDate pulumi.StringOutput `pulumi:"creationDate"`
// Enable a single data endpoint per region for serving data.
DataEndpointEnabled pulumi.BoolPtrOutput `pulumi:"dataEndpointEnabled"`
// List of host names that will serve data when dataEndpointEnabled is true.
DataEndpointHostNames pulumi.StringArrayOutput `pulumi:"dataEndpointHostNames"`
// The encryption settings of container registry.
Encryption EncryptionPropertyResponsePtrOutput `pulumi:"encryption"`
// The identity of the container registry.
Identity IdentityPropertiesResponsePtrOutput `pulumi:"identity"`
// The location of the resource. This cannot be changed after the resource is created.
Location pulumi.StringOutput `pulumi:"location"`
// The URL that can be used to log into the container registry.
LoginServer pulumi.StringOutput `pulumi:"loginServer"`
// The name of the resource.
Name pulumi.StringOutput `pulumi:"name"`
// Whether to allow trusted Azure services to access a network restricted registry.
NetworkRuleBypassOptions pulumi.StringPtrOutput `pulumi:"networkRuleBypassOptions"`
// The network rule set for a container registry.
NetworkRuleSet NetworkRuleSetResponsePtrOutput `pulumi:"networkRuleSet"`
// The policies for a container registry.
Policies PoliciesResponsePtrOutput `pulumi:"policies"`
// List of private endpoint connections for a container registry.
PrivateEndpointConnections PrivateEndpointConnectionResponseArrayOutput `pulumi:"privateEndpointConnections"`
// The provisioning state of the container registry at the time the operation was called.
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// Whether or not public network access is allowed for the container registry.
PublicNetworkAccess pulumi.StringPtrOutput `pulumi:"publicNetworkAccess"`
// The SKU of the container registry.
Sku SkuResponseOutput `pulumi:"sku"`
// The status of the container registry at the time the operation was called.
Status StatusResponseOutput `pulumi:"status"`
// The properties of the storage account for the container registry. Only applicable to Classic SKU.
StorageAccount StorageAccountPropertiesResponsePtrOutput `pulumi:"storageAccount"`
// Metadata pertaining to creation and last modification of the resource.
SystemData SystemDataResponseOutput `pulumi:"systemData"`
// The tags of the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The type of the resource.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewRegistry registers a new resource with the given unique name, arguments, and options.
func NewRegistry(ctx *pulumi.Context,
name string, args *RegistryArgs, opts ...pulumi.ResourceOption) (*Registry, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.RegistryName == nil {
return nil, errors.New("invalid value for required argument 'RegistryName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.Sku == nil {
return nil, errors.New("invalid value for required argument 'Sku'")
}
if args.AdminUserEnabled == nil {
args.AdminUserEnabled = pulumi.BoolPtr(false)
}
if args.NetworkRuleBypassOptions == nil {
args.NetworkRuleBypassOptions = pulumi.StringPtr("AzureServices")
}
if args.PublicNetworkAccess == nil {
args.PublicNetworkAccess = pulumi.StringPtr("Enabled")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:containerregistry/latest:Registry"),
},
{
Type: pulumi.String("azure-nextgen:containerregistry/v20160627preview:Registry"),
},
{
Type: pulumi.String("azure-nextgen:containerregistry/v20170301:Registry"),
},
{
Type: pulumi.String("azure-nextgen:containerregistry/v20170601preview:Registry"),
},
{
Type: pulumi.String("azure-nextgen:containerregistry/v20171001:Registry"),
},
{
Type: pulumi.String("azure-nextgen:containerregistry/v20190501:Registry"),
},
{
Type: pulumi.String("azure-nextgen:containerregistry/v20201101preview:Registry"),
},
})
opts = append(opts, aliases)
var resource Registry
err := ctx.RegisterResource("azure-nextgen:containerregistry/v20191201preview:Registry", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRegistry gets an existing Registry resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetRegistry(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RegistryState, opts ...pulumi.ResourceOption) (*Registry, error) {
var resource Registry
err := ctx.ReadResource("azure-nextgen:containerregistry/v20191201preview:Registry", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Registry resources.
type registryState struct {
// The value that indicates whether the admin user is enabled.
AdminUserEnabled *bool `pulumi:"adminUserEnabled"`
// The creation date of the container registry in ISO8601 format.
CreationDate *string `pulumi:"creationDate"`
// Enable a single data endpoint per region for serving data.
DataEndpointEnabled *bool `pulumi:"dataEndpointEnabled"`
// List of host names that will serve data when dataEndpointEnabled is true.
DataEndpointHostNames []string `pulumi:"dataEndpointHostNames"`
// The encryption settings of container registry.
Encryption *EncryptionPropertyResponse `pulumi:"encryption"`
// The identity of the container registry.
Identity *IdentityPropertiesResponse `pulumi:"identity"`
// The location of the resource. This cannot be changed after the resource is created.
Location *string `pulumi:"location"`
// The URL that can be used to log into the container registry.
LoginServer *string `pulumi:"loginServer"`
// The name of the resource.
Name *string `pulumi:"name"`
// Whether to allow trusted Azure services to access a network restricted registry.
NetworkRuleBypassOptions *string `pulumi:"networkRuleBypassOptions"`
// The network rule set for a container registry.
NetworkRuleSet *NetworkRuleSetResponse `pulumi:"networkRuleSet"`
// The policies for a container registry.
Policies *PoliciesResponse `pulumi:"policies"`
// List of private endpoint connections for a container registry.
PrivateEndpointConnections []PrivateEndpointConnectionResponse `pulumi:"privateEndpointConnections"`
// The provisioning state of the container registry at the time the operation was called.
ProvisioningState *string `pulumi:"provisioningState"`
// Whether or not public network access is allowed for the container registry.
PublicNetworkAccess *string `pulumi:"publicNetworkAccess"`
// The SKU of the container registry.
Sku *SkuResponse `pulumi:"sku"`
// The status of the container registry at the time the operation was called.
Status *StatusResponse `pulumi:"status"`
// The properties of the storage account for the container registry. Only applicable to Classic SKU.
StorageAccount *StorageAccountPropertiesResponse `pulumi:"storageAccount"`
// Metadata pertaining to creation and last modification of the resource.
SystemData *SystemDataResponse `pulumi:"systemData"`
// The tags of the resource.
Tags map[string]string `pulumi:"tags"`
// The type of the resource.
Type *string `pulumi:"type"`
}
type RegistryState struct {
// The value that indicates whether the admin user is enabled.
AdminUserEnabled pulumi.BoolPtrInput
// The creation date of the container registry in ISO8601 format.
CreationDate pulumi.StringPtrInput
// Enable a single data endpoint per region for serving data.
DataEndpointEnabled pulumi.BoolPtrInput
// List of host names that will serve data when dataEndpointEnabled is true.
DataEndpointHostNames pulumi.StringArrayInput
// The encryption settings of container registry.
Encryption EncryptionPropertyResponsePtrInput
// The identity of the container registry.
Identity IdentityPropertiesResponsePtrInput
// The location of the resource. This cannot be changed after the resource is created.
Location pulumi.StringPtrInput
// The URL that can be used to log into the container registry.
LoginServer pulumi.StringPtrInput
// The name of the resource.
Name pulumi.StringPtrInput
// Whether to allow trusted Azure services to access a network restricted registry.
NetworkRuleBypassOptions pulumi.StringPtrInput
// The network rule set for a container registry.
NetworkRuleSet NetworkRuleSetResponsePtrInput
// The policies for a container registry.
Policies PoliciesResponsePtrInput
// List of private endpoint connections for a container registry.
PrivateEndpointConnections PrivateEndpointConnectionResponseArrayInput
// The provisioning state of the container registry at the time the operation was called.
ProvisioningState pulumi.StringPtrInput
// Whether or not public network access is allowed for the container registry.
PublicNetworkAccess pulumi.StringPtrInput
// The SKU of the container registry.
Sku SkuResponsePtrInput
// The status of the container registry at the time the operation was called.
Status StatusResponsePtrInput
// The properties of the storage account for the container registry. Only applicable to Classic SKU.
StorageAccount StorageAccountPropertiesResponsePtrInput
// Metadata pertaining to creation and last modification of the resource.
SystemData SystemDataResponsePtrInput
// The tags of the resource.
Tags pulumi.StringMapInput
// The type of the resource.
Type pulumi.StringPtrInput
}
func (RegistryState) ElementType() reflect.Type {
return reflect.TypeOf((*registryState)(nil)).Elem()
}
type registryArgs struct {
// The value that indicates whether the admin user is enabled.
AdminUserEnabled *bool `pulumi:"adminUserEnabled"`
// Enable a single data endpoint per region for serving data.
DataEndpointEnabled *bool `pulumi:"dataEndpointEnabled"`
// The encryption settings of container registry.
Encryption *EncryptionProperty `pulumi:"encryption"`
// The identity of the container registry.
Identity *IdentityProperties `pulumi:"identity"`
// The location of the resource. This cannot be changed after the resource is created.
Location *string `pulumi:"location"`
// Whether to allow trusted Azure services to access a network restricted registry.
NetworkRuleBypassOptions *string `pulumi:"networkRuleBypassOptions"`
// The network rule set for a container registry.
NetworkRuleSet *NetworkRuleSet `pulumi:"networkRuleSet"`
// The policies for a container registry.
Policies *Policies `pulumi:"policies"`
// Whether or not public network access is allowed for the container registry.
PublicNetworkAccess *string `pulumi:"publicNetworkAccess"`
// The name of the container registry.
RegistryName string `pulumi:"registryName"`
// The name of the resource group to which the container registry belongs.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The SKU of the container registry.
Sku Sku `pulumi:"sku"`
// The properties of the storage account for the container registry. Only applicable to Classic SKU.
StorageAccount *StorageAccountProperties `pulumi:"storageAccount"`
// The tags of the resource.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a Registry resource.
type RegistryArgs struct {
// The value that indicates whether the admin user is enabled.
AdminUserEnabled pulumi.BoolPtrInput
// Enable a single data endpoint per region for serving data.
DataEndpointEnabled pulumi.BoolPtrInput
// The encryption settings of container registry.
Encryption EncryptionPropertyPtrInput
// The identity of the container registry.
Identity IdentityPropertiesPtrInput
// The location of the resource. This cannot be changed after the resource is created.
Location pulumi.StringPtrInput
// Whether to allow trusted Azure services to access a network restricted registry.
NetworkRuleBypassOptions pulumi.StringPtrInput
// The network rule set for a container registry.
NetworkRuleSet NetworkRuleSetPtrInput
// The policies for a container registry.
Policies PoliciesPtrInput
// Whether or not public network access is allowed for the container registry.
PublicNetworkAccess pulumi.StringPtrInput
// The name of the container registry.
RegistryName pulumi.StringInput
// The name of the resource group to which the container registry belongs.
ResourceGroupName pulumi.StringInput
// The SKU of the container registry.
Sku SkuInput
// The properties of the storage account for the container registry. Only applicable to Classic SKU.
StorageAccount StorageAccountPropertiesPtrInput
// The tags of the resource.
Tags pulumi.StringMapInput
}
func (RegistryArgs) ElementType() reflect.Type {
return reflect.TypeOf((*registryArgs)(nil)).Elem()
}
type RegistryInput interface {
pulumi.Input
ToRegistryOutput() RegistryOutput
ToRegistryOutputWithContext(ctx context.Context) RegistryOutput
}
func (*Registry) ElementType() reflect.Type {
return reflect.TypeOf((*Registry)(nil))
}
func (i *Registry) ToRegistryOutput() RegistryOutput {
return i.ToRegistryOutputWithContext(context.Background())
}
func (i *Registry) ToRegistryOutputWithContext(ctx context.Context) RegistryOutput {
return pulumi.ToOutputWithContext(ctx, i).(RegistryOutput)
}
type RegistryOutput struct {
*pulumi.OutputState
}
func (RegistryOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Registry)(nil))
}
func (o RegistryOutput) ToRegistryOutput() RegistryOutput {
return o
}
func (o RegistryOutput) ToRegistryOutputWithContext(ctx context.Context) RegistryOutput {
return o
}
func init() {
pulumi.RegisterOutputType(RegistryOutput{})
}