/
zoneLockdown.go
133 lines (119 loc) · 6.53 KB
/
zoneLockdown.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
// nolint: lll
package cloudflare
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Provides a Cloudflare Zone Lockdown resource. Zone Lockdown allows you to define one or more URLs (with wildcard matching on the domain or path) that will only permit access if the request originates from an IP address that matches a safelist of one or more IP addresses and/or IP ranges.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-cloudflare/blob/master/website/docs/r/zone_lockdown.html.markdown.
type ZoneLockdown struct {
pulumi.CustomResourceState
// A list of IP addresses or IP ranges to match the request against specified in target, value pairs. It's a complex value. See description below. The order of the configuration entries is unimportant.
Configurations ZoneLockdownConfigurationArrayOutput `pulumi:"configurations"`
// A description about the lockdown entry. Typically used as a reminder or explanation for the lockdown.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Boolean of whether this zone lockdown is currently paused. Default: false.
Paused pulumi.BoolPtrOutput `pulumi:"paused"`
Priority pulumi.IntPtrOutput `pulumi:"priority"`
// A list of simple wildcard patterns to match requests against. The order of the urls is unimportant.
Urls pulumi.StringArrayOutput `pulumi:"urls"`
// The DNS zone ID to which the access rule should be added.
ZoneId pulumi.StringOutput `pulumi:"zoneId"`
}
// NewZoneLockdown registers a new resource with the given unique name, arguments, and options.
func NewZoneLockdown(ctx *pulumi.Context,
name string, args *ZoneLockdownArgs, opts ...pulumi.ResourceOption) (*ZoneLockdown, error) {
if args == nil || args.Configurations == nil {
return nil, errors.New("missing required argument 'Configurations'")
}
if args == nil || args.Urls == nil {
return nil, errors.New("missing required argument 'Urls'")
}
if args == nil || args.ZoneId == nil {
return nil, errors.New("missing required argument 'ZoneId'")
}
if args == nil {
args = &ZoneLockdownArgs{}
}
var resource ZoneLockdown
err := ctx.RegisterResource("cloudflare:index/zoneLockdown:ZoneLockdown", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetZoneLockdown gets an existing ZoneLockdown 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 GetZoneLockdown(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ZoneLockdownState, opts ...pulumi.ResourceOption) (*ZoneLockdown, error) {
var resource ZoneLockdown
err := ctx.ReadResource("cloudflare:index/zoneLockdown:ZoneLockdown", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ZoneLockdown resources.
type zoneLockdownState struct {
// A list of IP addresses or IP ranges to match the request against specified in target, value pairs. It's a complex value. See description below. The order of the configuration entries is unimportant.
Configurations []ZoneLockdownConfiguration `pulumi:"configurations"`
// A description about the lockdown entry. Typically used as a reminder or explanation for the lockdown.
Description *string `pulumi:"description"`
// Boolean of whether this zone lockdown is currently paused. Default: false.
Paused *bool `pulumi:"paused"`
Priority *int `pulumi:"priority"`
// A list of simple wildcard patterns to match requests against. The order of the urls is unimportant.
Urls []string `pulumi:"urls"`
// The DNS zone ID to which the access rule should be added.
ZoneId *string `pulumi:"zoneId"`
}
type ZoneLockdownState struct {
// A list of IP addresses or IP ranges to match the request against specified in target, value pairs. It's a complex value. See description below. The order of the configuration entries is unimportant.
Configurations ZoneLockdownConfigurationArrayInput
// A description about the lockdown entry. Typically used as a reminder or explanation for the lockdown.
Description pulumi.StringPtrInput
// Boolean of whether this zone lockdown is currently paused. Default: false.
Paused pulumi.BoolPtrInput
Priority pulumi.IntPtrInput
// A list of simple wildcard patterns to match requests against. The order of the urls is unimportant.
Urls pulumi.StringArrayInput
// The DNS zone ID to which the access rule should be added.
ZoneId pulumi.StringPtrInput
}
func (ZoneLockdownState) ElementType() reflect.Type {
return reflect.TypeOf((*zoneLockdownState)(nil)).Elem()
}
type zoneLockdownArgs struct {
// A list of IP addresses or IP ranges to match the request against specified in target, value pairs. It's a complex value. See description below. The order of the configuration entries is unimportant.
Configurations []ZoneLockdownConfiguration `pulumi:"configurations"`
// A description about the lockdown entry. Typically used as a reminder or explanation for the lockdown.
Description *string `pulumi:"description"`
// Boolean of whether this zone lockdown is currently paused. Default: false.
Paused *bool `pulumi:"paused"`
Priority *int `pulumi:"priority"`
// A list of simple wildcard patterns to match requests against. The order of the urls is unimportant.
Urls []string `pulumi:"urls"`
// The DNS zone ID to which the access rule should be added.
ZoneId string `pulumi:"zoneId"`
}
// The set of arguments for constructing a ZoneLockdown resource.
type ZoneLockdownArgs struct {
// A list of IP addresses or IP ranges to match the request against specified in target, value pairs. It's a complex value. See description below. The order of the configuration entries is unimportant.
Configurations ZoneLockdownConfigurationArrayInput
// A description about the lockdown entry. Typically used as a reminder or explanation for the lockdown.
Description pulumi.StringPtrInput
// Boolean of whether this zone lockdown is currently paused. Default: false.
Paused pulumi.BoolPtrInput
Priority pulumi.IntPtrInput
// A list of simple wildcard patterns to match requests against. The order of the urls is unimportant.
Urls pulumi.StringArrayInput
// The DNS zone ID to which the access rule should be added.
ZoneId pulumi.StringInput
}
func (ZoneLockdownArgs) ElementType() reflect.Type {
return reflect.TypeOf((*zoneLockdownArgs)(nil)).Elem()
}