generated from pulumi/pulumi-tf-provider-boilerplate
/
aclAttachment.go
244 lines (196 loc) · 7.89 KB
/
aclAttachment.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
// 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 vpc
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provide a resource to attach an existing subnet to Network ACL.
//
// ## Import
//
// Acl attachment can be imported using the id, e.g.
//
// ```sh
// $ pulumi import tencentcloud:Vpc/aclAttachment:AclAttachment attachment acl-eotx5qsg#subnet-91x0geu6
// ```
type AclAttachment struct {
pulumi.CustomResourceState
// ID of the attached ACL.
AclId pulumi.StringOutput `pulumi:"aclId"`
// The Subnet instance ID.
SubnetId pulumi.StringOutput `pulumi:"subnetId"`
}
// NewAclAttachment registers a new resource with the given unique name, arguments, and options.
func NewAclAttachment(ctx *pulumi.Context,
name string, args *AclAttachmentArgs, opts ...pulumi.ResourceOption) (*AclAttachment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AclId == nil {
return nil, errors.New("invalid value for required argument 'AclId'")
}
if args.SubnetId == nil {
return nil, errors.New("invalid value for required argument 'SubnetId'")
}
opts = pkgResourceDefaultOpts(opts)
var resource AclAttachment
err := ctx.RegisterResource("tencentcloud:Vpc/aclAttachment:AclAttachment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAclAttachment gets an existing AclAttachment 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 GetAclAttachment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AclAttachmentState, opts ...pulumi.ResourceOption) (*AclAttachment, error) {
var resource AclAttachment
err := ctx.ReadResource("tencentcloud:Vpc/aclAttachment:AclAttachment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AclAttachment resources.
type aclAttachmentState struct {
// ID of the attached ACL.
AclId *string `pulumi:"aclId"`
// The Subnet instance ID.
SubnetId *string `pulumi:"subnetId"`
}
type AclAttachmentState struct {
// ID of the attached ACL.
AclId pulumi.StringPtrInput
// The Subnet instance ID.
SubnetId pulumi.StringPtrInput
}
func (AclAttachmentState) ElementType() reflect.Type {
return reflect.TypeOf((*aclAttachmentState)(nil)).Elem()
}
type aclAttachmentArgs struct {
// ID of the attached ACL.
AclId string `pulumi:"aclId"`
// The Subnet instance ID.
SubnetId string `pulumi:"subnetId"`
}
// The set of arguments for constructing a AclAttachment resource.
type AclAttachmentArgs struct {
// ID of the attached ACL.
AclId pulumi.StringInput
// The Subnet instance ID.
SubnetId pulumi.StringInput
}
func (AclAttachmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*aclAttachmentArgs)(nil)).Elem()
}
type AclAttachmentInput interface {
pulumi.Input
ToAclAttachmentOutput() AclAttachmentOutput
ToAclAttachmentOutputWithContext(ctx context.Context) AclAttachmentOutput
}
func (*AclAttachment) ElementType() reflect.Type {
return reflect.TypeOf((**AclAttachment)(nil)).Elem()
}
func (i *AclAttachment) ToAclAttachmentOutput() AclAttachmentOutput {
return i.ToAclAttachmentOutputWithContext(context.Background())
}
func (i *AclAttachment) ToAclAttachmentOutputWithContext(ctx context.Context) AclAttachmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(AclAttachmentOutput)
}
// AclAttachmentArrayInput is an input type that accepts AclAttachmentArray and AclAttachmentArrayOutput values.
// You can construct a concrete instance of `AclAttachmentArrayInput` via:
//
// AclAttachmentArray{ AclAttachmentArgs{...} }
type AclAttachmentArrayInput interface {
pulumi.Input
ToAclAttachmentArrayOutput() AclAttachmentArrayOutput
ToAclAttachmentArrayOutputWithContext(context.Context) AclAttachmentArrayOutput
}
type AclAttachmentArray []AclAttachmentInput
func (AclAttachmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AclAttachment)(nil)).Elem()
}
func (i AclAttachmentArray) ToAclAttachmentArrayOutput() AclAttachmentArrayOutput {
return i.ToAclAttachmentArrayOutputWithContext(context.Background())
}
func (i AclAttachmentArray) ToAclAttachmentArrayOutputWithContext(ctx context.Context) AclAttachmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AclAttachmentArrayOutput)
}
// AclAttachmentMapInput is an input type that accepts AclAttachmentMap and AclAttachmentMapOutput values.
// You can construct a concrete instance of `AclAttachmentMapInput` via:
//
// AclAttachmentMap{ "key": AclAttachmentArgs{...} }
type AclAttachmentMapInput interface {
pulumi.Input
ToAclAttachmentMapOutput() AclAttachmentMapOutput
ToAclAttachmentMapOutputWithContext(context.Context) AclAttachmentMapOutput
}
type AclAttachmentMap map[string]AclAttachmentInput
func (AclAttachmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AclAttachment)(nil)).Elem()
}
func (i AclAttachmentMap) ToAclAttachmentMapOutput() AclAttachmentMapOutput {
return i.ToAclAttachmentMapOutputWithContext(context.Background())
}
func (i AclAttachmentMap) ToAclAttachmentMapOutputWithContext(ctx context.Context) AclAttachmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AclAttachmentMapOutput)
}
type AclAttachmentOutput struct{ *pulumi.OutputState }
func (AclAttachmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AclAttachment)(nil)).Elem()
}
func (o AclAttachmentOutput) ToAclAttachmentOutput() AclAttachmentOutput {
return o
}
func (o AclAttachmentOutput) ToAclAttachmentOutputWithContext(ctx context.Context) AclAttachmentOutput {
return o
}
// ID of the attached ACL.
func (o AclAttachmentOutput) AclId() pulumi.StringOutput {
return o.ApplyT(func(v *AclAttachment) pulumi.StringOutput { return v.AclId }).(pulumi.StringOutput)
}
// The Subnet instance ID.
func (o AclAttachmentOutput) SubnetId() pulumi.StringOutput {
return o.ApplyT(func(v *AclAttachment) pulumi.StringOutput { return v.SubnetId }).(pulumi.StringOutput)
}
type AclAttachmentArrayOutput struct{ *pulumi.OutputState }
func (AclAttachmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AclAttachment)(nil)).Elem()
}
func (o AclAttachmentArrayOutput) ToAclAttachmentArrayOutput() AclAttachmentArrayOutput {
return o
}
func (o AclAttachmentArrayOutput) ToAclAttachmentArrayOutputWithContext(ctx context.Context) AclAttachmentArrayOutput {
return o
}
func (o AclAttachmentArrayOutput) Index(i pulumi.IntInput) AclAttachmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AclAttachment {
return vs[0].([]*AclAttachment)[vs[1].(int)]
}).(AclAttachmentOutput)
}
type AclAttachmentMapOutput struct{ *pulumi.OutputState }
func (AclAttachmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AclAttachment)(nil)).Elem()
}
func (o AclAttachmentMapOutput) ToAclAttachmentMapOutput() AclAttachmentMapOutput {
return o
}
func (o AclAttachmentMapOutput) ToAclAttachmentMapOutputWithContext(ctx context.Context) AclAttachmentMapOutput {
return o
}
func (o AclAttachmentMapOutput) MapIndex(k pulumi.StringInput) AclAttachmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AclAttachment {
return vs[0].(map[string]*AclAttachment)[vs[1].(string)]
}).(AclAttachmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AclAttachmentInput)(nil)).Elem(), &AclAttachment{})
pulumi.RegisterInputType(reflect.TypeOf((*AclAttachmentArrayInput)(nil)).Elem(), AclAttachmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AclAttachmentMapInput)(nil)).Elem(), AclAttachmentMap{})
pulumi.RegisterOutputType(AclAttachmentOutput{})
pulumi.RegisterOutputType(AclAttachmentArrayOutput{})
pulumi.RegisterOutputType(AclAttachmentMapOutput{})
}