-
Notifications
You must be signed in to change notification settings - Fork 50
/
plan.go
126 lines (112 loc) · 4.87 KB
/
plan.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
// *** 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! ***
package ddosprotection
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an Azure DDoS Protection Plan.
//
// > **NOTE** Azure only allow `one` DDoS Protection Plan per region.
//
// > **NOTE:** This resource has been deprecated in favour of the `network.DdosProtectionPlan` resource and will be removed in the next major version of the AzureRM Provider. The new resource shares the same fields as this one, and information on migrating across can be found in this guide.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/ddos_protection_plan.html.markdown.
type Plan struct {
s *pulumi.ResourceState
}
// NewPlan registers a new resource with the given unique name, arguments, and options.
func NewPlan(ctx *pulumi.Context,
name string, args *PlanArgs, opts ...pulumi.ResourceOpt) (*Plan, error) {
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["location"] = nil
inputs["name"] = nil
inputs["resourceGroupName"] = nil
inputs["tags"] = nil
} else {
inputs["location"] = args.Location
inputs["name"] = args.Name
inputs["resourceGroupName"] = args.ResourceGroupName
inputs["tags"] = args.Tags
}
inputs["virtualNetworkIds"] = nil
s, err := ctx.RegisterResource("azure:ddosprotection/plan:Plan", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &Plan{s: s}, nil
}
// GetPlan gets an existing Plan 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 GetPlan(ctx *pulumi.Context,
name string, id pulumi.ID, state *PlanState, opts ...pulumi.ResourceOpt) (*Plan, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["location"] = state.Location
inputs["name"] = state.Name
inputs["resourceGroupName"] = state.ResourceGroupName
inputs["tags"] = state.Tags
inputs["virtualNetworkIds"] = state.VirtualNetworkIds
}
s, err := ctx.ReadResource("azure:ddosprotection/plan:Plan", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &Plan{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *Plan) URN() pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *Plan) ID() pulumi.IDOutput {
return r.s.ID()
}
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
func (r *Plan) Location() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["location"])
}
// Specifies the name of the DDoS Protection Plan. Changing this forces a new resource to be created.
func (r *Plan) Name() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["name"])
}
// The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
func (r *Plan) ResourceGroupName() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["resourceGroupName"])
}
// A mapping of tags to assign to the resource.
func (r *Plan) Tags() pulumi.MapOutput {
return (pulumi.MapOutput)(r.s.State["tags"])
}
// The Resource ID list of the Virtual Networks associated with DDoS Protection Plan.
func (r *Plan) VirtualNetworkIds() pulumi.ArrayOutput {
return (pulumi.ArrayOutput)(r.s.State["virtualNetworkIds"])
}
// Input properties used for looking up and filtering Plan resources.
type PlanState struct {
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location interface{}
// Specifies the name of the DDoS Protection Plan. Changing this forces a new resource to be created.
Name interface{}
// The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
// The Resource ID list of the Virtual Networks associated with DDoS Protection Plan.
VirtualNetworkIds interface{}
}
// The set of arguments for constructing a Plan resource.
type PlanArgs struct {
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location interface{}
// Specifies the name of the DDoS Protection Plan. Changing this forces a new resource to be created.
Name interface{}
// The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
}