/
hostnameTlsSetting.go
324 lines (272 loc) · 12.5 KB
/
hostnameTlsSetting.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
// 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 cloudflare
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Cloudflare per-hostname TLS setting resource. Used to set TLS settings for hostnames under the specified zone.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := cloudflare.NewHostnameTlsSetting(ctx, "example", &cloudflare.HostnameTlsSettingArgs{
// Hostname: pulumi.String("sub.example.com"),
// Setting: pulumi.String("min_tls_version"),
// Value: pulumi.String("1.2"),
// ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// ```sh
// $ pulumi import cloudflare:index/hostnameTlsSetting:HostnameTlsSetting example <zone_id>/<hostname>/<setting_name>
// ```
type HostnameTlsSetting struct {
pulumi.CustomResourceState
CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
// Hostname that belongs to this zone name. **Modifying this attribute will force creation of a new resource.**
Hostname pulumi.StringOutput `pulumi:"hostname"`
// TLS setting name. **Modifying this attribute will force creation of a new resource.**
Setting pulumi.StringOutput `pulumi:"setting"`
UpdatedAt pulumi.StringOutput `pulumi:"updatedAt"`
// TLS setting value.
Value pulumi.StringOutput `pulumi:"value"`
// The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
ZoneId pulumi.StringOutput `pulumi:"zoneId"`
}
// NewHostnameTlsSetting registers a new resource with the given unique name, arguments, and options.
func NewHostnameTlsSetting(ctx *pulumi.Context,
name string, args *HostnameTlsSettingArgs, opts ...pulumi.ResourceOption) (*HostnameTlsSetting, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Hostname == nil {
return nil, errors.New("invalid value for required argument 'Hostname'")
}
if args.Setting == nil {
return nil, errors.New("invalid value for required argument 'Setting'")
}
if args.Value == nil {
return nil, errors.New("invalid value for required argument 'Value'")
}
if args.ZoneId == nil {
return nil, errors.New("invalid value for required argument 'ZoneId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource HostnameTlsSetting
err := ctx.RegisterResource("cloudflare:index/hostnameTlsSetting:HostnameTlsSetting", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetHostnameTlsSetting gets an existing HostnameTlsSetting 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 GetHostnameTlsSetting(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *HostnameTlsSettingState, opts ...pulumi.ResourceOption) (*HostnameTlsSetting, error) {
var resource HostnameTlsSetting
err := ctx.ReadResource("cloudflare:index/hostnameTlsSetting:HostnameTlsSetting", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering HostnameTlsSetting resources.
type hostnameTlsSettingState struct {
CreatedAt *string `pulumi:"createdAt"`
// Hostname that belongs to this zone name. **Modifying this attribute will force creation of a new resource.**
Hostname *string `pulumi:"hostname"`
// TLS setting name. **Modifying this attribute will force creation of a new resource.**
Setting *string `pulumi:"setting"`
UpdatedAt *string `pulumi:"updatedAt"`
// TLS setting value.
Value *string `pulumi:"value"`
// The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
ZoneId *string `pulumi:"zoneId"`
}
type HostnameTlsSettingState struct {
CreatedAt pulumi.StringPtrInput
// Hostname that belongs to this zone name. **Modifying this attribute will force creation of a new resource.**
Hostname pulumi.StringPtrInput
// TLS setting name. **Modifying this attribute will force creation of a new resource.**
Setting pulumi.StringPtrInput
UpdatedAt pulumi.StringPtrInput
// TLS setting value.
Value pulumi.StringPtrInput
// The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
ZoneId pulumi.StringPtrInput
}
func (HostnameTlsSettingState) ElementType() reflect.Type {
return reflect.TypeOf((*hostnameTlsSettingState)(nil)).Elem()
}
type hostnameTlsSettingArgs struct {
// Hostname that belongs to this zone name. **Modifying this attribute will force creation of a new resource.**
Hostname string `pulumi:"hostname"`
// TLS setting name. **Modifying this attribute will force creation of a new resource.**
Setting string `pulumi:"setting"`
// TLS setting value.
Value string `pulumi:"value"`
// The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
ZoneId string `pulumi:"zoneId"`
}
// The set of arguments for constructing a HostnameTlsSetting resource.
type HostnameTlsSettingArgs struct {
// Hostname that belongs to this zone name. **Modifying this attribute will force creation of a new resource.**
Hostname pulumi.StringInput
// TLS setting name. **Modifying this attribute will force creation of a new resource.**
Setting pulumi.StringInput
// TLS setting value.
Value pulumi.StringInput
// The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
ZoneId pulumi.StringInput
}
func (HostnameTlsSettingArgs) ElementType() reflect.Type {
return reflect.TypeOf((*hostnameTlsSettingArgs)(nil)).Elem()
}
type HostnameTlsSettingInput interface {
pulumi.Input
ToHostnameTlsSettingOutput() HostnameTlsSettingOutput
ToHostnameTlsSettingOutputWithContext(ctx context.Context) HostnameTlsSettingOutput
}
func (*HostnameTlsSetting) ElementType() reflect.Type {
return reflect.TypeOf((**HostnameTlsSetting)(nil)).Elem()
}
func (i *HostnameTlsSetting) ToHostnameTlsSettingOutput() HostnameTlsSettingOutput {
return i.ToHostnameTlsSettingOutputWithContext(context.Background())
}
func (i *HostnameTlsSetting) ToHostnameTlsSettingOutputWithContext(ctx context.Context) HostnameTlsSettingOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostnameTlsSettingOutput)
}
// HostnameTlsSettingArrayInput is an input type that accepts HostnameTlsSettingArray and HostnameTlsSettingArrayOutput values.
// You can construct a concrete instance of `HostnameTlsSettingArrayInput` via:
//
// HostnameTlsSettingArray{ HostnameTlsSettingArgs{...} }
type HostnameTlsSettingArrayInput interface {
pulumi.Input
ToHostnameTlsSettingArrayOutput() HostnameTlsSettingArrayOutput
ToHostnameTlsSettingArrayOutputWithContext(context.Context) HostnameTlsSettingArrayOutput
}
type HostnameTlsSettingArray []HostnameTlsSettingInput
func (HostnameTlsSettingArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*HostnameTlsSetting)(nil)).Elem()
}
func (i HostnameTlsSettingArray) ToHostnameTlsSettingArrayOutput() HostnameTlsSettingArrayOutput {
return i.ToHostnameTlsSettingArrayOutputWithContext(context.Background())
}
func (i HostnameTlsSettingArray) ToHostnameTlsSettingArrayOutputWithContext(ctx context.Context) HostnameTlsSettingArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostnameTlsSettingArrayOutput)
}
// HostnameTlsSettingMapInput is an input type that accepts HostnameTlsSettingMap and HostnameTlsSettingMapOutput values.
// You can construct a concrete instance of `HostnameTlsSettingMapInput` via:
//
// HostnameTlsSettingMap{ "key": HostnameTlsSettingArgs{...} }
type HostnameTlsSettingMapInput interface {
pulumi.Input
ToHostnameTlsSettingMapOutput() HostnameTlsSettingMapOutput
ToHostnameTlsSettingMapOutputWithContext(context.Context) HostnameTlsSettingMapOutput
}
type HostnameTlsSettingMap map[string]HostnameTlsSettingInput
func (HostnameTlsSettingMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*HostnameTlsSetting)(nil)).Elem()
}
func (i HostnameTlsSettingMap) ToHostnameTlsSettingMapOutput() HostnameTlsSettingMapOutput {
return i.ToHostnameTlsSettingMapOutputWithContext(context.Background())
}
func (i HostnameTlsSettingMap) ToHostnameTlsSettingMapOutputWithContext(ctx context.Context) HostnameTlsSettingMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostnameTlsSettingMapOutput)
}
type HostnameTlsSettingOutput struct{ *pulumi.OutputState }
func (HostnameTlsSettingOutput) ElementType() reflect.Type {
return reflect.TypeOf((**HostnameTlsSetting)(nil)).Elem()
}
func (o HostnameTlsSettingOutput) ToHostnameTlsSettingOutput() HostnameTlsSettingOutput {
return o
}
func (o HostnameTlsSettingOutput) ToHostnameTlsSettingOutputWithContext(ctx context.Context) HostnameTlsSettingOutput {
return o
}
func (o HostnameTlsSettingOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v *HostnameTlsSetting) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput)
}
// Hostname that belongs to this zone name. **Modifying this attribute will force creation of a new resource.**
func (o HostnameTlsSettingOutput) Hostname() pulumi.StringOutput {
return o.ApplyT(func(v *HostnameTlsSetting) pulumi.StringOutput { return v.Hostname }).(pulumi.StringOutput)
}
// TLS setting name. **Modifying this attribute will force creation of a new resource.**
func (o HostnameTlsSettingOutput) Setting() pulumi.StringOutput {
return o.ApplyT(func(v *HostnameTlsSetting) pulumi.StringOutput { return v.Setting }).(pulumi.StringOutput)
}
func (o HostnameTlsSettingOutput) UpdatedAt() pulumi.StringOutput {
return o.ApplyT(func(v *HostnameTlsSetting) pulumi.StringOutput { return v.UpdatedAt }).(pulumi.StringOutput)
}
// TLS setting value.
func (o HostnameTlsSettingOutput) Value() pulumi.StringOutput {
return o.ApplyT(func(v *HostnameTlsSetting) pulumi.StringOutput { return v.Value }).(pulumi.StringOutput)
}
// The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
func (o HostnameTlsSettingOutput) ZoneId() pulumi.StringOutput {
return o.ApplyT(func(v *HostnameTlsSetting) pulumi.StringOutput { return v.ZoneId }).(pulumi.StringOutput)
}
type HostnameTlsSettingArrayOutput struct{ *pulumi.OutputState }
func (HostnameTlsSettingArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*HostnameTlsSetting)(nil)).Elem()
}
func (o HostnameTlsSettingArrayOutput) ToHostnameTlsSettingArrayOutput() HostnameTlsSettingArrayOutput {
return o
}
func (o HostnameTlsSettingArrayOutput) ToHostnameTlsSettingArrayOutputWithContext(ctx context.Context) HostnameTlsSettingArrayOutput {
return o
}
func (o HostnameTlsSettingArrayOutput) Index(i pulumi.IntInput) HostnameTlsSettingOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *HostnameTlsSetting {
return vs[0].([]*HostnameTlsSetting)[vs[1].(int)]
}).(HostnameTlsSettingOutput)
}
type HostnameTlsSettingMapOutput struct{ *pulumi.OutputState }
func (HostnameTlsSettingMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*HostnameTlsSetting)(nil)).Elem()
}
func (o HostnameTlsSettingMapOutput) ToHostnameTlsSettingMapOutput() HostnameTlsSettingMapOutput {
return o
}
func (o HostnameTlsSettingMapOutput) ToHostnameTlsSettingMapOutputWithContext(ctx context.Context) HostnameTlsSettingMapOutput {
return o
}
func (o HostnameTlsSettingMapOutput) MapIndex(k pulumi.StringInput) HostnameTlsSettingOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *HostnameTlsSetting {
return vs[0].(map[string]*HostnameTlsSetting)[vs[1].(string)]
}).(HostnameTlsSettingOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*HostnameTlsSettingInput)(nil)).Elem(), &HostnameTlsSetting{})
pulumi.RegisterInputType(reflect.TypeOf((*HostnameTlsSettingArrayInput)(nil)).Elem(), HostnameTlsSettingArray{})
pulumi.RegisterInputType(reflect.TypeOf((*HostnameTlsSettingMapInput)(nil)).Elem(), HostnameTlsSettingMap{})
pulumi.RegisterOutputType(HostnameTlsSettingOutput{})
pulumi.RegisterOutputType(HostnameTlsSettingArrayOutput{})
pulumi.RegisterOutputType(HostnameTlsSettingMapOutput{})
}