/
webTest.go
211 lines (198 loc) · 9.19 KB
/
webTest.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
// *** 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 appinsights
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an Application Insights WebTest.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/application_insights_web_test.html.markdown.
type WebTest struct {
pulumi.CustomResourceState
// The ID of the Application Insights component on which the WebTest operates. Changing this forces a new resource to be created.
ApplicationInsightsId pulumi.StringOutput `pulumi:"applicationInsightsId"`
// An XML configuration specification for a WebTest.
Configuration pulumi.StringOutput `pulumi:"configuration"`
// Purpose/user defined descriptive test for this WebTest.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Is the test actively being monitored.
Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
// Interval in seconds between test runs for this WebTest. Default is `300`.
Frequency pulumi.IntPtrOutput `pulumi:"frequency"`
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
GeoLocations pulumi.StringArrayOutput `pulumi:"geoLocations"`
Kind pulumi.StringOutput `pulumi:"kind"`
// The location of the resource group.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the name of the Application Insights WebTest. Changing this forces a
// new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// Allow for retries should this WebTest fail.
RetryEnabled pulumi.BoolPtrOutput `pulumi:"retryEnabled"`
SyntheticMonitorId pulumi.StringOutput `pulumi:"syntheticMonitorId"`
// Resource tags.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Seconds until this WebTest will timeout and fail. Default is `30`.
Timeout pulumi.IntPtrOutput `pulumi:"timeout"`
}
// NewWebTest registers a new resource with the given unique name, arguments, and options.
func NewWebTest(ctx *pulumi.Context,
name string, args *WebTestArgs, opts ...pulumi.ResourceOption) (*WebTest, error) {
if args == nil || args.ApplicationInsightsId == nil {
return nil, errors.New("missing required argument 'ApplicationInsightsId'")
}
if args == nil || args.Configuration == nil {
return nil, errors.New("missing required argument 'Configuration'")
}
if args == nil || args.GeoLocations == nil {
return nil, errors.New("missing required argument 'GeoLocations'")
}
if args == nil || args.Kind == nil {
return nil, errors.New("missing required argument 'Kind'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil {
args = &WebTestArgs{}
}
var resource WebTest
err := ctx.RegisterResource("azure:appinsights/webTest:WebTest", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetWebTest gets an existing WebTest 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 GetWebTest(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *WebTestState, opts ...pulumi.ResourceOption) (*WebTest, error) {
var resource WebTest
err := ctx.ReadResource("azure:appinsights/webTest:WebTest", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering WebTest resources.
type webTestState struct {
// The ID of the Application Insights component on which the WebTest operates. Changing this forces a new resource to be created.
ApplicationInsightsId *string `pulumi:"applicationInsightsId"`
// An XML configuration specification for a WebTest.
Configuration *string `pulumi:"configuration"`
// Purpose/user defined descriptive test for this WebTest.
Description *string `pulumi:"description"`
// Is the test actively being monitored.
Enabled *bool `pulumi:"enabled"`
// Interval in seconds between test runs for this WebTest. Default is `300`.
Frequency *int `pulumi:"frequency"`
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
GeoLocations []string `pulumi:"geoLocations"`
Kind *string `pulumi:"kind"`
// The location of the resource group.
Location *string `pulumi:"location"`
// Specifies the name of the Application Insights WebTest. Changing this forces a
// new resource to be created.
Name *string `pulumi:"name"`
ResourceGroupName *string `pulumi:"resourceGroupName"`
// Allow for retries should this WebTest fail.
RetryEnabled *bool `pulumi:"retryEnabled"`
SyntheticMonitorId *string `pulumi:"syntheticMonitorId"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// Seconds until this WebTest will timeout and fail. Default is `30`.
Timeout *int `pulumi:"timeout"`
}
type WebTestState struct {
// The ID of the Application Insights component on which the WebTest operates. Changing this forces a new resource to be created.
ApplicationInsightsId pulumi.StringPtrInput
// An XML configuration specification for a WebTest.
Configuration pulumi.StringPtrInput
// Purpose/user defined descriptive test for this WebTest.
Description pulumi.StringPtrInput
// Is the test actively being monitored.
Enabled pulumi.BoolPtrInput
// Interval in seconds between test runs for this WebTest. Default is `300`.
Frequency pulumi.IntPtrInput
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
GeoLocations pulumi.StringArrayInput
Kind pulumi.StringPtrInput
// The location of the resource group.
Location pulumi.StringPtrInput
// Specifies the name of the Application Insights WebTest. Changing this forces a
// new resource to be created.
Name pulumi.StringPtrInput
ResourceGroupName pulumi.StringPtrInput
// Allow for retries should this WebTest fail.
RetryEnabled pulumi.BoolPtrInput
SyntheticMonitorId pulumi.StringPtrInput
// Resource tags.
Tags pulumi.StringMapInput
// Seconds until this WebTest will timeout and fail. Default is `30`.
Timeout pulumi.IntPtrInput
}
func (WebTestState) ElementType() reflect.Type {
return reflect.TypeOf((*webTestState)(nil)).Elem()
}
type webTestArgs struct {
// The ID of the Application Insights component on which the WebTest operates. Changing this forces a new resource to be created.
ApplicationInsightsId string `pulumi:"applicationInsightsId"`
// An XML configuration specification for a WebTest.
Configuration string `pulumi:"configuration"`
// Purpose/user defined descriptive test for this WebTest.
Description *string `pulumi:"description"`
// Is the test actively being monitored.
Enabled *bool `pulumi:"enabled"`
// Interval in seconds between test runs for this WebTest. Default is `300`.
Frequency *int `pulumi:"frequency"`
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
GeoLocations []string `pulumi:"geoLocations"`
Kind string `pulumi:"kind"`
// The location of the resource group.
Location *string `pulumi:"location"`
// Specifies the name of the Application Insights WebTest. Changing this forces a
// new resource to be created.
Name *string `pulumi:"name"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// Allow for retries should this WebTest fail.
RetryEnabled *bool `pulumi:"retryEnabled"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// Seconds until this WebTest will timeout and fail. Default is `30`.
Timeout *int `pulumi:"timeout"`
}
// The set of arguments for constructing a WebTest resource.
type WebTestArgs struct {
// The ID of the Application Insights component on which the WebTest operates. Changing this forces a new resource to be created.
ApplicationInsightsId pulumi.StringInput
// An XML configuration specification for a WebTest.
Configuration pulumi.StringInput
// Purpose/user defined descriptive test for this WebTest.
Description pulumi.StringPtrInput
// Is the test actively being monitored.
Enabled pulumi.BoolPtrInput
// Interval in seconds between test runs for this WebTest. Default is `300`.
Frequency pulumi.IntPtrInput
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
GeoLocations pulumi.StringArrayInput
Kind pulumi.StringInput
// The location of the resource group.
Location pulumi.StringPtrInput
// Specifies the name of the Application Insights WebTest. Changing this forces a
// new resource to be created.
Name pulumi.StringPtrInput
ResourceGroupName pulumi.StringInput
// Allow for retries should this WebTest fail.
RetryEnabled pulumi.BoolPtrInput
// Resource tags.
Tags pulumi.StringMapInput
// Seconds until this WebTest will timeout and fail. Default is `30`.
Timeout pulumi.IntPtrInput
}
func (WebTestArgs) ElementType() reflect.Type {
return reflect.TypeOf((*webTestArgs)(nil)).Elem()
}