generated from pulumi/pulumi-tf-provider-boilerplate
/
instancePrivateNic.go
167 lines (139 loc) · 5.58 KB
/
instancePrivateNic.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
// 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 scaleway
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type InstancePrivateNic struct {
pulumi.CustomResourceState
// MAC address of the NIC
MacAddress pulumi.StringOutput `pulumi:"macAddress"`
// The private network ID
PrivateNetworkId pulumi.StringOutput `pulumi:"privateNetworkId"`
// The server ID
ServerId pulumi.StringOutput `pulumi:"serverId"`
// The zone you want to attach the resource to
Zone pulumi.StringOutput `pulumi:"zone"`
}
// NewInstancePrivateNic registers a new resource with the given unique name, arguments, and options.
func NewInstancePrivateNic(ctx *pulumi.Context,
name string, args *InstancePrivateNicArgs, opts ...pulumi.ResourceOption) (*InstancePrivateNic, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.PrivateNetworkId == nil {
return nil, errors.New("invalid value for required argument 'PrivateNetworkId'")
}
if args.ServerId == nil {
return nil, errors.New("invalid value for required argument 'ServerId'")
}
opts = pkgResourceDefaultOpts(opts)
var resource InstancePrivateNic
err := ctx.RegisterResource("scaleway:index/instancePrivateNic:InstancePrivateNic", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetInstancePrivateNic gets an existing InstancePrivateNic 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 GetInstancePrivateNic(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *InstancePrivateNicState, opts ...pulumi.ResourceOption) (*InstancePrivateNic, error) {
var resource InstancePrivateNic
err := ctx.ReadResource("scaleway:index/instancePrivateNic:InstancePrivateNic", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering InstancePrivateNic resources.
type instancePrivateNicState struct {
// MAC address of the NIC
MacAddress *string `pulumi:"macAddress"`
// The private network ID
PrivateNetworkId *string `pulumi:"privateNetworkId"`
// The server ID
ServerId *string `pulumi:"serverId"`
// The zone you want to attach the resource to
Zone *string `pulumi:"zone"`
}
type InstancePrivateNicState struct {
// MAC address of the NIC
MacAddress pulumi.StringPtrInput
// The private network ID
PrivateNetworkId pulumi.StringPtrInput
// The server ID
ServerId pulumi.StringPtrInput
// The zone you want to attach the resource to
Zone pulumi.StringPtrInput
}
func (InstancePrivateNicState) ElementType() reflect.Type {
return reflect.TypeOf((*instancePrivateNicState)(nil)).Elem()
}
type instancePrivateNicArgs struct {
// The private network ID
PrivateNetworkId string `pulumi:"privateNetworkId"`
// The server ID
ServerId string `pulumi:"serverId"`
// The zone you want to attach the resource to
Zone *string `pulumi:"zone"`
}
// The set of arguments for constructing a InstancePrivateNic resource.
type InstancePrivateNicArgs struct {
// The private network ID
PrivateNetworkId pulumi.StringInput
// The server ID
ServerId pulumi.StringInput
// The zone you want to attach the resource to
Zone pulumi.StringPtrInput
}
func (InstancePrivateNicArgs) ElementType() reflect.Type {
return reflect.TypeOf((*instancePrivateNicArgs)(nil)).Elem()
}
type InstancePrivateNicInput interface {
pulumi.Input
ToInstancePrivateNicOutput() InstancePrivateNicOutput
ToInstancePrivateNicOutputWithContext(ctx context.Context) InstancePrivateNicOutput
}
func (*InstancePrivateNic) ElementType() reflect.Type {
return reflect.TypeOf((**InstancePrivateNic)(nil)).Elem()
}
func (i *InstancePrivateNic) ToInstancePrivateNicOutput() InstancePrivateNicOutput {
return i.ToInstancePrivateNicOutputWithContext(context.Background())
}
func (i *InstancePrivateNic) ToInstancePrivateNicOutputWithContext(ctx context.Context) InstancePrivateNicOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstancePrivateNicOutput)
}
type InstancePrivateNicOutput struct{ *pulumi.OutputState }
func (InstancePrivateNicOutput) ElementType() reflect.Type {
return reflect.TypeOf((**InstancePrivateNic)(nil)).Elem()
}
func (o InstancePrivateNicOutput) ToInstancePrivateNicOutput() InstancePrivateNicOutput {
return o
}
func (o InstancePrivateNicOutput) ToInstancePrivateNicOutputWithContext(ctx context.Context) InstancePrivateNicOutput {
return o
}
// MAC address of the NIC
func (o InstancePrivateNicOutput) MacAddress() pulumi.StringOutput {
return o.ApplyT(func(v *InstancePrivateNic) pulumi.StringOutput { return v.MacAddress }).(pulumi.StringOutput)
}
// The private network ID
func (o InstancePrivateNicOutput) PrivateNetworkId() pulumi.StringOutput {
return o.ApplyT(func(v *InstancePrivateNic) pulumi.StringOutput { return v.PrivateNetworkId }).(pulumi.StringOutput)
}
// The server ID
func (o InstancePrivateNicOutput) ServerId() pulumi.StringOutput {
return o.ApplyT(func(v *InstancePrivateNic) pulumi.StringOutput { return v.ServerId }).(pulumi.StringOutput)
}
// The zone you want to attach the resource to
func (o InstancePrivateNicOutput) Zone() pulumi.StringOutput {
return o.ApplyT(func(v *InstancePrivateNic) pulumi.StringOutput { return v.Zone }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*InstancePrivateNicInput)(nil)).Elem(), &InstancePrivateNic{})
pulumi.RegisterOutputType(InstancePrivateNicOutput{})
}