/
activityLogAlert.go
157 lines (144 loc) · 7 KB
/
activityLogAlert.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
// *** 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 monitoring
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an Activity Log Alert within Azure Monitor.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/monitor_activity_log_alert.html.markdown.
type ActivityLogAlert struct {
pulumi.CustomResourceState
// One or more `action` blocks as defined below.
Actions ActivityLogAlertActionArrayOutput `pulumi:"actions"`
// A `criteria` block as defined below.
Criteria ActivityLogAlertCriteriaOutput `pulumi:"criteria"`
// The description of this activity log alert.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Should this Activity Log Alert be enabled? Defaults to `true`.
Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
// The name of the activity log alert. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group in which to create the activity log alert instance.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The Scope at which the Activity Log should be applied, for example a the Resource ID of a Subscription or a Resource (such as a Storage Account).
Scopes pulumi.StringArrayOutput `pulumi:"scopes"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewActivityLogAlert registers a new resource with the given unique name, arguments, and options.
func NewActivityLogAlert(ctx *pulumi.Context,
name string, args *ActivityLogAlertArgs, opts ...pulumi.ResourceOption) (*ActivityLogAlert, error) {
if args == nil || args.Criteria == nil {
return nil, errors.New("missing required argument 'Criteria'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil || args.Scopes == nil {
return nil, errors.New("missing required argument 'Scopes'")
}
if args == nil {
args = &ActivityLogAlertArgs{}
}
var resource ActivityLogAlert
err := ctx.RegisterResource("azure:monitoring/activityLogAlert:ActivityLogAlert", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetActivityLogAlert gets an existing ActivityLogAlert 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 GetActivityLogAlert(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ActivityLogAlertState, opts ...pulumi.ResourceOption) (*ActivityLogAlert, error) {
var resource ActivityLogAlert
err := ctx.ReadResource("azure:monitoring/activityLogAlert:ActivityLogAlert", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ActivityLogAlert resources.
type activityLogAlertState struct {
// One or more `action` blocks as defined below.
Actions []ActivityLogAlertAction `pulumi:"actions"`
// A `criteria` block as defined below.
Criteria *ActivityLogAlertCriteria `pulumi:"criteria"`
// The description of this activity log alert.
Description *string `pulumi:"description"`
// Should this Activity Log Alert be enabled? Defaults to `true`.
Enabled *bool `pulumi:"enabled"`
// The name of the activity log alert. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which to create the activity log alert instance.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The Scope at which the Activity Log should be applied, for example a the Resource ID of a Subscription or a Resource (such as a Storage Account).
Scopes []string `pulumi:"scopes"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
}
type ActivityLogAlertState struct {
// One or more `action` blocks as defined below.
Actions ActivityLogAlertActionArrayInput
// A `criteria` block as defined below.
Criteria ActivityLogAlertCriteriaPtrInput
// The description of this activity log alert.
Description pulumi.StringPtrInput
// Should this Activity Log Alert be enabled? Defaults to `true`.
Enabled pulumi.BoolPtrInput
// The name of the activity log alert. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which to create the activity log alert instance.
ResourceGroupName pulumi.StringPtrInput
// The Scope at which the Activity Log should be applied, for example a the Resource ID of a Subscription or a Resource (such as a Storage Account).
Scopes pulumi.StringArrayInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
}
func (ActivityLogAlertState) ElementType() reflect.Type {
return reflect.TypeOf((*activityLogAlertState)(nil)).Elem()
}
type activityLogAlertArgs struct {
// One or more `action` blocks as defined below.
Actions []ActivityLogAlertAction `pulumi:"actions"`
// A `criteria` block as defined below.
Criteria ActivityLogAlertCriteria `pulumi:"criteria"`
// The description of this activity log alert.
Description *string `pulumi:"description"`
// Should this Activity Log Alert be enabled? Defaults to `true`.
Enabled *bool `pulumi:"enabled"`
// The name of the activity log alert. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which to create the activity log alert instance.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The Scope at which the Activity Log should be applied, for example a the Resource ID of a Subscription or a Resource (such as a Storage Account).
Scopes []string `pulumi:"scopes"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a ActivityLogAlert resource.
type ActivityLogAlertArgs struct {
// One or more `action` blocks as defined below.
Actions ActivityLogAlertActionArrayInput
// A `criteria` block as defined below.
Criteria ActivityLogAlertCriteriaInput
// The description of this activity log alert.
Description pulumi.StringPtrInput
// Should this Activity Log Alert be enabled? Defaults to `true`.
Enabled pulumi.BoolPtrInput
// The name of the activity log alert. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which to create the activity log alert instance.
ResourceGroupName pulumi.StringInput
// The Scope at which the Activity Log should be applied, for example a the Resource ID of a Subscription or a Resource (such as a Storage Account).
Scopes pulumi.StringArrayInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
}
func (ActivityLogAlertArgs) ElementType() reflect.Type {
return reflect.TypeOf((*activityLogAlertArgs)(nil)).Elem()
}