-
Notifications
You must be signed in to change notification settings - Fork 51
/
logProfile.go
146 lines (131 loc) · 6.21 KB
/
logProfile.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
// *** 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 a [Log Profile](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-overview-activity-logs#export-the-activity-log-with-a-log-profile). A Log Profile configures how Activity Logs are exported.
//
// > **NOTE:** It's only possible to configure one Log Profile per Subscription. If you are trying to create more than one Log Profile, an error with `StatusCode=409` will occur.
type LogProfile struct {
s *pulumi.ResourceState
}
// NewLogProfile registers a new resource with the given unique name, arguments, and options.
func NewLogProfile(ctx *pulumi.Context,
name string, args *LogProfileArgs, opts ...pulumi.ResourceOpt) (*LogProfile, error) {
if args == nil || args.Categories == nil {
return nil, errors.New("missing required argument 'Categories'")
}
if args == nil || args.Locations == nil {
return nil, errors.New("missing required argument 'Locations'")
}
if args == nil || args.RetentionPolicy == nil {
return nil, errors.New("missing required argument 'RetentionPolicy'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["categories"] = nil
inputs["locations"] = nil
inputs["name"] = nil
inputs["retentionPolicy"] = nil
inputs["servicebusRuleId"] = nil
inputs["storageAccountId"] = nil
} else {
inputs["categories"] = args.Categories
inputs["locations"] = args.Locations
inputs["name"] = args.Name
inputs["retentionPolicy"] = args.RetentionPolicy
inputs["servicebusRuleId"] = args.ServicebusRuleId
inputs["storageAccountId"] = args.StorageAccountId
}
s, err := ctx.RegisterResource("azure:monitoring/logProfile:LogProfile", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &LogProfile{s: s}, nil
}
// GetLogProfile gets an existing LogProfile 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 GetLogProfile(ctx *pulumi.Context,
name string, id pulumi.ID, state *LogProfileState, opts ...pulumi.ResourceOpt) (*LogProfile, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["categories"] = state.Categories
inputs["locations"] = state.Locations
inputs["name"] = state.Name
inputs["retentionPolicy"] = state.RetentionPolicy
inputs["servicebusRuleId"] = state.ServicebusRuleId
inputs["storageAccountId"] = state.StorageAccountId
}
s, err := ctx.ReadResource("azure:monitoring/logProfile:LogProfile", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &LogProfile{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *LogProfile) URN() *pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *LogProfile) ID() *pulumi.IDOutput {
return r.s.ID()
}
// List of categories of the logs.
func (r *LogProfile) Categories() *pulumi.ArrayOutput {
return (*pulumi.ArrayOutput)(r.s.State["categories"])
}
// List of regions for which Activity Log events are stored or streamed.
func (r *LogProfile) Locations() *pulumi.ArrayOutput {
return (*pulumi.ArrayOutput)(r.s.State["locations"])
}
// The name of the Log Profile. Changing this forces a
// new resource to be created.
func (r *LogProfile) Name() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["name"])
}
// A `retention_policy` block as documented below. A retention policy for how long Activity Logs are retained in the storage account.
func (r *LogProfile) RetentionPolicy() *pulumi.Output {
return r.s.State["retentionPolicy"]
}
// The service bus (or event hub) rule ID of the service bus (or event hub) namespace in which the Activity Log is streamed to. At least one of `storage_account_id` or `servicebus_rule_id` must be set.
func (r *LogProfile) ServicebusRuleId() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["servicebusRuleId"])
}
// The resource ID of the storage account in which the Activity Log is stored. At least one of `storage_account_id` or `servicebus_rule_id` must be set.
func (r *LogProfile) StorageAccountId() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["storageAccountId"])
}
// Input properties used for looking up and filtering LogProfile resources.
type LogProfileState struct {
// List of categories of the logs.
Categories interface{}
// List of regions for which Activity Log events are stored or streamed.
Locations interface{}
// The name of the Log Profile. Changing this forces a
// new resource to be created.
Name interface{}
// A `retention_policy` block as documented below. A retention policy for how long Activity Logs are retained in the storage account.
RetentionPolicy interface{}
// The service bus (or event hub) rule ID of the service bus (or event hub) namespace in which the Activity Log is streamed to. At least one of `storage_account_id` or `servicebus_rule_id` must be set.
ServicebusRuleId interface{}
// The resource ID of the storage account in which the Activity Log is stored. At least one of `storage_account_id` or `servicebus_rule_id` must be set.
StorageAccountId interface{}
}
// The set of arguments for constructing a LogProfile resource.
type LogProfileArgs struct {
// List of categories of the logs.
Categories interface{}
// List of regions for which Activity Log events are stored or streamed.
Locations interface{}
// The name of the Log Profile. Changing this forces a
// new resource to be created.
Name interface{}
// A `retention_policy` block as documented below. A retention policy for how long Activity Logs are retained in the storage account.
RetentionPolicy interface{}
// The service bus (or event hub) rule ID of the service bus (or event hub) namespace in which the Activity Log is streamed to. At least one of `storage_account_id` or `servicebus_rule_id` must be set.
ServicebusRuleId interface{}
// The resource ID of the storage account in which the Activity Log is stored. At least one of `storage_account_id` or `servicebus_rule_id` must be set.
StorageAccountId interface{}
}