-
Notifications
You must be signed in to change notification settings - Fork 51
/
actionGroup.go
162 lines (145 loc) · 6.17 KB
/
actionGroup.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
// *** 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 monitoring
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an Action Group within Azure Monitor.
type ActionGroup struct {
s *pulumi.ResourceState
}
// NewActionGroup registers a new resource with the given unique name, arguments, and options.
func NewActionGroup(ctx *pulumi.Context,
name string, args *ActionGroupArgs, opts ...pulumi.ResourceOpt) (*ActionGroup, error) {
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil || args.ShortName == nil {
return nil, errors.New("missing required argument 'ShortName'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["emailReceivers"] = nil
inputs["enabled"] = nil
inputs["name"] = nil
inputs["resourceGroupName"] = nil
inputs["shortName"] = nil
inputs["smsReceivers"] = nil
inputs["tags"] = nil
inputs["webhookReceivers"] = nil
} else {
inputs["emailReceivers"] = args.EmailReceivers
inputs["enabled"] = args.Enabled
inputs["name"] = args.Name
inputs["resourceGroupName"] = args.ResourceGroupName
inputs["shortName"] = args.ShortName
inputs["smsReceivers"] = args.SmsReceivers
inputs["tags"] = args.Tags
inputs["webhookReceivers"] = args.WebhookReceivers
}
s, err := ctx.RegisterResource("azure:monitoring/actionGroup:ActionGroup", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &ActionGroup{s: s}, nil
}
// GetActionGroup gets an existing ActionGroup 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 GetActionGroup(ctx *pulumi.Context,
name string, id pulumi.ID, state *ActionGroupState, opts ...pulumi.ResourceOpt) (*ActionGroup, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["emailReceivers"] = state.EmailReceivers
inputs["enabled"] = state.Enabled
inputs["name"] = state.Name
inputs["resourceGroupName"] = state.ResourceGroupName
inputs["shortName"] = state.ShortName
inputs["smsReceivers"] = state.SmsReceivers
inputs["tags"] = state.Tags
inputs["webhookReceivers"] = state.WebhookReceivers
}
s, err := ctx.ReadResource("azure:monitoring/actionGroup:ActionGroup", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &ActionGroup{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *ActionGroup) URN() *pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *ActionGroup) ID() *pulumi.IDOutput {
return r.s.ID()
}
// One or more `email_receiver` blocks as defined below.
func (r *ActionGroup) EmailReceivers() *pulumi.ArrayOutput {
return (*pulumi.ArrayOutput)(r.s.State["emailReceivers"])
}
// Whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications. Defaults to `true`.
func (r *ActionGroup) Enabled() *pulumi.BoolOutput {
return (*pulumi.BoolOutput)(r.s.State["enabled"])
}
// The name of the webhook receiver. Names must be unique (case-insensitive) across all receivers within an action group.
func (r *ActionGroup) Name() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["name"])
}
// The name of the resource group in which to create the Action Group instance.
func (r *ActionGroup) ResourceGroupName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["resourceGroupName"])
}
// The short name of the action group. This will be used in SMS messages.
func (r *ActionGroup) ShortName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["shortName"])
}
// One or more `sms_receiver ` blocks as defined below.
func (r *ActionGroup) SmsReceivers() *pulumi.ArrayOutput {
return (*pulumi.ArrayOutput)(r.s.State["smsReceivers"])
}
// A mapping of tags to assign to the resource.
func (r *ActionGroup) Tags() *pulumi.MapOutput {
return (*pulumi.MapOutput)(r.s.State["tags"])
}
// One or more `webhook_receiver ` blocks as defined below.
func (r *ActionGroup) WebhookReceivers() *pulumi.ArrayOutput {
return (*pulumi.ArrayOutput)(r.s.State["webhookReceivers"])
}
// Input properties used for looking up and filtering ActionGroup resources.
type ActionGroupState struct {
// One or more `email_receiver` blocks as defined below.
EmailReceivers interface{}
// Whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications. Defaults to `true`.
Enabled interface{}
// The name of the webhook receiver. Names must be unique (case-insensitive) across all receivers within an action group.
Name interface{}
// The name of the resource group in which to create the Action Group instance.
ResourceGroupName interface{}
// The short name of the action group. This will be used in SMS messages.
ShortName interface{}
// One or more `sms_receiver ` blocks as defined below.
SmsReceivers interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
// One or more `webhook_receiver ` blocks as defined below.
WebhookReceivers interface{}
}
// The set of arguments for constructing a ActionGroup resource.
type ActionGroupArgs struct {
// One or more `email_receiver` blocks as defined below.
EmailReceivers interface{}
// Whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications. Defaults to `true`.
Enabled interface{}
// The name of the webhook receiver. Names must be unique (case-insensitive) across all receivers within an action group.
Name interface{}
// The name of the resource group in which to create the Action Group instance.
ResourceGroupName interface{}
// The short name of the action group. This will be used in SMS messages.
ShortName interface{}
// One or more `sms_receiver ` blocks as defined below.
SmsReceivers interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
// One or more `webhook_receiver ` blocks as defined below.
WebhookReceivers interface{}
}