import * as core from "@terrascript/core"; export interface RunConfigArgs extends core.SchemaArgs { activeTracing?: boolean | core.BooleanOut; environmentVariables?: core.Map | core.MapOut; memoryInMb?: number | core.NumberOut; timeoutInSeconds?: number | core.NumberOut; } export class RunConfig extends core.Schema { @core.attr(Boolean) public activeTracing?: boolean | core.BooleanOut; @core.attr(String, { kind: "map" }) public environmentVariables?: | core.Map | core.MapOut; @core.attr(Number, { computed: true }) public memoryInMb?: number | core.NumberOut; @core.attr(Number) public timeoutInSeconds?: number | core.NumberOut; } export interface TimelineArgs extends core.SchemaArgs { created: string | core.StringOut; lastModified: string | core.StringOut; lastStarted: string | core.StringOut; lastStopped: string | core.StringOut; } export class Timeline extends core.Schema { @core.attr(String, { computed: true }) public created!: string | core.StringOut; @core.attr(String, { computed: true }) public lastModified!: string | core.StringOut; @core.attr(String, { computed: true }) public lastStarted!: string | core.StringOut; @core.attr(String, { computed: true }) public lastStopped!: string | core.StringOut; } export interface ScheduleArgs extends core.SchemaArgs { durationInSeconds?: number | core.NumberOut; expression: string | core.StringOut; } export class Schedule extends core.Schema { @core.attr(Number) public durationInSeconds?: number | core.NumberOut; @core.attr(String) public expression!: string | core.StringOut; } export interface VpcConfigArgs extends core.SchemaArgs { securityGroupIds?: core.Array | core.ArrayOut; subnetIds?: core.Array | core.ArrayOut; vpcId: string | core.StringOut; } export class VpcConfig extends core.Schema { @core.attr(String, { kind: "array" }) public securityGroupIds?: core.Array | core.ArrayOut; @core.attr(String, { kind: "array" }) public subnetIds?: core.Array | core.ArrayOut; @core.attr(String, { computed: true }) public vpcId!: string | core.StringOut; } export interface S3EncryptionArgs extends core.SchemaArgs { encryptionMode?: string | core.StringOut; kmsKeyArn?: string | core.StringOut; } export class S3Encryption extends core.Schema { @core.attr(String) public encryptionMode?: string | core.StringOut; @core.attr(String) public kmsKeyArn?: string | core.StringOut; } export interface ArtifactConfigArgs extends core.SchemaArgs { s3Encryption?: S3Encryption; } export class ArtifactConfig extends core.Schema { @core.attr(S3Encryption) public s3Encryption?: S3Encryption; } export interface CanaryArgs extends core.ResourceArgs { /** * (Optional) configuration for canary artifacts, including the encryption-at-rest settings for artifac * ts that the canary uploads to Amazon S3. See [Artifact Config](#artifact_config). */ artifactConfig?: ArtifactConfig; /** * (Required) Location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary * . */ artifactS3Location: string | core.StringOut; /** * (Optional) Specifies whether to also delete the Lambda functions and layers used by this canary. Th * e default is `false`. */ deleteLambda?: boolean | core.BooleanOut; /** * (Required) 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 p * ermissions needs for IAM Role. */ executionRoleArn: string | core.StringOut; /** * (Optional) Number of days to retain data about failed runs of this canary. If you omit this field, t * he default of 31 days is used. The valid range is 1 to 455 days. */ failureRetentionPeriod?: number | core.NumberOut; /** * (Required) Entry point to use for the source code when running the canary. This value must end with * the string `.handler` . */ handler: string | core.StringOut; /** * (Required) Name for this canary. Has a maximum length of 21 characters. Valid characters are lowerca * se alphanumeric, hyphen, or underscore. */ name: string | core.StringOut; /** * (Optional) Configuration block for individual canary runs. Detailed below. */ runConfig?: RunConfig; /** * (Required) Runtime version to use for the canary. Versions change often so consult the [Amazon Cloud * Watch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synth * etics_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`. */ runtimeVersion: string | core.StringOut; /** * (Optional) Full bucket name which is used if your canary script is located in S3. The bucket must al * ready exist. Specify the full bucket name including s3:// as the start of the bucket name. **Conflic * ts with `zip_file`.** */ s3Bucket?: string | core.StringOut; /** * (Optional) S3 key of your script. **Conflicts with `zip_file`.** */ s3Key?: string | core.StringOut; /** * (Optional) S3 version ID of your script. **Conflicts with `zip_file`.** */ s3Version?: string | core.StringOut; /** * (Required) Configuration block providing how often the canary is to run and when these test runs ar * e to stop. Detailed below. */ schedule: Schedule; /** * (Optional) Whether to run or stop the canary. */ startCanary?: boolean | core.BooleanOut; /** * (Optional) Number of days to retain data about successful runs of this canary. If you omit this fiel * d, the default of 31 days is used. The valid range is 1 to 455 days. */ successRetentionPeriod?: number | core.NumberOut; /** * (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configurati * on block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configurati * on-block) present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: core.Map | core.MapOut; /** * A map of tags assigned to the resource, including those inherited from the provider [`default_tags` * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags- * configuration-block). */ tagsAll?: core.Map | core.MapOut; /** * (Optional) Configuration block. Detailed below. */ vpcConfig?: VpcConfig; /** * (Optional) ZIP file that contains the script, if you input your canary script directly into the cana * ry instead of referring to an S3 location. It can be up to 5 MB. **Conflicts with `s3_bucket`, `s3_k * ey`, and `s3_version`.** */ zipFile?: string | core.StringOut; } export class Canary extends core.Resource { /** * Amazon Resource Name (ARN) of the Canary. */ @core.attr(String, { computed: true }) public arn!: string | core.StringOut; /** * (Optional) configuration for canary artifacts, including the encryption-at-rest settings for artifac * ts that the canary uploads to Amazon S3. See [Artifact Config](#artifact_config). */ @core.attr(ArtifactConfig) public artifactConfig?: ArtifactConfig; /** * (Required) Location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary * . */ @core.attr(String) public artifactS3Location!: string | core.StringOut; /** * (Optional) Specifies whether to also delete the Lambda functions and layers used by this canary. Th * e default is `false`. */ @core.attr(Boolean) public deleteLambda?: boolean | core.BooleanOut; /** * ARN of the Lambda function that is used as your canary's engine. */ @core.attr(String, { computed: true }) public engineArn!: string | core.StringOut; /** * (Required) 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 p * ermissions needs for IAM Role. */ @core.attr(String) public executionRoleArn!: string | core.StringOut; /** * (Optional) Number of days to retain data about failed runs of this canary. If you omit this field, t * he default of 31 days is used. The valid range is 1 to 455 days. */ @core.attr(Number) public failureRetentionPeriod?: number | core.NumberOut; /** * (Required) Entry point to use for the source code when running the canary. This value must end with * the string `.handler` . */ @core.attr(String) public handler!: string | core.StringOut; /** * Name for this canary. */ @core.attr(String, { computed: true }) public id!: string | core.StringOut; /** * (Required) Name for this canary. Has a maximum length of 21 characters. Valid characters are lowerca * se alphanumeric, hyphen, or underscore. */ @core.attr(String) public name!: string | core.StringOut; /** * (Optional) Configuration block for individual canary runs. Detailed below. */ @core.attr(RunConfig, { computed: true }) public runConfig?: RunConfig; /** * (Required) Runtime version to use for the canary. Versions change often so consult the [Amazon Cloud * Watch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synth * etics_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`. */ @core.attr(String) public runtimeVersion!: string | core.StringOut; /** * (Optional) Full bucket name which is used if your canary script is located in S3. The bucket must al * ready exist. Specify the full bucket name including s3:// as the start of the bucket name. **Conflic * ts with `zip_file`.** */ @core.attr(String) public s3Bucket?: string | core.StringOut; /** * (Optional) S3 key of your script. **Conflicts with `zip_file`.** */ @core.attr(String) public s3Key?: string | core.StringOut; /** * (Optional) S3 version ID of your script. **Conflicts with `zip_file`.** */ @core.attr(String) public s3Version?: string | core.StringOut; /** * (Required) Configuration block providing how often the canary is to run and when these test runs ar * e to stop. Detailed below. */ @core.attr(Schedule) public schedule!: Schedule; /** * ARN of the Lambda layer where Synthetics stores the canary script code. */ @core.attr(String, { computed: true }) public sourceLocationArn!: string | core.StringOut; /** * (Optional) Whether to run or stop the canary. */ @core.attr(Boolean) public startCanary?: boolean | core.BooleanOut; /** * Canary status. */ @core.attr(String, { computed: true }) public status!: string | core.StringOut; /** * (Optional) Number of days to retain data about successful runs of this canary. If you omit this fiel * d, the default of 31 days is used. The valid range is 1 to 455 days. */ @core.attr(Number) public successRetentionPeriod?: number | core.NumberOut; /** * (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configurati * on block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configurati * on-block) present, tags with matching keys will overwrite those defined at the provider-level. */ @core.attr(String, { kind: "map" }) public tags?: core.Map | core.MapOut; /** * A map of tags assigned to the resource, including those inherited from the provider [`default_tags` * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags- * configuration-block). */ @core.attr(String, { computed: true, kind: "map" }) public tagsAll?: core.Map | core.MapOut; /** * Structure that contains information about when the canary was created, modified, and most recently r * un. see [Timeline](#timeline). */ @core.attr(Timeline, { computed: true, kind: "array" }) public timeline!: core.Array | core.ArrayOut; /** * (Optional) Configuration block. Detailed below. */ @core.attr(VpcConfig) public vpcConfig?: VpcConfig; /** * (Optional) ZIP file that contains the script, if you input your canary script directly into the cana * ry instead of referring to an S3 location. It can be up to 5 MB. **Conflicts with `s3_bucket`, `s3_k * ey`, and `s3_version`.** */ @core.attr(String) public zipFile?: string | core.StringOut; constructor(name: string, args?: CanaryArgs) { super(name, "aws_synthetics_canary", args); } public override getNamespace(): string { return "aws_synthetics"; } }