libZSservicesZSamazonka-syntheticsZSamazonka-synthetics
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.Synthetics.CreateCanary

Description

Creates a canary. Canaries are scripts that monitor your endpoints and APIs from the outside-in. Canaries help you check the availability and latency of your web services and troubleshoot anomalies by investigating load time data, screenshots of the UI, logs, and metrics. You can set up a canary to run continuously or just once.

Do not use CreateCanary to modify an existing canary. Use UpdateCanary instead.

To create canaries, you must have the CloudWatchSyntheticsFullAccess policy. If you are creating a new IAM role for the canary, you also need the the iam:CreateRole, iam:CreatePolicy and iam:AttachRolePolicy permissions. For more information, see Necessary Roles and Permissions.

Do not include secrets or proprietary information in your canary names. The canary name makes up part of the Amazon Resource Name (ARN) for the canary, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries.

Synopsis

Creating a Request

data CreateCanary Source #

See: newCreateCanary smart constructor.

Constructors

CreateCanary' 

Fields

  • successRetentionPeriodInDays :: Maybe Natural

    The 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.

  • runConfig :: Maybe CanaryRunConfigInput

    A structure that contains the configuration for individual canary runs, such as timeout value.

  • failureRetentionPeriodInDays :: Maybe Natural

    The 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.

  • artifactConfig :: Maybe ArtifactConfigInput

    A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.

  • vpcConfig :: Maybe VpcConfigInput

    If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint. For more information, see Running a Canary in a VPC.

  • tags :: Maybe (HashMap Text Text)

    A list of key-value pairs to associate with the canary. You can associate as many as 50 tags with a canary.

    Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.

  • name :: Text

    The name for this canary. Be sure to give it a descriptive name that distinguishes it from other canaries in your account.

    Do not include secrets or proprietary information in your canary names. The canary name makes up part of the canary ARN, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries.

  • code :: CanaryCodeInput

    A structure that includes the entry point from which the canary should start running your script. If the script is stored in an S3 bucket, the bucket name, key, and version are also included.

  • artifactS3Location :: Text

    The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. Artifacts include the log file, screenshots, and HAR files. The name of the S3 bucket can't include a period (.).

  • executionRoleArn :: Text

    The ARN of the IAM role to be used to run the canary. This role must already exist, and must include lambda.amazonaws.com as a principal in the trust policy. The role must also have the following permissions:

    • s3:PutObject
    • s3:GetBucketLocation
    • s3:ListAllMyBuckets
    • cloudwatch:PutMetricData
    • logs:CreateLogGroup
    • logs:CreateLogStream
    • logs:PutLogEvents
  • schedule :: CanaryScheduleInput

    A structure that contains information about how often the canary is to run and when these test runs are to stop.

  • runtimeVersion :: Text

    Specifies the runtime version to use for the canary. For a list of valid runtime versions and more information about runtime versions, see Canary Runtime Versions.

Instances

Instances details
Eq CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

Read CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

Show CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

Generic CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

Associated Types

type Rep CreateCanary :: Type -> Type #

NFData CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

Methods

rnf :: CreateCanary -> () #

Hashable CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

ToJSON CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

AWSRequest CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

Associated Types

type AWSResponse CreateCanary #

ToHeaders CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

ToPath CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

ToQuery CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

type Rep CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

type Rep CreateCanary = D1 ('MetaData "CreateCanary" "Amazonka.Synthetics.CreateCanary" "libZSservicesZSamazonka-syntheticsZSamazonka-synthetics" 'False) (C1 ('MetaCons "CreateCanary'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "successRetentionPeriodInDays") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: (S1 ('MetaSel ('Just "runConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe CanaryRunConfigInput)) :*: S1 ('MetaSel ('Just "failureRetentionPeriodInDays") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)))) :*: (S1 ('MetaSel ('Just "artifactConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ArtifactConfigInput)) :*: (S1 ('MetaSel ('Just "vpcConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe VpcConfigInput)) :*: S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (HashMap Text Text)))))) :*: ((S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "code") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CanaryCodeInput) :*: S1 ('MetaSel ('Just "artifactS3Location") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))) :*: (S1 ('MetaSel ('Just "executionRoleArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "schedule") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CanaryScheduleInput) :*: S1 ('MetaSel ('Just "runtimeVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))))
type AWSResponse CreateCanary Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

newCreateCanary Source #

Create a value of CreateCanary with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:successRetentionPeriodInDays:CreateCanary', createCanary_successRetentionPeriodInDays - The 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.

$sel:runConfig:CreateCanary', createCanary_runConfig - A structure that contains the configuration for individual canary runs, such as timeout value.

$sel:failureRetentionPeriodInDays:CreateCanary', createCanary_failureRetentionPeriodInDays - The 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.

$sel:artifactConfig:CreateCanary', createCanary_artifactConfig - A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.

$sel:vpcConfig:CreateCanary', createCanary_vpcConfig - If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint. For more information, see Running a Canary in a VPC.

$sel:tags:CreateCanary', createCanary_tags - A list of key-value pairs to associate with the canary. You can associate as many as 50 tags with a canary.

Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.

$sel:name:CreateCanary', createCanary_name - The name for this canary. Be sure to give it a descriptive name that distinguishes it from other canaries in your account.

Do not include secrets or proprietary information in your canary names. The canary name makes up part of the canary ARN, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries.

$sel:code:CreateCanary', createCanary_code - A structure that includes the entry point from which the canary should start running your script. If the script is stored in an S3 bucket, the bucket name, key, and version are also included.

$sel:artifactS3Location:CreateCanary', createCanary_artifactS3Location - The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. Artifacts include the log file, screenshots, and HAR files. The name of the S3 bucket can't include a period (.).

$sel:executionRoleArn:CreateCanary', createCanary_executionRoleArn - The ARN of the IAM role to be used to run the canary. This role must already exist, and must include lambda.amazonaws.com as a principal in the trust policy. The role must also have the following permissions:

  • s3:PutObject
  • s3:GetBucketLocation
  • s3:ListAllMyBuckets
  • cloudwatch:PutMetricData
  • logs:CreateLogGroup
  • logs:CreateLogStream
  • logs:PutLogEvents

$sel:schedule:CreateCanary', createCanary_schedule - A structure that contains information about how often the canary is to run and when these test runs are to stop.

$sel:runtimeVersion:CreateCanary', createCanary_runtimeVersion - Specifies the runtime version to use for the canary. For a list of valid runtime versions and more information about runtime versions, see Canary Runtime Versions.

Request Lenses

createCanary_successRetentionPeriodInDays :: Lens' CreateCanary (Maybe Natural) Source #

The 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.

createCanary_runConfig :: Lens' CreateCanary (Maybe CanaryRunConfigInput) Source #

A structure that contains the configuration for individual canary runs, such as timeout value.

createCanary_failureRetentionPeriodInDays :: Lens' CreateCanary (Maybe Natural) Source #

The 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.

createCanary_artifactConfig :: Lens' CreateCanary (Maybe ArtifactConfigInput) Source #

A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.

createCanary_vpcConfig :: Lens' CreateCanary (Maybe VpcConfigInput) Source #

If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint. For more information, see Running a Canary in a VPC.

createCanary_tags :: Lens' CreateCanary (Maybe (HashMap Text Text)) Source #

A list of key-value pairs to associate with the canary. You can associate as many as 50 tags with a canary.

Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.

createCanary_name :: Lens' CreateCanary Text Source #

The name for this canary. Be sure to give it a descriptive name that distinguishes it from other canaries in your account.

Do not include secrets or proprietary information in your canary names. The canary name makes up part of the canary ARN, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries.

createCanary_code :: Lens' CreateCanary CanaryCodeInput Source #

A structure that includes the entry point from which the canary should start running your script. If the script is stored in an S3 bucket, the bucket name, key, and version are also included.

createCanary_artifactS3Location :: Lens' CreateCanary Text Source #

The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. Artifacts include the log file, screenshots, and HAR files. The name of the S3 bucket can't include a period (.).

createCanary_executionRoleArn :: Lens' CreateCanary Text Source #

The ARN of the IAM role to be used to run the canary. This role must already exist, and must include lambda.amazonaws.com as a principal in the trust policy. The role must also have the following permissions:

  • s3:PutObject
  • s3:GetBucketLocation
  • s3:ListAllMyBuckets
  • cloudwatch:PutMetricData
  • logs:CreateLogGroup
  • logs:CreateLogStream
  • logs:PutLogEvents

createCanary_schedule :: Lens' CreateCanary CanaryScheduleInput Source #

A structure that contains information about how often the canary is to run and when these test runs are to stop.

createCanary_runtimeVersion :: Lens' CreateCanary Text Source #

Specifies the runtime version to use for the canary. For a list of valid runtime versions and more information about runtime versions, see Canary Runtime Versions.

Destructuring the Response

data CreateCanaryResponse Source #

See: newCreateCanaryResponse smart constructor.

Constructors

CreateCanaryResponse' 

Fields

Instances

Instances details
Eq CreateCanaryResponse Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

Read CreateCanaryResponse Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

Show CreateCanaryResponse Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

Generic CreateCanaryResponse Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

Associated Types

type Rep CreateCanaryResponse :: Type -> Type #

NFData CreateCanaryResponse Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

Methods

rnf :: CreateCanaryResponse -> () #

type Rep CreateCanaryResponse Source # 
Instance details

Defined in Amazonka.Synthetics.CreateCanary

type Rep CreateCanaryResponse = D1 ('MetaData "CreateCanaryResponse" "Amazonka.Synthetics.CreateCanary" "libZSservicesZSamazonka-syntheticsZSamazonka-synthetics" 'False) (C1 ('MetaCons "CreateCanaryResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "canary") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Canary)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newCreateCanaryResponse Source #

Create a value of CreateCanaryResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:canary:CreateCanaryResponse', createCanaryResponse_canary - The full details about the canary you have created.

$sel:httpStatus:CreateCanaryResponse', createCanaryResponse_httpStatus - The response's http status code.

Response Lenses

createCanaryResponse_canary :: Lens' CreateCanaryResponse (Maybe Canary) Source #

The full details about the canary you have created.