1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package types
4
5import (
6	"time"
7)
8
9// This structure contains all information about one canary in your account.
10type Canary struct {
11
12	// The location in Amazon S3 where Synthetics stores artifacts from the runs of
13	// this canary. Artifacts include the log file, screenshots, and HAR files.
14	ArtifactS3Location *string
15
16	// This structure contains information about the canary's Lambda handler and where
17	// its code is stored by CloudWatch Synthetics.
18	Code *CanaryCodeOutput
19
20	// The ARN of the Lambda function that is used as your canary's engine. For more
21	// information about Lambda ARN format, see Resources and Conditions for Lambda
22	// Actions
23	// (https://docs.aws.amazon.com/lambda/latest/dg/lambda-api-permissions-ref.html).
24	EngineArn *string
25
26	// The ARN of the IAM role used to run the canary. This role must include
27	// lambda.amazonaws.com as a principal in the trust policy.
28	ExecutionRoleArn *string
29
30	// The number of days to retain data about failed runs of this canary.
31	FailureRetentionPeriodInDays *int32
32
33	// The unique ID of this canary.
34	Id *string
35
36	// The name of the canary.
37	Name *string
38
39	// A structure that contains information about a canary run.
40	RunConfig *CanaryRunConfigOutput
41
42	// Specifies the runtime version to use for the canary. For more information about
43	// runtime versions, see  Canary Runtime Versions
44	// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html).
45	RuntimeVersion *string
46
47	// A structure that contains information about how often the canary is to run, and
48	// when these runs are to stop.
49	Schedule *CanaryScheduleOutput
50
51	// A structure that contains information about the canary's status.
52	Status *CanaryStatus
53
54	// The number of days to retain data about successful runs of this canary.
55	SuccessRetentionPeriodInDays *int32
56
57	// The list of key-value pairs that are associated with the canary.
58	Tags map[string]string
59
60	// A structure that contains information about when the canary was created,
61	// modified, and most recently run.
62	Timeline *CanaryTimeline
63
64	// If this canary is to test an endpoint in a VPC, this structure contains
65	// information about the subnets and security groups of the VPC endpoint. For more
66	// information, see  Running a Canary in a VPC
67	// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html).
68	VpcConfig *VpcConfigOutput
69}
70
71// Use this structure to input your script code for the canary. This structure
72// contains the Lambda handler with the location where the canary should start
73// running the script. If the script is stored in an S3 bucket, the bucket name,
74// key, and version are also included. If the script was passed into the canary
75// directly, the script code is contained in the value of Zipfile.
76type CanaryCodeInput struct {
77
78	// The entry point to use for the source code when running the canary. This value
79	// must end with the string .handler.
80	//
81	// This member is required.
82	Handler *string
83
84	// If your canary script is located in S3, specify the full bucket name here. The
85	// bucket must already exist. Specify the full bucket name, including s3:// as the
86	// start of the bucket name.
87	S3Bucket *string
88
89	// The S3 key of your script. For more information, see Working with Amazon S3
90	// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingObjects.html).
91	S3Key *string
92
93	// The S3 version ID of your script.
94	S3Version *string
95
96	// If you input your canary script directly into the canary instead of referring to
97	// an S3 location, the value of this parameter is the .zip file that contains the
98	// script. It can be up to 5 MB.
99	ZipFile []byte
100}
101
102// This structure contains information about the canary's Lambda handler and where
103// its code is stored by CloudWatch Synthetics.
104type CanaryCodeOutput struct {
105
106	// The entry point to use for the source code when running the canary.
107	Handler *string
108
109	// The ARN of the Lambda layer where Synthetics stores the canary script code.
110	SourceLocationArn *string
111}
112
113// This structure contains information about the most recent run of a single
114// canary.
115type CanaryLastRun struct {
116
117	// The name of the canary.
118	CanaryName *string
119
120	// The results from this canary's most recent run.
121	LastRun *CanaryRun
122}
123
124// This structure contains the details about one run of one canary.
125type CanaryRun struct {
126
127	// The location where the canary stored artifacts from the run. Artifacts include
128	// the log file, screenshots, and HAR files.
129	ArtifactS3Location *string
130
131	// A unique ID that identifies this canary run.
132	Id *string
133
134	// The name of the canary.
135	Name *string
136
137	// The status of this run.
138	Status *CanaryRunStatus
139
140	// A structure that contains the start and end times of this run.
141	Timeline *CanaryRunTimeline
142}
143
144// A structure that contains input information for a canary run.
145type CanaryRunConfigInput struct {
146
147	// Specifies whether this canary is to use active AWS X-Ray tracing when it runs.
148	// Active tracing enables this canary run to be displayed in the ServiceLens and
149	// X-Ray service maps even if the canary does not hit an endpoint that has X-ray
150	// tracing enabled. Using X-Ray tracing incurs charges. For more information, see
151	// Canaries and X-Ray tracing
152	// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_tracing.html).
153	// You can enable active tracing only for canaries that use version syn-nodejs-2.0
154	// or later for their canary runtime.
155	ActiveTracing *bool
156
157	// Specifies the keys and values to use for any environment variables used in the
158	// canary script. Use the following format: { "key1" : "value1", "key2" : "value2",
159	// ...} Keys must start with a letter and be at least two characters. The total
160	// size of your environment variables cannot exceed 4 KB. You can't specify any
161	// Lambda reserved environment variables as the keys for your environment
162	// variables. For more information about reserved keys, see  Runtime environment
163	// variables
164	// (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime).
165	EnvironmentVariables map[string]string
166
167	// The maximum amount of memory available to the canary while it is running, in MB.
168	// This value must be a multiple of 64.
169	MemoryInMB *int32
170
171	// How long the canary is allowed to run before it must stop. You can't set this
172	// time to be longer than the frequency of the runs of this canary. If you omit
173	// this field, the frequency of the canary is used as this value, up to a maximum
174	// of 14 minutes.
175	TimeoutInSeconds *int32
176}
177
178// A structure that contains information about a canary run.
179type CanaryRunConfigOutput struct {
180
181	// Displays whether this canary run used active AWS X-Ray tracing.
182	ActiveTracing *bool
183
184	// The maximum amount of memory available to the canary while it is running, in MB.
185	// This value must be a multiple of 64.
186	MemoryInMB *int32
187
188	// How long the canary is allowed to run before it must stop.
189	TimeoutInSeconds *int32
190}
191
192// This structure contains the status information about a canary run.
193type CanaryRunStatus struct {
194
195	// The current state of the run.
196	State CanaryRunState
197
198	// If run of the canary failed, this field contains the reason for the error.
199	StateReason *string
200
201	// If this value is CANARY_FAILURE, an exception occurred in the canary code. If
202	// this value is EXECUTION_FAILURE, an exception occurred in CloudWatch Synthetics.
203	StateReasonCode CanaryRunStateReasonCode
204}
205
206// This structure contains the start and end times of a single canary run.
207type CanaryRunTimeline struct {
208
209	// The end time of the run.
210	Completed *time.Time
211
212	// The start time of the run.
213	Started *time.Time
214}
215
216// This structure specifies how often a canary is to make runs and the date and
217// time when it should stop making runs.
218type CanaryScheduleInput struct {
219
220	// A rate expression that defines how often the canary is to run. The syntax is
221	// rate(number unit). unit can be minute, minutes, or hour. For example, rate(1
222	// minute) runs the canary once a minute, rate(10 minutes) runs it once every 10
223	// minutes, and rate(1 hour) runs it once every hour. You can specify a frequency
224	// between rate(1 minute) and rate(1 hour). Specifying rate(0 minute) or rate(0
225	// hour) is a special value that causes the canary to run only once when it is
226	// started.
227	//
228	// This member is required.
229	Expression *string
230
231	// How long, in seconds, for the canary to continue making regular runs according
232	// to the schedule in the Expression value. If you specify 0, the canary continues
233	// making runs until you stop it. If you omit this field, the default of 0 is used.
234	DurationInSeconds *int64
235}
236
237// How long, in seconds, for the canary to continue making regular runs according
238// to the schedule in the Expression value.
239type CanaryScheduleOutput struct {
240
241	// How long, in seconds, for the canary to continue making regular runs after it
242	// was created. The runs are performed according to the schedule in the Expression
243	// value.
244	DurationInSeconds *int64
245
246	// A rate expression that defines how often the canary is to run. The syntax is
247	// rate(number unit). unit can be minute, minutes, or hour. For example, rate(1
248	// minute) runs the canary once a minute, rate(10 minutes) runs it once every 10
249	// minutes, and rate(1 hour) runs it once every hour. Specifying rate(0 minute) or
250	// rate(0 hour) is a special value that causes the canary to run only once when it
251	// is started.
252	Expression *string
253}
254
255// A structure that contains the current state of the canary.
256type CanaryStatus struct {
257
258	// The current state of the canary.
259	State CanaryState
260
261	// If the canary has insufficient permissions to run, this field provides more
262	// details.
263	StateReason *string
264
265	// If the canary cannot run or has failed, this field displays the reason.
266	StateReasonCode CanaryStateReasonCode
267}
268
269// This structure contains information about when the canary was created and
270// modified.
271type CanaryTimeline struct {
272
273	// The date and time the canary was created.
274	Created *time.Time
275
276	// The date and time the canary was most recently modified.
277	LastModified *time.Time
278
279	// The date and time that the canary's most recent run started.
280	LastStarted *time.Time
281
282	// The date and time that the canary's most recent run ended.
283	LastStopped *time.Time
284}
285
286// This structure contains information about one canary runtime version. For more
287// information about runtime versions, see  Canary Runtime Versions
288// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html).
289type RuntimeVersion struct {
290
291	// If this runtime version is deprecated, this value is the date of deprecation.
292	DeprecationDate *time.Time
293
294	// A description of the runtime version, created by Amazon.
295	Description *string
296
297	// The date that the runtime version was released.
298	ReleaseDate *time.Time
299
300	// The name of the runtime version. For a list of valid runtime versions, see
301	// Canary Runtime Versions
302	// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html).
303	VersionName *string
304}
305
306// If this canary is to test an endpoint in a VPC, this structure contains
307// information about the subnets and security groups of the VPC endpoint. For more
308// information, see  Running a Canary in a VPC
309// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html).
310type VpcConfigInput struct {
311
312	// The IDs of the security groups for this canary.
313	SecurityGroupIds []string
314
315	// The IDs of the subnets where this canary is to run.
316	SubnetIds []string
317}
318
319// If this canary is to test an endpoint in a VPC, this structure contains
320// information about the subnets and security groups of the VPC endpoint. For more
321// information, see  Running a Canary in a VPC
322// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html).
323type VpcConfigOutput struct {
324
325	// The IDs of the security groups for this canary.
326	SecurityGroupIds []string
327
328	// The IDs of the subnets where this canary is to run.
329	SubnetIds []string
330
331	// The IDs of the VPC where this canary is to run.
332	VpcId *string
333}
334