-
Notifications
You must be signed in to change notification settings - Fork 51
/
analyticsWorkspaceLinkedService.go
143 lines (129 loc) · 9.52 KB
/
analyticsWorkspaceLinkedService.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
// *** 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 operationalinsights
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Links a Log Analytics (formally Operational Insights) Workspace to another resource. The (currently) only linkable service is an Azure Automation Account.
//
// > **NOTE:** This resource has been deprecated in favour of the `loganalytics.LinkedService` 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/log_analytics_workspace_linked_service.html.markdown.
type AnalyticsWorkspaceLinkedService struct {
pulumi.CustomResourceState
// Name of the type of linkedServices resource to connect to the Log Analytics Workspace specified in `workspaceName`. Currently it defaults to and only supports `automation` as a value. Changing this forces a new resource to be created.
LinkedServiceName pulumi.StringPtrOutput `pulumi:"linkedServiceName"`
// A `linkedServiceProperties` block as defined below.
LinkedServiceProperties AnalyticsWorkspaceLinkedServiceLinkedServicePropertiesOutput `pulumi:"linkedServiceProperties"`
// The automatically generated name of the Linked Service. This cannot be specified. The format is always `<workspace_name>/<linked_service_name>` e.g. `workspace1/Automation`
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group in which the Log Analytics Linked Service is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The resource id of the resource that will be linked to the workspace. This field has been deprecated in favour of the top-level `resourceId` field and will be removed in v2.0 of the AzureRM Provider.
ResourceId pulumi.StringOutput `pulumi:"resourceId"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Name of the Log Analytics Workspace that will contain the linkedServices resource. Changing this forces a new resource to be created.
WorkspaceName pulumi.StringOutput `pulumi:"workspaceName"`
}
// NewAnalyticsWorkspaceLinkedService registers a new resource with the given unique name, arguments, and options.
func NewAnalyticsWorkspaceLinkedService(ctx *pulumi.Context,
name string, args *AnalyticsWorkspaceLinkedServiceArgs, opts ...pulumi.ResourceOption) (*AnalyticsWorkspaceLinkedService, error) {
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil || args.WorkspaceName == nil {
return nil, errors.New("missing required argument 'WorkspaceName'")
}
if args == nil {
args = &AnalyticsWorkspaceLinkedServiceArgs{}
}
var resource AnalyticsWorkspaceLinkedService
err := ctx.RegisterResource("azure:operationalinsights/analyticsWorkspaceLinkedService:AnalyticsWorkspaceLinkedService", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAnalyticsWorkspaceLinkedService gets an existing AnalyticsWorkspaceLinkedService 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 GetAnalyticsWorkspaceLinkedService(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AnalyticsWorkspaceLinkedServiceState, opts ...pulumi.ResourceOption) (*AnalyticsWorkspaceLinkedService, error) {
var resource AnalyticsWorkspaceLinkedService
err := ctx.ReadResource("azure:operationalinsights/analyticsWorkspaceLinkedService:AnalyticsWorkspaceLinkedService", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AnalyticsWorkspaceLinkedService resources.
type analyticsWorkspaceLinkedServiceState struct {
// Name of the type of linkedServices resource to connect to the Log Analytics Workspace specified in `workspaceName`. Currently it defaults to and only supports `automation` as a value. Changing this forces a new resource to be created.
LinkedServiceName *string `pulumi:"linkedServiceName"`
// A `linkedServiceProperties` block as defined below.
LinkedServiceProperties *AnalyticsWorkspaceLinkedServiceLinkedServiceProperties `pulumi:"linkedServiceProperties"`
// The automatically generated name of the Linked Service. This cannot be specified. The format is always `<workspace_name>/<linked_service_name>` e.g. `workspace1/Automation`
Name *string `pulumi:"name"`
// The name of the resource group in which the Log Analytics Linked Service is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The resource id of the resource that will be linked to the workspace. This field has been deprecated in favour of the top-level `resourceId` field and will be removed in v2.0 of the AzureRM Provider.
ResourceId *string `pulumi:"resourceId"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// Name of the Log Analytics Workspace that will contain the linkedServices resource. Changing this forces a new resource to be created.
WorkspaceName *string `pulumi:"workspaceName"`
}
type AnalyticsWorkspaceLinkedServiceState struct {
// Name of the type of linkedServices resource to connect to the Log Analytics Workspace specified in `workspaceName`. Currently it defaults to and only supports `automation` as a value. Changing this forces a new resource to be created.
LinkedServiceName pulumi.StringPtrInput
// A `linkedServiceProperties` block as defined below.
LinkedServiceProperties AnalyticsWorkspaceLinkedServiceLinkedServicePropertiesPtrInput
// The automatically generated name of the Linked Service. This cannot be specified. The format is always `<workspace_name>/<linked_service_name>` e.g. `workspace1/Automation`
Name pulumi.StringPtrInput
// The name of the resource group in which the Log Analytics Linked Service is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The resource id of the resource that will be linked to the workspace. This field has been deprecated in favour of the top-level `resourceId` field and will be removed in v2.0 of the AzureRM Provider.
ResourceId pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// Name of the Log Analytics Workspace that will contain the linkedServices resource. Changing this forces a new resource to be created.
WorkspaceName pulumi.StringPtrInput
}
func (AnalyticsWorkspaceLinkedServiceState) ElementType() reflect.Type {
return reflect.TypeOf((*analyticsWorkspaceLinkedServiceState)(nil)).Elem()
}
type analyticsWorkspaceLinkedServiceArgs struct {
// Name of the type of linkedServices resource to connect to the Log Analytics Workspace specified in `workspaceName`. Currently it defaults to and only supports `automation` as a value. Changing this forces a new resource to be created.
LinkedServiceName *string `pulumi:"linkedServiceName"`
// A `linkedServiceProperties` block as defined below.
LinkedServiceProperties *AnalyticsWorkspaceLinkedServiceLinkedServiceProperties `pulumi:"linkedServiceProperties"`
// The name of the resource group in which the Log Analytics Linked Service is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The resource id of the resource that will be linked to the workspace. This field has been deprecated in favour of the top-level `resourceId` field and will be removed in v2.0 of the AzureRM Provider.
ResourceId *string `pulumi:"resourceId"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// Name of the Log Analytics Workspace that will contain the linkedServices resource. Changing this forces a new resource to be created.
WorkspaceName string `pulumi:"workspaceName"`
}
// The set of arguments for constructing a AnalyticsWorkspaceLinkedService resource.
type AnalyticsWorkspaceLinkedServiceArgs struct {
// Name of the type of linkedServices resource to connect to the Log Analytics Workspace specified in `workspaceName`. Currently it defaults to and only supports `automation` as a value. Changing this forces a new resource to be created.
LinkedServiceName pulumi.StringPtrInput
// A `linkedServiceProperties` block as defined below.
LinkedServiceProperties AnalyticsWorkspaceLinkedServiceLinkedServicePropertiesPtrInput
// The name of the resource group in which the Log Analytics Linked Service is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The resource id of the resource that will be linked to the workspace. This field has been deprecated in favour of the top-level `resourceId` field and will be removed in v2.0 of the AzureRM Provider.
ResourceId pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// Name of the Log Analytics Workspace that will contain the linkedServices resource. Changing this forces a new resource to be created.
WorkspaceName pulumi.StringInput
}
func (AnalyticsWorkspaceLinkedServiceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*analyticsWorkspaceLinkedServiceArgs)(nil)).Elem()
}