Documentation
¶
Overview ¶
The CDK Construct Library for AWS::Synthetics
Index ¶
- func Canary_IsConstruct(x interface{}) *bool
- func Canary_IsResource(construct constructs.IConstruct) *bool
- func NewAssetCode_Override(a AssetCode, assetPath *string, options *awss3assets.AssetOptions)
- func NewCanary_Override(c Canary, scope constructs.Construct, id *string, props *CanaryProps)
- func NewCode_Override(c Code)
- func NewInlineCode_Override(i InlineCode, code *string)
- func NewRuntime_Override(r Runtime, name *string, family RuntimeFamily)
- func NewS3Code_Override(s S3Code, bucket awss3.IBucket, key *string, objectVersion *string)
- type ArtifactsBucketLocation
- type AssetCode
- func AssetCode_FromAsset(assetPath *string, options *awss3assets.AssetOptions) AssetCode
- func Code_FromAsset(assetPath *string, options *awss3assets.AssetOptions) AssetCode
- func InlineCode_FromAsset(assetPath *string, options *awss3assets.AssetOptions) AssetCode
- func NewAssetCode(assetPath *string, options *awss3assets.AssetOptions) AssetCode
- func S3Code_FromAsset(assetPath *string, options *awss3assets.AssetOptions) AssetCode
- type Canary
- type CanaryProps
- type Code
- type CodeConfig
- type CustomTestOptions
- type InlineCode
- type Runtime
- func NewRuntime(name *string, family RuntimeFamily) Runtime
- func Runtime_SYNTHETICS_1_0() Runtime
- func Runtime_SYNTHETICS_NODEJS_2_0() Runtime
- func Runtime_SYNTHETICS_NODEJS_2_1() Runtime
- func Runtime_SYNTHETICS_NODEJS_2_2() Runtime
- func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_0() Runtime
- func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_1() Runtime
- func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_2() Runtime
- func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_0() Runtime
- type RuntimeFamily
- type S3Code
- func AssetCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func Code_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func InlineCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func NewS3Code(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func S3Code_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- type Schedule
- type Test
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Canary_IsConstruct ¶
func Canary_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead
func Canary_IsResource ¶
func Canary_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func NewAssetCode_Override ¶
func NewAssetCode_Override(a AssetCode, assetPath *string, options *awss3assets.AssetOptions)
Experimental.
func NewCanary_Override ¶
func NewCanary_Override(c Canary, scope constructs.Construct, id *string, props *CanaryProps)
Experimental.
func NewRuntime_Override ¶
func NewRuntime_Override(r Runtime, name *string, family RuntimeFamily)
Experimental.
Types ¶
type ArtifactsBucketLocation ¶
type ArtifactsBucketLocation struct { // The s3 location that stores the data of each run. // Experimental. Bucket awss3.IBucket `json:"bucket"` // The S3 bucket prefix. // // Specify this if you want a more specific path within the artifacts bucket. // Experimental. Prefix *string `json:"prefix"` }
Options for specifying the s3 location that stores the data of each canary run.
The artifacts bucket location **cannot** be updated once the canary is created. Experimental.
type AssetCode ¶
type AssetCode interface { Code Bind(scope constructs.Construct, handler *string, family RuntimeFamily) *CodeConfig }
Canary code from an Asset. Experimental.
func AssetCode_FromAsset ¶
func AssetCode_FromAsset(assetPath *string, options *awss3assets.AssetOptions) AssetCode
Specify code from a local path.
Path must include the folder structure `nodejs/node_modules/myCanaryFilename.js`.
Returns: `AssetCode` associated with the specified path. See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary.html#CloudWatch_Synthetics_Canaries_write_from_scratch
Experimental.
func Code_FromAsset ¶
func Code_FromAsset(assetPath *string, options *awss3assets.AssetOptions) AssetCode
Specify code from a local path.
Path must include the folder structure `nodejs/node_modules/myCanaryFilename.js`.
Returns: `AssetCode` associated with the specified path. See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary.html#CloudWatch_Synthetics_Canaries_write_from_scratch
Experimental.
func InlineCode_FromAsset ¶
func InlineCode_FromAsset(assetPath *string, options *awss3assets.AssetOptions) AssetCode
Specify code from a local path.
Path must include the folder structure `nodejs/node_modules/myCanaryFilename.js`.
Returns: `AssetCode` associated with the specified path. See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary.html#CloudWatch_Synthetics_Canaries_write_from_scratch
Experimental.
func NewAssetCode ¶
func NewAssetCode(assetPath *string, options *awss3assets.AssetOptions) AssetCode
Experimental.
func S3Code_FromAsset ¶
func S3Code_FromAsset(assetPath *string, options *awss3assets.AssetOptions) AssetCode
Specify code from a local path.
Path must include the folder structure `nodejs/node_modules/myCanaryFilename.js`.
Returns: `AssetCode` associated with the specified path. See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary.html#CloudWatch_Synthetics_Canaries_write_from_scratch
Experimental.
type Canary ¶
type Canary interface { awscdk.Resource ArtifactsBucket() awss3.IBucket CanaryId() *string CanaryName() *string CanaryState() *string Env() *awscdk.ResourceEnvironment Node() constructs.Node PhysicalName() *string Role() awsiam.IRole Stack() awscdk.Stack ApplyRemovalPolicy(policy awscdk.RemovalPolicy) GeneratePhysicalName() *string GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string GetResourceNameAttribute(nameAttr *string) *string MetricDuration(options *awscloudwatch.MetricOptions) awscloudwatch.Metric MetricFailed(options *awscloudwatch.MetricOptions) awscloudwatch.Metric MetricSuccessPercent(options *awscloudwatch.MetricOptions) awscloudwatch.Metric ToString() *string }
Define a new Canary. Experimental.
func NewCanary ¶
func NewCanary(scope constructs.Construct, id *string, props *CanaryProps) Canary
Experimental.
type CanaryProps ¶
type CanaryProps struct { // Specify the runtime version to use for the canary. // See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html // // Experimental. Runtime Runtime `json:"runtime"` // The type of test that you want your canary to run. // // Use `Test.custom()` to specify the test to run. // Experimental. Test Test `json:"test"` // The s3 location that stores the data of the canary runs. // Experimental. ArtifactsBucketLocation *ArtifactsBucketLocation `json:"artifactsBucketLocation"` // The name of the 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 name. The canary name // makes up part of the canary ARN, which is included in outbound calls over the internet. // See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html // // Experimental. CanaryName *string `json:"canaryName"` // Key-value pairs that the Synthetics caches and makes available for your canary scripts. // // Use environment variables // to apply configuration changes, such as test and production environment configurations, without changing your // Canary script source code. // Experimental. EnvironmentVariables *map[string]*string `json:"environmentVariables"` // How many days should failed runs be retained. // Experimental. FailureRetentionPeriod awscdk.Duration `json:"failureRetentionPeriod"` // Canary execution role. // // This is the role that will be assumed by the canary upon execution. // It controls the permissions that the canary will have. The role must // be assumable by the AWS Lambda service principal. // // If not supplied, a role will be created with all the required permissions. // If you provide a Role, you must add the required permissions. // See: required permissions: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-executionrolearn // // Experimental. Role awsiam.IRole `json:"role"` // Specify the schedule for how often the canary runs. // // For example, if you set `schedule` to `rate(10 minutes)`, then the canary will run every 10 minutes. // You can set the schedule with `Schedule.rate(Duration)` (recommended) or you can specify an expression using `Schedule.expression()`. // Experimental. Schedule Schedule `json:"schedule"` // Whether or not the canary should start after creation. // Experimental. StartAfterCreation *bool `json:"startAfterCreation"` // How many days should successful runs be retained. // Experimental. SuccessRetentionPeriod awscdk.Duration `json:"successRetentionPeriod"` // How long the canary will be in a 'RUNNING' state. // // For example, if you set `timeToLive` to be 1 hour and `schedule` to be `rate(10 minutes)`, // your canary will run at 10 minute intervals for an hour, for a total of 6 times. // Experimental. TimeToLive awscdk.Duration `json:"timeToLive"` }
Properties for a canary. Experimental.
type Code ¶
type Code interface {
Bind(scope constructs.Construct, handler *string, family RuntimeFamily) *CodeConfig
}
The code the canary should execute. Experimental.
type CodeConfig ¶
type CodeConfig struct { // Inline code (mutually exclusive with `s3Location`). // Experimental. InlineCode *string `json:"inlineCode"` // The location of the code in S3 (mutually exclusive with `inlineCode`). // Experimental. S3Location *awss3.Location `json:"s3Location"` }
Configuration of the code class. Experimental.
type CustomTestOptions ¶
type CustomTestOptions struct { // The code of the canary script. // Experimental. Code Code `json:"code"` // The handler for the code. // // Must end with `.handler`. // Experimental. Handler *string `json:"handler"` }
Properties for specifying a test. Experimental.
type InlineCode ¶
type InlineCode interface { Code Bind(_scope constructs.Construct, handler *string, _family RuntimeFamily) *CodeConfig }
Canary code from an inline string. Experimental.
func AssetCode_FromInline ¶
func AssetCode_FromInline(code *string) InlineCode
Specify code inline.
Returns: `InlineCode` with inline code. Experimental.
func Code_FromInline ¶
func Code_FromInline(code *string) InlineCode
Specify code inline.
Returns: `InlineCode` with inline code. Experimental.
func InlineCode_FromInline ¶
func InlineCode_FromInline(code *string) InlineCode
Specify code inline.
Returns: `InlineCode` with inline code. Experimental.
func S3Code_FromInline ¶
func S3Code_FromInline(code *string) InlineCode
Specify code inline.
Returns: `InlineCode` with inline code. Experimental.
type Runtime ¶
type Runtime interface { Family() RuntimeFamily Name() *string }
Runtime options for a canary. Experimental.
func Runtime_SYNTHETICS_1_0 ¶
func Runtime_SYNTHETICS_1_0() Runtime
func Runtime_SYNTHETICS_NODEJS_2_0 ¶
func Runtime_SYNTHETICS_NODEJS_2_0() Runtime
func Runtime_SYNTHETICS_NODEJS_2_1 ¶
func Runtime_SYNTHETICS_NODEJS_2_1() Runtime
func Runtime_SYNTHETICS_NODEJS_2_2 ¶
func Runtime_SYNTHETICS_NODEJS_2_2() Runtime
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_0 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_0() Runtime
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_1 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_1() Runtime
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_2 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_2() Runtime
func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_0 ¶
func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_0() Runtime
type RuntimeFamily ¶
type RuntimeFamily string
All known Lambda runtime families. Experimental.
const ( RuntimeFamily_NODEJS RuntimeFamily = "NODEJS" RuntimeFamily_PYTHON RuntimeFamily = "PYTHON" RuntimeFamily_OTHER RuntimeFamily = "OTHER" )
type S3Code ¶
type S3Code interface { Code Bind(_scope constructs.Construct, _handler *string, _family RuntimeFamily) *CodeConfig }
S3 bucket path to the code zip file. Experimental.
func AssetCode_FromBucket ¶
Specify code from an s3 bucket.
The object in the s3 bucket must be a .zip file that contains the structure `nodejs/node_modules/myCanaryFilename.js`.
Returns: `S3Code` associated with the specified S3 object. See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary.html#CloudWatch_Synthetics_Canaries_write_from_scratch
Experimental.
func Code_FromBucket ¶
Specify code from an s3 bucket.
The object in the s3 bucket must be a .zip file that contains the structure `nodejs/node_modules/myCanaryFilename.js`.
Returns: `S3Code` associated with the specified S3 object. See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary.html#CloudWatch_Synthetics_Canaries_write_from_scratch
Experimental.
func InlineCode_FromBucket ¶
Specify code from an s3 bucket.
The object in the s3 bucket must be a .zip file that contains the structure `nodejs/node_modules/myCanaryFilename.js`.
Returns: `S3Code` associated with the specified S3 object. See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary.html#CloudWatch_Synthetics_Canaries_write_from_scratch
Experimental.
func S3Code_FromBucket ¶
Specify code from an s3 bucket.
The object in the s3 bucket must be a .zip file that contains the structure `nodejs/node_modules/myCanaryFilename.js`.
Returns: `S3Code` associated with the specified S3 object. See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary.html#CloudWatch_Synthetics_Canaries_write_from_scratch
Experimental.
type Schedule ¶
type Schedule interface {
ExpressionString() *string
}
Schedule for canary runs. Experimental.
func Schedule_Expression ¶
Construct a schedule from a literal schedule expression.
The expression must be in a `rate(number units)` format. For example, `Schedule.expression('rate(10 minutes)')` Experimental.
func Schedule_Rate ¶
func Schedule_Rate(interval awscdk.Duration) Schedule
Construct a schedule from an interval.
Allowed values: 0 (for a single run) or between 1 and 60 minutes. To specify a single run, you can use `Schedule.once()`. Experimental.
type Test ¶
Specify a test that the canary should run. Experimental.
func Test_Custom ¶
func Test_Custom(options *CustomTestOptions) Test
Specify a custom test with your own code.
Returns: `Test` associated with the specified Code object Experimental.