forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
virtualNetwork.go
247 lines (211 loc) · 9.16 KB
/
virtualNetwork.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devtestlab
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// A virtual network.
// Azure REST API version: 2018-09-15. Prior API version in Azure Native 1.x: 2018-09-15.
//
// Other available API versions: 2016-05-15.
type VirtualNetwork struct {
pulumi.CustomResourceState
// The allowed subnets of the virtual network.
AllowedSubnets SubnetResponseArrayOutput `pulumi:"allowedSubnets"`
// The creation date of the virtual network.
CreatedDate pulumi.StringOutput `pulumi:"createdDate"`
// The description of the virtual network.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The Microsoft.Network resource identifier of the virtual network.
ExternalProviderResourceId pulumi.StringPtrOutput `pulumi:"externalProviderResourceId"`
// The external subnet properties.
ExternalSubnets ExternalSubnetResponseArrayOutput `pulumi:"externalSubnets"`
// The location of the resource.
Location pulumi.StringPtrOutput `pulumi:"location"`
// The name of the resource.
Name pulumi.StringOutput `pulumi:"name"`
// The provisioning status of the resource.
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// The subnet overrides of the virtual network.
SubnetOverrides SubnetOverrideResponseArrayOutput `pulumi:"subnetOverrides"`
// The tags of the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The type of the resource.
Type pulumi.StringOutput `pulumi:"type"`
// The unique immutable identifier of a resource (Guid).
UniqueIdentifier pulumi.StringOutput `pulumi:"uniqueIdentifier"`
}
// NewVirtualNetwork registers a new resource with the given unique name, arguments, and options.
func NewVirtualNetwork(ctx *pulumi.Context,
name string, args *VirtualNetworkArgs, opts ...pulumi.ResourceOption) (*VirtualNetwork, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.LabName == nil {
return nil, errors.New("invalid value for required argument 'LabName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-native:devtestlab/v20150521preview:VirtualNetwork"),
},
{
Type: pulumi.String("azure-native:devtestlab/v20160515:VirtualNetwork"),
},
{
Type: pulumi.String("azure-native:devtestlab/v20180915:VirtualNetwork"),
},
})
opts = append(opts, aliases)
opts = utilities.PkgResourceDefaultOpts(opts)
var resource VirtualNetwork
err := ctx.RegisterResource("azure-native:devtestlab:VirtualNetwork", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetVirtualNetwork gets an existing VirtualNetwork 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 GetVirtualNetwork(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *VirtualNetworkState, opts ...pulumi.ResourceOption) (*VirtualNetwork, error) {
var resource VirtualNetwork
err := ctx.ReadResource("azure-native:devtestlab:VirtualNetwork", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering VirtualNetwork resources.
type virtualNetworkState struct {
}
type VirtualNetworkState struct {
}
func (VirtualNetworkState) ElementType() reflect.Type {
return reflect.TypeOf((*virtualNetworkState)(nil)).Elem()
}
type virtualNetworkArgs struct {
// The allowed subnets of the virtual network.
AllowedSubnets []Subnet `pulumi:"allowedSubnets"`
// The description of the virtual network.
Description *string `pulumi:"description"`
// The Microsoft.Network resource identifier of the virtual network.
ExternalProviderResourceId *string `pulumi:"externalProviderResourceId"`
// The name of the lab.
LabName string `pulumi:"labName"`
// The location of the resource.
Location *string `pulumi:"location"`
// The name of the virtual network.
Name *string `pulumi:"name"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The subnet overrides of the virtual network.
SubnetOverrides []SubnetOverride `pulumi:"subnetOverrides"`
// The tags of the resource.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a VirtualNetwork resource.
type VirtualNetworkArgs struct {
// The allowed subnets of the virtual network.
AllowedSubnets SubnetArrayInput
// The description of the virtual network.
Description pulumi.StringPtrInput
// The Microsoft.Network resource identifier of the virtual network.
ExternalProviderResourceId pulumi.StringPtrInput
// The name of the lab.
LabName pulumi.StringInput
// The location of the resource.
Location pulumi.StringPtrInput
// The name of the virtual network.
Name pulumi.StringPtrInput
// The name of the resource group.
ResourceGroupName pulumi.StringInput
// The subnet overrides of the virtual network.
SubnetOverrides SubnetOverrideArrayInput
// The tags of the resource.
Tags pulumi.StringMapInput
}
func (VirtualNetworkArgs) ElementType() reflect.Type {
return reflect.TypeOf((*virtualNetworkArgs)(nil)).Elem()
}
type VirtualNetworkInput interface {
pulumi.Input
ToVirtualNetworkOutput() VirtualNetworkOutput
ToVirtualNetworkOutputWithContext(ctx context.Context) VirtualNetworkOutput
}
func (*VirtualNetwork) ElementType() reflect.Type {
return reflect.TypeOf((**VirtualNetwork)(nil)).Elem()
}
func (i *VirtualNetwork) ToVirtualNetworkOutput() VirtualNetworkOutput {
return i.ToVirtualNetworkOutputWithContext(context.Background())
}
func (i *VirtualNetwork) ToVirtualNetworkOutputWithContext(ctx context.Context) VirtualNetworkOutput {
return pulumi.ToOutputWithContext(ctx, i).(VirtualNetworkOutput)
}
type VirtualNetworkOutput struct{ *pulumi.OutputState }
func (VirtualNetworkOutput) ElementType() reflect.Type {
return reflect.TypeOf((**VirtualNetwork)(nil)).Elem()
}
func (o VirtualNetworkOutput) ToVirtualNetworkOutput() VirtualNetworkOutput {
return o
}
func (o VirtualNetworkOutput) ToVirtualNetworkOutputWithContext(ctx context.Context) VirtualNetworkOutput {
return o
}
// The allowed subnets of the virtual network.
func (o VirtualNetworkOutput) AllowedSubnets() SubnetResponseArrayOutput {
return o.ApplyT(func(v *VirtualNetwork) SubnetResponseArrayOutput { return v.AllowedSubnets }).(SubnetResponseArrayOutput)
}
// The creation date of the virtual network.
func (o VirtualNetworkOutput) CreatedDate() pulumi.StringOutput {
return o.ApplyT(func(v *VirtualNetwork) pulumi.StringOutput { return v.CreatedDate }).(pulumi.StringOutput)
}
// The description of the virtual network.
func (o VirtualNetworkOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *VirtualNetwork) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The Microsoft.Network resource identifier of the virtual network.
func (o VirtualNetworkOutput) ExternalProviderResourceId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *VirtualNetwork) pulumi.StringPtrOutput { return v.ExternalProviderResourceId }).(pulumi.StringPtrOutput)
}
// The external subnet properties.
func (o VirtualNetworkOutput) ExternalSubnets() ExternalSubnetResponseArrayOutput {
return o.ApplyT(func(v *VirtualNetwork) ExternalSubnetResponseArrayOutput { return v.ExternalSubnets }).(ExternalSubnetResponseArrayOutput)
}
// The location of the resource.
func (o VirtualNetworkOutput) Location() pulumi.StringPtrOutput {
return o.ApplyT(func(v *VirtualNetwork) pulumi.StringPtrOutput { return v.Location }).(pulumi.StringPtrOutput)
}
// The name of the resource.
func (o VirtualNetworkOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *VirtualNetwork) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The provisioning status of the resource.
func (o VirtualNetworkOutput) ProvisioningState() pulumi.StringOutput {
return o.ApplyT(func(v *VirtualNetwork) pulumi.StringOutput { return v.ProvisioningState }).(pulumi.StringOutput)
}
// The subnet overrides of the virtual network.
func (o VirtualNetworkOutput) SubnetOverrides() SubnetOverrideResponseArrayOutput {
return o.ApplyT(func(v *VirtualNetwork) SubnetOverrideResponseArrayOutput { return v.SubnetOverrides }).(SubnetOverrideResponseArrayOutput)
}
// The tags of the resource.
func (o VirtualNetworkOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *VirtualNetwork) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// The type of the resource.
func (o VirtualNetworkOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *VirtualNetwork) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// The unique immutable identifier of a resource (Guid).
func (o VirtualNetworkOutput) UniqueIdentifier() pulumi.StringOutput {
return o.ApplyT(func(v *VirtualNetwork) pulumi.StringOutput { return v.UniqueIdentifier }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(VirtualNetworkOutput{})
}