github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/synthetics/canary.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package synthetics 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides a Synthetics Canary resource. 16 // 17 // > **NOTE:** When you create a canary, AWS creates supporting implicit resources. See the Amazon CloudWatch Synthetics documentation on [DeleteCanary](https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DeleteCanary.html) for a full list. Neither AWS nor this provider deletes these implicit resources automatically when the canary is deleted. Before deleting a canary, ensure you have all the information about the canary that you need to delete the implicit resources using the AWS Console, or AWS CLI. 18 // 19 // ## Example Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/synthetics" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // _, err := synthetics.NewCanary(ctx, "some", &synthetics.CanaryArgs{ 35 // Name: pulumi.String("some-canary"), 36 // ArtifactS3Location: pulumi.String("s3://some-bucket/"), 37 // ExecutionRoleArn: pulumi.String("some-role"), 38 // Handler: pulumi.String("exports.handler"), 39 // ZipFile: pulumi.String("test-fixtures/lambdatest.zip"), 40 // RuntimeVersion: pulumi.String("syn-1.0"), 41 // Schedule: &synthetics.CanaryScheduleArgs{ 42 // Expression: pulumi.String("rate(0 minute)"), 43 // }, 44 // }) 45 // if err != nil { 46 // return err 47 // } 48 // return nil 49 // }) 50 // } 51 // 52 // ``` 53 // <!--End PulumiCodeChooser --> 54 // 55 // ## Import 56 // 57 // Using `pulumi import`, import Synthetics Canaries using the `name`. For example: 58 // 59 // ```sh 60 // $ pulumi import aws:synthetics/canary:Canary some some-canary 61 // ``` 62 type Canary struct { 63 pulumi.CustomResourceState 64 65 // Amazon Resource Name (ARN) of the Canary. 66 Arn pulumi.StringOutput `pulumi:"arn"` 67 // configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. See Artifact Config. 68 ArtifactConfig CanaryArtifactConfigPtrOutput `pulumi:"artifactConfig"` 69 // Location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. 70 ArtifactS3Location pulumi.StringOutput `pulumi:"artifactS3Location"` 71 // Specifies whether to also delete the Lambda functions and layers used by this canary. The default is `false`. 72 DeleteLambda pulumi.BoolPtrOutput `pulumi:"deleteLambda"` 73 // ARN of the Lambda function that is used as your canary's engine. 74 EngineArn pulumi.StringOutput `pulumi:"engineArn"` 75 // ARN of the IAM role to be used to run the canary. see [AWS Docs](https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_CreateCanary.html#API_CreateCanary_RequestSyntax) for permissions needs for IAM Role. 76 ExecutionRoleArn pulumi.StringOutput `pulumi:"executionRoleArn"` 77 // Number of days to retain data about failed runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days. 78 FailureRetentionPeriod pulumi.IntPtrOutput `pulumi:"failureRetentionPeriod"` 79 // Entry point to use for the source code when running the canary. This value must end with the string `.handler` . 80 Handler pulumi.StringOutput `pulumi:"handler"` 81 // Name for this canary. Has a maximum length of 21 characters. Valid characters are lowercase alphanumeric, hyphen, or underscore. 82 Name pulumi.StringOutput `pulumi:"name"` 83 // Configuration block for individual canary runs. Detailed below. 84 RunConfig CanaryRunConfigOutput `pulumi:"runConfig"` 85 // Runtime version to use for the canary. Versions change often so consult the [Amazon CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) for the latest valid versions. Values include `syn-python-selenium-1.0`, `syn-nodejs-puppeteer-3.0`, `syn-nodejs-2.2`, `syn-nodejs-2.1`, `syn-nodejs-2.0`, and `syn-1.0`. 86 RuntimeVersion pulumi.StringOutput `pulumi:"runtimeVersion"` 87 // Full bucket name which is used if your canary script is located in S3. The bucket must already exist. **Conflicts with `zipFile`.** 88 S3Bucket pulumi.StringPtrOutput `pulumi:"s3Bucket"` 89 // S3 key of your script. **Conflicts with `zipFile`.** 90 S3Key pulumi.StringPtrOutput `pulumi:"s3Key"` 91 // S3 version ID of your script. **Conflicts with `zipFile`.** 92 S3Version pulumi.StringPtrOutput `pulumi:"s3Version"` 93 // Configuration block providing how often the canary is to run and when these test runs are to stop. Detailed below. 94 // 95 // The following arguments are optional: 96 Schedule CanaryScheduleOutput `pulumi:"schedule"` 97 // ARN of the Lambda layer where Synthetics stores the canary script code. 98 SourceLocationArn pulumi.StringOutput `pulumi:"sourceLocationArn"` 99 // Whether to run or stop the canary. 100 StartCanary pulumi.BoolPtrOutput `pulumi:"startCanary"` 101 // Canary status. 102 Status pulumi.StringOutput `pulumi:"status"` 103 // Number of days to retain data about successful runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days. 104 SuccessRetentionPeriod pulumi.IntPtrOutput `pulumi:"successRetentionPeriod"` 105 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 106 Tags pulumi.StringMapOutput `pulumi:"tags"` 107 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 108 // 109 // Deprecated: Please use `tags` instead. 110 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 111 // Structure that contains information about when the canary was created, modified, and most recently run. see Timeline. 112 Timelines CanaryTimelineArrayOutput `pulumi:"timelines"` 113 // Configuration block. Detailed below. 114 VpcConfig CanaryVpcConfigPtrOutput `pulumi:"vpcConfig"` 115 // ZIP file that contains the script, if you input your canary script directly into the canary instead of referring to an S3 location. It can be up to 225KB. **Conflicts with `s3Bucket`, `s3Key`, and `s3Version`.** 116 ZipFile pulumi.StringPtrOutput `pulumi:"zipFile"` 117 } 118 119 // NewCanary registers a new resource with the given unique name, arguments, and options. 120 func NewCanary(ctx *pulumi.Context, 121 name string, args *CanaryArgs, opts ...pulumi.ResourceOption) (*Canary, error) { 122 if args == nil { 123 return nil, errors.New("missing one or more required arguments") 124 } 125 126 if args.ArtifactS3Location == nil { 127 return nil, errors.New("invalid value for required argument 'ArtifactS3Location'") 128 } 129 if args.ExecutionRoleArn == nil { 130 return nil, errors.New("invalid value for required argument 'ExecutionRoleArn'") 131 } 132 if args.Handler == nil { 133 return nil, errors.New("invalid value for required argument 'Handler'") 134 } 135 if args.RuntimeVersion == nil { 136 return nil, errors.New("invalid value for required argument 'RuntimeVersion'") 137 } 138 if args.Schedule == nil { 139 return nil, errors.New("invalid value for required argument 'Schedule'") 140 } 141 opts = internal.PkgResourceDefaultOpts(opts) 142 var resource Canary 143 err := ctx.RegisterResource("aws:synthetics/canary:Canary", name, args, &resource, opts...) 144 if err != nil { 145 return nil, err 146 } 147 return &resource, nil 148 } 149 150 // GetCanary gets an existing Canary resource's state with the given name, ID, and optional 151 // state properties that are used to uniquely qualify the lookup (nil if not required). 152 func GetCanary(ctx *pulumi.Context, 153 name string, id pulumi.IDInput, state *CanaryState, opts ...pulumi.ResourceOption) (*Canary, error) { 154 var resource Canary 155 err := ctx.ReadResource("aws:synthetics/canary:Canary", name, id, state, &resource, opts...) 156 if err != nil { 157 return nil, err 158 } 159 return &resource, nil 160 } 161 162 // Input properties used for looking up and filtering Canary resources. 163 type canaryState struct { 164 // Amazon Resource Name (ARN) of the Canary. 165 Arn *string `pulumi:"arn"` 166 // configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. See Artifact Config. 167 ArtifactConfig *CanaryArtifactConfig `pulumi:"artifactConfig"` 168 // Location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. 169 ArtifactS3Location *string `pulumi:"artifactS3Location"` 170 // Specifies whether to also delete the Lambda functions and layers used by this canary. The default is `false`. 171 DeleteLambda *bool `pulumi:"deleteLambda"` 172 // ARN of the Lambda function that is used as your canary's engine. 173 EngineArn *string `pulumi:"engineArn"` 174 // ARN of the IAM role to be used to run the canary. see [AWS Docs](https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_CreateCanary.html#API_CreateCanary_RequestSyntax) for permissions needs for IAM Role. 175 ExecutionRoleArn *string `pulumi:"executionRoleArn"` 176 // Number of days to retain data about failed runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days. 177 FailureRetentionPeriod *int `pulumi:"failureRetentionPeriod"` 178 // Entry point to use for the source code when running the canary. This value must end with the string `.handler` . 179 Handler *string `pulumi:"handler"` 180 // Name for this canary. Has a maximum length of 21 characters. Valid characters are lowercase alphanumeric, hyphen, or underscore. 181 Name *string `pulumi:"name"` 182 // Configuration block for individual canary runs. Detailed below. 183 RunConfig *CanaryRunConfig `pulumi:"runConfig"` 184 // Runtime version to use for the canary. Versions change often so consult the [Amazon CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) for the latest valid versions. Values include `syn-python-selenium-1.0`, `syn-nodejs-puppeteer-3.0`, `syn-nodejs-2.2`, `syn-nodejs-2.1`, `syn-nodejs-2.0`, and `syn-1.0`. 185 RuntimeVersion *string `pulumi:"runtimeVersion"` 186 // Full bucket name which is used if your canary script is located in S3. The bucket must already exist. **Conflicts with `zipFile`.** 187 S3Bucket *string `pulumi:"s3Bucket"` 188 // S3 key of your script. **Conflicts with `zipFile`.** 189 S3Key *string `pulumi:"s3Key"` 190 // S3 version ID of your script. **Conflicts with `zipFile`.** 191 S3Version *string `pulumi:"s3Version"` 192 // Configuration block providing how often the canary is to run and when these test runs are to stop. Detailed below. 193 // 194 // The following arguments are optional: 195 Schedule *CanarySchedule `pulumi:"schedule"` 196 // ARN of the Lambda layer where Synthetics stores the canary script code. 197 SourceLocationArn *string `pulumi:"sourceLocationArn"` 198 // Whether to run or stop the canary. 199 StartCanary *bool `pulumi:"startCanary"` 200 // Canary status. 201 Status *string `pulumi:"status"` 202 // Number of days to retain data about successful runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days. 203 SuccessRetentionPeriod *int `pulumi:"successRetentionPeriod"` 204 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 205 Tags map[string]string `pulumi:"tags"` 206 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 207 // 208 // Deprecated: Please use `tags` instead. 209 TagsAll map[string]string `pulumi:"tagsAll"` 210 // Structure that contains information about when the canary was created, modified, and most recently run. see Timeline. 211 Timelines []CanaryTimeline `pulumi:"timelines"` 212 // Configuration block. Detailed below. 213 VpcConfig *CanaryVpcConfig `pulumi:"vpcConfig"` 214 // ZIP file that contains the script, if you input your canary script directly into the canary instead of referring to an S3 location. It can be up to 225KB. **Conflicts with `s3Bucket`, `s3Key`, and `s3Version`.** 215 ZipFile *string `pulumi:"zipFile"` 216 } 217 218 type CanaryState struct { 219 // Amazon Resource Name (ARN) of the Canary. 220 Arn pulumi.StringPtrInput 221 // configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. See Artifact Config. 222 ArtifactConfig CanaryArtifactConfigPtrInput 223 // Location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. 224 ArtifactS3Location pulumi.StringPtrInput 225 // Specifies whether to also delete the Lambda functions and layers used by this canary. The default is `false`. 226 DeleteLambda pulumi.BoolPtrInput 227 // ARN of the Lambda function that is used as your canary's engine. 228 EngineArn pulumi.StringPtrInput 229 // ARN of the IAM role to be used to run the canary. see [AWS Docs](https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_CreateCanary.html#API_CreateCanary_RequestSyntax) for permissions needs for IAM Role. 230 ExecutionRoleArn pulumi.StringPtrInput 231 // Number of days to retain data about failed runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days. 232 FailureRetentionPeriod pulumi.IntPtrInput 233 // Entry point to use for the source code when running the canary. This value must end with the string `.handler` . 234 Handler pulumi.StringPtrInput 235 // Name for this canary. Has a maximum length of 21 characters. Valid characters are lowercase alphanumeric, hyphen, or underscore. 236 Name pulumi.StringPtrInput 237 // Configuration block for individual canary runs. Detailed below. 238 RunConfig CanaryRunConfigPtrInput 239 // Runtime version to use for the canary. Versions change often so consult the [Amazon CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) for the latest valid versions. Values include `syn-python-selenium-1.0`, `syn-nodejs-puppeteer-3.0`, `syn-nodejs-2.2`, `syn-nodejs-2.1`, `syn-nodejs-2.0`, and `syn-1.0`. 240 RuntimeVersion pulumi.StringPtrInput 241 // Full bucket name which is used if your canary script is located in S3. The bucket must already exist. **Conflicts with `zipFile`.** 242 S3Bucket pulumi.StringPtrInput 243 // S3 key of your script. **Conflicts with `zipFile`.** 244 S3Key pulumi.StringPtrInput 245 // S3 version ID of your script. **Conflicts with `zipFile`.** 246 S3Version pulumi.StringPtrInput 247 // Configuration block providing how often the canary is to run and when these test runs are to stop. Detailed below. 248 // 249 // The following arguments are optional: 250 Schedule CanarySchedulePtrInput 251 // ARN of the Lambda layer where Synthetics stores the canary script code. 252 SourceLocationArn pulumi.StringPtrInput 253 // Whether to run or stop the canary. 254 StartCanary pulumi.BoolPtrInput 255 // Canary status. 256 Status pulumi.StringPtrInput 257 // Number of days to retain data about successful runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days. 258 SuccessRetentionPeriod pulumi.IntPtrInput 259 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 260 Tags pulumi.StringMapInput 261 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 262 // 263 // Deprecated: Please use `tags` instead. 264 TagsAll pulumi.StringMapInput 265 // Structure that contains information about when the canary was created, modified, and most recently run. see Timeline. 266 Timelines CanaryTimelineArrayInput 267 // Configuration block. Detailed below. 268 VpcConfig CanaryVpcConfigPtrInput 269 // ZIP file that contains the script, if you input your canary script directly into the canary instead of referring to an S3 location. It can be up to 225KB. **Conflicts with `s3Bucket`, `s3Key`, and `s3Version`.** 270 ZipFile pulumi.StringPtrInput 271 } 272 273 func (CanaryState) ElementType() reflect.Type { 274 return reflect.TypeOf((*canaryState)(nil)).Elem() 275 } 276 277 type canaryArgs struct { 278 // configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. See Artifact Config. 279 ArtifactConfig *CanaryArtifactConfig `pulumi:"artifactConfig"` 280 // Location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. 281 ArtifactS3Location string `pulumi:"artifactS3Location"` 282 // Specifies whether to also delete the Lambda functions and layers used by this canary. The default is `false`. 283 DeleteLambda *bool `pulumi:"deleteLambda"` 284 // ARN of the IAM role to be used to run the canary. see [AWS Docs](https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_CreateCanary.html#API_CreateCanary_RequestSyntax) for permissions needs for IAM Role. 285 ExecutionRoleArn string `pulumi:"executionRoleArn"` 286 // Number of days to retain data about failed runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days. 287 FailureRetentionPeriod *int `pulumi:"failureRetentionPeriod"` 288 // Entry point to use for the source code when running the canary. This value must end with the string `.handler` . 289 Handler string `pulumi:"handler"` 290 // Name for this canary. Has a maximum length of 21 characters. Valid characters are lowercase alphanumeric, hyphen, or underscore. 291 Name *string `pulumi:"name"` 292 // Configuration block for individual canary runs. Detailed below. 293 RunConfig *CanaryRunConfig `pulumi:"runConfig"` 294 // Runtime version to use for the canary. Versions change often so consult the [Amazon CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) for the latest valid versions. Values include `syn-python-selenium-1.0`, `syn-nodejs-puppeteer-3.0`, `syn-nodejs-2.2`, `syn-nodejs-2.1`, `syn-nodejs-2.0`, and `syn-1.0`. 295 RuntimeVersion string `pulumi:"runtimeVersion"` 296 // Full bucket name which is used if your canary script is located in S3. The bucket must already exist. **Conflicts with `zipFile`.** 297 S3Bucket *string `pulumi:"s3Bucket"` 298 // S3 key of your script. **Conflicts with `zipFile`.** 299 S3Key *string `pulumi:"s3Key"` 300 // S3 version ID of your script. **Conflicts with `zipFile`.** 301 S3Version *string `pulumi:"s3Version"` 302 // Configuration block providing how often the canary is to run and when these test runs are to stop. Detailed below. 303 // 304 // The following arguments are optional: 305 Schedule CanarySchedule `pulumi:"schedule"` 306 // Whether to run or stop the canary. 307 StartCanary *bool `pulumi:"startCanary"` 308 // Number of days to retain data about successful runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days. 309 SuccessRetentionPeriod *int `pulumi:"successRetentionPeriod"` 310 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 311 Tags map[string]string `pulumi:"tags"` 312 // Configuration block. Detailed below. 313 VpcConfig *CanaryVpcConfig `pulumi:"vpcConfig"` 314 // ZIP file that contains the script, if you input your canary script directly into the canary instead of referring to an S3 location. It can be up to 225KB. **Conflicts with `s3Bucket`, `s3Key`, and `s3Version`.** 315 ZipFile *string `pulumi:"zipFile"` 316 } 317 318 // The set of arguments for constructing a Canary resource. 319 type CanaryArgs struct { 320 // configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. See Artifact Config. 321 ArtifactConfig CanaryArtifactConfigPtrInput 322 // Location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. 323 ArtifactS3Location pulumi.StringInput 324 // Specifies whether to also delete the Lambda functions and layers used by this canary. The default is `false`. 325 DeleteLambda pulumi.BoolPtrInput 326 // ARN of the IAM role to be used to run the canary. see [AWS Docs](https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_CreateCanary.html#API_CreateCanary_RequestSyntax) for permissions needs for IAM Role. 327 ExecutionRoleArn pulumi.StringInput 328 // Number of days to retain data about failed runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days. 329 FailureRetentionPeriod pulumi.IntPtrInput 330 // Entry point to use for the source code when running the canary. This value must end with the string `.handler` . 331 Handler pulumi.StringInput 332 // Name for this canary. Has a maximum length of 21 characters. Valid characters are lowercase alphanumeric, hyphen, or underscore. 333 Name pulumi.StringPtrInput 334 // Configuration block for individual canary runs. Detailed below. 335 RunConfig CanaryRunConfigPtrInput 336 // Runtime version to use for the canary. Versions change often so consult the [Amazon CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) for the latest valid versions. Values include `syn-python-selenium-1.0`, `syn-nodejs-puppeteer-3.0`, `syn-nodejs-2.2`, `syn-nodejs-2.1`, `syn-nodejs-2.0`, and `syn-1.0`. 337 RuntimeVersion pulumi.StringInput 338 // Full bucket name which is used if your canary script is located in S3. The bucket must already exist. **Conflicts with `zipFile`.** 339 S3Bucket pulumi.StringPtrInput 340 // S3 key of your script. **Conflicts with `zipFile`.** 341 S3Key pulumi.StringPtrInput 342 // S3 version ID of your script. **Conflicts with `zipFile`.** 343 S3Version pulumi.StringPtrInput 344 // Configuration block providing how often the canary is to run and when these test runs are to stop. Detailed below. 345 // 346 // The following arguments are optional: 347 Schedule CanaryScheduleInput 348 // Whether to run or stop the canary. 349 StartCanary pulumi.BoolPtrInput 350 // Number of days to retain data about successful runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days. 351 SuccessRetentionPeriod pulumi.IntPtrInput 352 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 353 Tags pulumi.StringMapInput 354 // Configuration block. Detailed below. 355 VpcConfig CanaryVpcConfigPtrInput 356 // ZIP file that contains the script, if you input your canary script directly into the canary instead of referring to an S3 location. It can be up to 225KB. **Conflicts with `s3Bucket`, `s3Key`, and `s3Version`.** 357 ZipFile pulumi.StringPtrInput 358 } 359 360 func (CanaryArgs) ElementType() reflect.Type { 361 return reflect.TypeOf((*canaryArgs)(nil)).Elem() 362 } 363 364 type CanaryInput interface { 365 pulumi.Input 366 367 ToCanaryOutput() CanaryOutput 368 ToCanaryOutputWithContext(ctx context.Context) CanaryOutput 369 } 370 371 func (*Canary) ElementType() reflect.Type { 372 return reflect.TypeOf((**Canary)(nil)).Elem() 373 } 374 375 func (i *Canary) ToCanaryOutput() CanaryOutput { 376 return i.ToCanaryOutputWithContext(context.Background()) 377 } 378 379 func (i *Canary) ToCanaryOutputWithContext(ctx context.Context) CanaryOutput { 380 return pulumi.ToOutputWithContext(ctx, i).(CanaryOutput) 381 } 382 383 // CanaryArrayInput is an input type that accepts CanaryArray and CanaryArrayOutput values. 384 // You can construct a concrete instance of `CanaryArrayInput` via: 385 // 386 // CanaryArray{ CanaryArgs{...} } 387 type CanaryArrayInput interface { 388 pulumi.Input 389 390 ToCanaryArrayOutput() CanaryArrayOutput 391 ToCanaryArrayOutputWithContext(context.Context) CanaryArrayOutput 392 } 393 394 type CanaryArray []CanaryInput 395 396 func (CanaryArray) ElementType() reflect.Type { 397 return reflect.TypeOf((*[]*Canary)(nil)).Elem() 398 } 399 400 func (i CanaryArray) ToCanaryArrayOutput() CanaryArrayOutput { 401 return i.ToCanaryArrayOutputWithContext(context.Background()) 402 } 403 404 func (i CanaryArray) ToCanaryArrayOutputWithContext(ctx context.Context) CanaryArrayOutput { 405 return pulumi.ToOutputWithContext(ctx, i).(CanaryArrayOutput) 406 } 407 408 // CanaryMapInput is an input type that accepts CanaryMap and CanaryMapOutput values. 409 // You can construct a concrete instance of `CanaryMapInput` via: 410 // 411 // CanaryMap{ "key": CanaryArgs{...} } 412 type CanaryMapInput interface { 413 pulumi.Input 414 415 ToCanaryMapOutput() CanaryMapOutput 416 ToCanaryMapOutputWithContext(context.Context) CanaryMapOutput 417 } 418 419 type CanaryMap map[string]CanaryInput 420 421 func (CanaryMap) ElementType() reflect.Type { 422 return reflect.TypeOf((*map[string]*Canary)(nil)).Elem() 423 } 424 425 func (i CanaryMap) ToCanaryMapOutput() CanaryMapOutput { 426 return i.ToCanaryMapOutputWithContext(context.Background()) 427 } 428 429 func (i CanaryMap) ToCanaryMapOutputWithContext(ctx context.Context) CanaryMapOutput { 430 return pulumi.ToOutputWithContext(ctx, i).(CanaryMapOutput) 431 } 432 433 type CanaryOutput struct{ *pulumi.OutputState } 434 435 func (CanaryOutput) ElementType() reflect.Type { 436 return reflect.TypeOf((**Canary)(nil)).Elem() 437 } 438 439 func (o CanaryOutput) ToCanaryOutput() CanaryOutput { 440 return o 441 } 442 443 func (o CanaryOutput) ToCanaryOutputWithContext(ctx context.Context) CanaryOutput { 444 return o 445 } 446 447 // Amazon Resource Name (ARN) of the Canary. 448 func (o CanaryOutput) Arn() pulumi.StringOutput { 449 return o.ApplyT(func(v *Canary) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 450 } 451 452 // configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. See Artifact Config. 453 func (o CanaryOutput) ArtifactConfig() CanaryArtifactConfigPtrOutput { 454 return o.ApplyT(func(v *Canary) CanaryArtifactConfigPtrOutput { return v.ArtifactConfig }).(CanaryArtifactConfigPtrOutput) 455 } 456 457 // Location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. 458 func (o CanaryOutput) ArtifactS3Location() pulumi.StringOutput { 459 return o.ApplyT(func(v *Canary) pulumi.StringOutput { return v.ArtifactS3Location }).(pulumi.StringOutput) 460 } 461 462 // Specifies whether to also delete the Lambda functions and layers used by this canary. The default is `false`. 463 func (o CanaryOutput) DeleteLambda() pulumi.BoolPtrOutput { 464 return o.ApplyT(func(v *Canary) pulumi.BoolPtrOutput { return v.DeleteLambda }).(pulumi.BoolPtrOutput) 465 } 466 467 // ARN of the Lambda function that is used as your canary's engine. 468 func (o CanaryOutput) EngineArn() pulumi.StringOutput { 469 return o.ApplyT(func(v *Canary) pulumi.StringOutput { return v.EngineArn }).(pulumi.StringOutput) 470 } 471 472 // ARN of the IAM role to be used to run the canary. see [AWS Docs](https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_CreateCanary.html#API_CreateCanary_RequestSyntax) for permissions needs for IAM Role. 473 func (o CanaryOutput) ExecutionRoleArn() pulumi.StringOutput { 474 return o.ApplyT(func(v *Canary) pulumi.StringOutput { return v.ExecutionRoleArn }).(pulumi.StringOutput) 475 } 476 477 // Number of days to retain data about failed runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days. 478 func (o CanaryOutput) FailureRetentionPeriod() pulumi.IntPtrOutput { 479 return o.ApplyT(func(v *Canary) pulumi.IntPtrOutput { return v.FailureRetentionPeriod }).(pulumi.IntPtrOutput) 480 } 481 482 // Entry point to use for the source code when running the canary. This value must end with the string `.handler` . 483 func (o CanaryOutput) Handler() pulumi.StringOutput { 484 return o.ApplyT(func(v *Canary) pulumi.StringOutput { return v.Handler }).(pulumi.StringOutput) 485 } 486 487 // Name for this canary. Has a maximum length of 21 characters. Valid characters are lowercase alphanumeric, hyphen, or underscore. 488 func (o CanaryOutput) Name() pulumi.StringOutput { 489 return o.ApplyT(func(v *Canary) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 490 } 491 492 // Configuration block for individual canary runs. Detailed below. 493 func (o CanaryOutput) RunConfig() CanaryRunConfigOutput { 494 return o.ApplyT(func(v *Canary) CanaryRunConfigOutput { return v.RunConfig }).(CanaryRunConfigOutput) 495 } 496 497 // Runtime version to use for the canary. Versions change often so consult the [Amazon CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) for the latest valid versions. Values include `syn-python-selenium-1.0`, `syn-nodejs-puppeteer-3.0`, `syn-nodejs-2.2`, `syn-nodejs-2.1`, `syn-nodejs-2.0`, and `syn-1.0`. 498 func (o CanaryOutput) RuntimeVersion() pulumi.StringOutput { 499 return o.ApplyT(func(v *Canary) pulumi.StringOutput { return v.RuntimeVersion }).(pulumi.StringOutput) 500 } 501 502 // Full bucket name which is used if your canary script is located in S3. The bucket must already exist. **Conflicts with `zipFile`.** 503 func (o CanaryOutput) S3Bucket() pulumi.StringPtrOutput { 504 return o.ApplyT(func(v *Canary) pulumi.StringPtrOutput { return v.S3Bucket }).(pulumi.StringPtrOutput) 505 } 506 507 // S3 key of your script. **Conflicts with `zipFile`.** 508 func (o CanaryOutput) S3Key() pulumi.StringPtrOutput { 509 return o.ApplyT(func(v *Canary) pulumi.StringPtrOutput { return v.S3Key }).(pulumi.StringPtrOutput) 510 } 511 512 // S3 version ID of your script. **Conflicts with `zipFile`.** 513 func (o CanaryOutput) S3Version() pulumi.StringPtrOutput { 514 return o.ApplyT(func(v *Canary) pulumi.StringPtrOutput { return v.S3Version }).(pulumi.StringPtrOutput) 515 } 516 517 // Configuration block providing how often the canary is to run and when these test runs are to stop. Detailed below. 518 // 519 // The following arguments are optional: 520 func (o CanaryOutput) Schedule() CanaryScheduleOutput { 521 return o.ApplyT(func(v *Canary) CanaryScheduleOutput { return v.Schedule }).(CanaryScheduleOutput) 522 } 523 524 // ARN of the Lambda layer where Synthetics stores the canary script code. 525 func (o CanaryOutput) SourceLocationArn() pulumi.StringOutput { 526 return o.ApplyT(func(v *Canary) pulumi.StringOutput { return v.SourceLocationArn }).(pulumi.StringOutput) 527 } 528 529 // Whether to run or stop the canary. 530 func (o CanaryOutput) StartCanary() pulumi.BoolPtrOutput { 531 return o.ApplyT(func(v *Canary) pulumi.BoolPtrOutput { return v.StartCanary }).(pulumi.BoolPtrOutput) 532 } 533 534 // Canary status. 535 func (o CanaryOutput) Status() pulumi.StringOutput { 536 return o.ApplyT(func(v *Canary) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) 537 } 538 539 // Number of days to retain data about successful runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days. 540 func (o CanaryOutput) SuccessRetentionPeriod() pulumi.IntPtrOutput { 541 return o.ApplyT(func(v *Canary) pulumi.IntPtrOutput { return v.SuccessRetentionPeriod }).(pulumi.IntPtrOutput) 542 } 543 544 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 545 func (o CanaryOutput) Tags() pulumi.StringMapOutput { 546 return o.ApplyT(func(v *Canary) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 547 } 548 549 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 550 // 551 // Deprecated: Please use `tags` instead. 552 func (o CanaryOutput) TagsAll() pulumi.StringMapOutput { 553 return o.ApplyT(func(v *Canary) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 554 } 555 556 // Structure that contains information about when the canary was created, modified, and most recently run. see Timeline. 557 func (o CanaryOutput) Timelines() CanaryTimelineArrayOutput { 558 return o.ApplyT(func(v *Canary) CanaryTimelineArrayOutput { return v.Timelines }).(CanaryTimelineArrayOutput) 559 } 560 561 // Configuration block. Detailed below. 562 func (o CanaryOutput) VpcConfig() CanaryVpcConfigPtrOutput { 563 return o.ApplyT(func(v *Canary) CanaryVpcConfigPtrOutput { return v.VpcConfig }).(CanaryVpcConfigPtrOutput) 564 } 565 566 // ZIP file that contains the script, if you input your canary script directly into the canary instead of referring to an S3 location. It can be up to 225KB. **Conflicts with `s3Bucket`, `s3Key`, and `s3Version`.** 567 func (o CanaryOutput) ZipFile() pulumi.StringPtrOutput { 568 return o.ApplyT(func(v *Canary) pulumi.StringPtrOutput { return v.ZipFile }).(pulumi.StringPtrOutput) 569 } 570 571 type CanaryArrayOutput struct{ *pulumi.OutputState } 572 573 func (CanaryArrayOutput) ElementType() reflect.Type { 574 return reflect.TypeOf((*[]*Canary)(nil)).Elem() 575 } 576 577 func (o CanaryArrayOutput) ToCanaryArrayOutput() CanaryArrayOutput { 578 return o 579 } 580 581 func (o CanaryArrayOutput) ToCanaryArrayOutputWithContext(ctx context.Context) CanaryArrayOutput { 582 return o 583 } 584 585 func (o CanaryArrayOutput) Index(i pulumi.IntInput) CanaryOutput { 586 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Canary { 587 return vs[0].([]*Canary)[vs[1].(int)] 588 }).(CanaryOutput) 589 } 590 591 type CanaryMapOutput struct{ *pulumi.OutputState } 592 593 func (CanaryMapOutput) ElementType() reflect.Type { 594 return reflect.TypeOf((*map[string]*Canary)(nil)).Elem() 595 } 596 597 func (o CanaryMapOutput) ToCanaryMapOutput() CanaryMapOutput { 598 return o 599 } 600 601 func (o CanaryMapOutput) ToCanaryMapOutputWithContext(ctx context.Context) CanaryMapOutput { 602 return o 603 } 604 605 func (o CanaryMapOutput) MapIndex(k pulumi.StringInput) CanaryOutput { 606 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Canary { 607 return vs[0].(map[string]*Canary)[vs[1].(string)] 608 }).(CanaryOutput) 609 } 610 611 func init() { 612 pulumi.RegisterInputType(reflect.TypeOf((*CanaryInput)(nil)).Elem(), &Canary{}) 613 pulumi.RegisterInputType(reflect.TypeOf((*CanaryArrayInput)(nil)).Elem(), CanaryArray{}) 614 pulumi.RegisterInputType(reflect.TypeOf((*CanaryMapInput)(nil)).Elem(), CanaryMap{}) 615 pulumi.RegisterOutputType(CanaryOutput{}) 616 pulumi.RegisterOutputType(CanaryArrayOutput{}) 617 pulumi.RegisterOutputType(CanaryMapOutput{}) 618 }