-
Notifications
You must be signed in to change notification settings - Fork 51
/
analyticsWorkspace.go
174 lines (155 loc) · 7.56 KB
/
analyticsWorkspace.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
163
164
165
166
167
168
169
170
171
172
173
174
// *** 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 operationalinsights
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages a Log Analytics (formally Operational Insights) Workspace.
type AnalyticsWorkspace struct {
s *pulumi.ResourceState
}
// NewAnalyticsWorkspace registers a new resource with the given unique name, arguments, and options.
func NewAnalyticsWorkspace(ctx *pulumi.Context,
name string, args *AnalyticsWorkspaceArgs, opts ...pulumi.ResourceOpt) (*AnalyticsWorkspace, error) {
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil || args.Sku == nil {
return nil, errors.New("missing required argument 'Sku'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["location"] = nil
inputs["name"] = nil
inputs["resourceGroupName"] = nil
inputs["retentionInDays"] = nil
inputs["sku"] = nil
inputs["tags"] = nil
} else {
inputs["location"] = args.Location
inputs["name"] = args.Name
inputs["resourceGroupName"] = args.ResourceGroupName
inputs["retentionInDays"] = args.RetentionInDays
inputs["sku"] = args.Sku
inputs["tags"] = args.Tags
}
inputs["portalUrl"] = nil
inputs["primarySharedKey"] = nil
inputs["secondarySharedKey"] = nil
inputs["workspaceId"] = nil
s, err := ctx.RegisterResource("azure:operationalinsights/analyticsWorkspace:AnalyticsWorkspace", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &AnalyticsWorkspace{s: s}, nil
}
// GetAnalyticsWorkspace gets an existing AnalyticsWorkspace 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 GetAnalyticsWorkspace(ctx *pulumi.Context,
name string, id pulumi.ID, state *AnalyticsWorkspaceState, opts ...pulumi.ResourceOpt) (*AnalyticsWorkspace, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["location"] = state.Location
inputs["name"] = state.Name
inputs["portalUrl"] = state.PortalUrl
inputs["primarySharedKey"] = state.PrimarySharedKey
inputs["resourceGroupName"] = state.ResourceGroupName
inputs["retentionInDays"] = state.RetentionInDays
inputs["secondarySharedKey"] = state.SecondarySharedKey
inputs["sku"] = state.Sku
inputs["tags"] = state.Tags
inputs["workspaceId"] = state.WorkspaceId
}
s, err := ctx.ReadResource("azure:operationalinsights/analyticsWorkspace:AnalyticsWorkspace", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &AnalyticsWorkspace{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *AnalyticsWorkspace) URN() *pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *AnalyticsWorkspace) 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 *AnalyticsWorkspace) Location() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["location"])
}
// Specifies the name of the Log Analytics Workspace. Workspace name should include 4-63 letters, digits or '-'. The '-' shouldn't be the first or the last symbol. Changing this forces a new resource to be created.
func (r *AnalyticsWorkspace) Name() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["name"])
}
// The Portal URL for the Log Analytics Workspace.
func (r *AnalyticsWorkspace) PortalUrl() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["portalUrl"])
}
// The Primary shared key for the Log Analytics Workspace.
func (r *AnalyticsWorkspace) PrimarySharedKey() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["primarySharedKey"])
}
// The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created.
func (r *AnalyticsWorkspace) ResourceGroupName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["resourceGroupName"])
}
// The workspace data retention in days. Possible values range between 30 and 730.
func (r *AnalyticsWorkspace) RetentionInDays() *pulumi.IntOutput {
return (*pulumi.IntOutput)(r.s.State["retentionInDays"])
}
// The Secondary shared key for the Log Analytics Workspace.
func (r *AnalyticsWorkspace) SecondarySharedKey() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["secondarySharedKey"])
}
// Specifies the Sku of the Log Analytics Workspace. Possible values are `Free`, `PerNode`, `Premium`, `Standard`, `Standalone`, `Unlimited`, and `PerGB2018` (new Sku as of `2018-04-03`).
func (r *AnalyticsWorkspace) Sku() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["sku"])
}
// A mapping of tags to assign to the resource.
func (r *AnalyticsWorkspace) Tags() *pulumi.MapOutput {
return (*pulumi.MapOutput)(r.s.State["tags"])
}
// The Workspace (or Customer) ID for the Log Analytics Workspace.
func (r *AnalyticsWorkspace) WorkspaceId() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["workspaceId"])
}
// Input properties used for looking up and filtering AnalyticsWorkspace resources.
type AnalyticsWorkspaceState 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 Log Analytics Workspace. Workspace name should include 4-63 letters, digits or '-'. The '-' shouldn't be the first or the last symbol. Changing this forces a new resource to be created.
Name interface{}
// The Portal URL for the Log Analytics Workspace.
PortalUrl interface{}
// The Primary shared key for the Log Analytics Workspace.
PrimarySharedKey interface{}
// The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// The workspace data retention in days. Possible values range between 30 and 730.
RetentionInDays interface{}
// The Secondary shared key for the Log Analytics Workspace.
SecondarySharedKey interface{}
// Specifies the Sku of the Log Analytics Workspace. Possible values are `Free`, `PerNode`, `Premium`, `Standard`, `Standalone`, `Unlimited`, and `PerGB2018` (new Sku as of `2018-04-03`).
Sku interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
// The Workspace (or Customer) ID for the Log Analytics Workspace.
WorkspaceId interface{}
}
// The set of arguments for constructing a AnalyticsWorkspace resource.
type AnalyticsWorkspaceArgs 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 Log Analytics Workspace. Workspace name should include 4-63 letters, digits or '-'. The '-' shouldn't be the first or the last symbol. Changing this forces a new resource to be created.
Name interface{}
// The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// The workspace data retention in days. Possible values range between 30 and 730.
RetentionInDays interface{}
// Specifies the Sku of the Log Analytics Workspace. Possible values are `Free`, `PerNode`, `Premium`, `Standard`, `Standalone`, `Unlimited`, and `PerGB2018` (new Sku as of `2018-04-03`).
Sku interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
}