Documentation ¶
Overview ¶
This module is deprecated. All constructs are now available under aws-cdk-lib/aws-synthetics
Index ¶
- func Canary_IsConstruct(x interface{}) *bool
- func Canary_IsOwnedResource(construct constructs.IConstruct) *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 Cleanup
- type Code
- type CodeConfig
- type CronOptions
- 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_NODEJS_PUPPETEER_3_3() Runtime
- func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_4() Runtime
- func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_5() Runtime
- func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_6() Runtime
- func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_7() Runtime
- func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_8() Runtime
- func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_9() Runtime
- func Runtime_SYNTHETICS_NODEJS_PUPPETEER_4_0() Runtime
- func Runtime_SYNTHETICS_NODEJS_PUPPETEER_5_0() Runtime
- func Runtime_SYNTHETICS_NODEJS_PUPPETEER_5_1() Runtime
- func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_0() Runtime
- func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_1() Runtime
- func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_2() Runtime
- func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_3() 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.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated.
func Canary_IsOwnedResource ¶
func Canary_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise. Deprecated.
func Canary_IsResource ¶
func Canary_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource. Deprecated.
func NewAssetCode_Override ¶
func NewAssetCode_Override(a AssetCode, assetPath *string, options *awss3assets.AssetOptions)
Deprecated.
func NewCanary_Override ¶
func NewCanary_Override(c Canary, scope constructs.Construct, id *string, props *CanaryProps)
Deprecated.
func NewRuntime_Override ¶
func NewRuntime_Override(r Runtime, name *string, family RuntimeFamily)
Deprecated.
Types ¶
type ArtifactsBucketLocation ¶
type ArtifactsBucketLocation struct { // The s3 location that stores the data of each run. // Deprecated. Bucket awss3.IBucket `field:"required" json:"bucket" yaml:"bucket"` // The S3 bucket prefix. // // Specify this if you want a more specific path within the artifacts bucket. // Default: - no prefix. // // Deprecated. Prefix *string `field:"optional" json:"prefix" yaml:"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.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import synthetics_alpha "github.com/aws/aws-cdk-go/awscdksyntheticsalpha" import "github.com/aws/aws-cdk-go/awscdk" var bucket bucket artifactsBucketLocation := &ArtifactsBucketLocation{ Bucket: bucket, // the properties below are optional Prefix: jsii.String("prefix"), }
Deprecated.
type AssetCode ¶
type AssetCode interface { Code // Called when the canary is initialized to allow this object to bind to the stack, add resources and have fun. // Deprecated. Bind(scope constructs.Construct, handler *string, family RuntimeFamily) *CodeConfig }
Canary code from an Asset.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import synthetics_alpha "github.com/aws/aws-cdk-go/awscdksyntheticsalpha" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var dockerImage dockerImage var grantable iGrantable var localBundling iLocalBundling assetCode := synthetics_alpha.NewAssetCode(jsii.String("assetPath"), &AssetOptions{ AssetHash: jsii.String("assetHash"), AssetHashType: cdk.AssetHashType_SOURCE, Bundling: &BundlingOptions{ Image: dockerImage, // the properties below are optional BundlingFileAccess: cdk.BundlingFileAccess_VOLUME_COPY, Command: []*string{ jsii.String("command"), }, Entrypoint: []*string{ jsii.String("entrypoint"), }, Environment: map[string]*string{ "environmentKey": jsii.String("environment"), }, Local: localBundling, Network: jsii.String("network"), OutputType: cdk.BundlingOutput_ARCHIVED, Platform: jsii.String("platform"), SecurityOpt: jsii.String("securityOpt"), User: jsii.String("user"), Volumes: []dockerVolume{ &dockerVolume{ ContainerPath: jsii.String("containerPath"), HostPath: jsii.String("hostPath"), // the properties below are optional Consistency: cdk.DockerVolumeConsistency_CONSISTENT, }, }, VolumesFrom: []*string{ jsii.String("volumesFrom"), }, WorkingDirectory: jsii.String("workingDirectory"), }, DeployTime: jsii.Boolean(false), Exclude: []*string{ jsii.String("exclude"), }, FollowSymlinks: cdk.SymlinkFollowMode_NEVER, IgnoreMode: cdk.IgnoreMode_GLOB, Readers: []*iGrantable{ grantable, }, })
Deprecated.
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
Deprecated.
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
Deprecated.
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
Deprecated.
func NewAssetCode ¶
func NewAssetCode(assetPath *string, options *awss3assets.AssetOptions) AssetCode
Deprecated.
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
Deprecated.
type Canary ¶
type Canary interface { awscdk.Resource awsec2.IConnectable // Bucket where data from each canary run is stored. // Deprecated. ArtifactsBucket() awss3.IBucket // The canary ID. // Deprecated. CanaryId() *string // The canary Name. // Deprecated. CanaryName() *string // The state of the canary. // // For example, 'RUNNING', 'STOPPED', 'NOT STARTED', or 'ERROR'. // Deprecated. CanaryState() *string // Access the Connections object. // // Will fail if not a VPC-enabled Canary. // Deprecated. Connections() awsec2.Connections // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Deprecated. Env() *awscdk.ResourceEnvironment // The tree node. // Deprecated. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Deprecated. PhysicalName() *string // Execution role associated with this Canary. // Deprecated. Role() awsiam.IRole // The stack in which this resource is defined. // Deprecated. Stack() awscdk.Stack // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Deprecated. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Deprecated. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Deprecated. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Deprecated. GetResourceNameAttribute(nameAttr *string) *string // Measure the Duration of a single canary run, in seconds. // Default: avg over 5 minutes. // // Deprecated. MetricDuration(options *awscloudwatch.MetricOptions) awscloudwatch.Metric // Measure the number of failed canary runs over a given time period. // // Default: sum over 5 minutes. // Deprecated. MetricFailed(options *awscloudwatch.MetricOptions) awscloudwatch.Metric // Measure the percentage of successful canary runs. // Default: avg over 5 minutes. // // Deprecated. MetricSuccessPercent(options *awscloudwatch.MetricOptions) awscloudwatch.Metric // Returns a string representation of this construct. // Deprecated. ToString() *string }
Define a new Canary.
Example:
canary := synthetics.NewCanary(this, jsii.String("MyCanary"), &CanaryProps{ Schedule: synthetics.Schedule_Rate(awscdk.Duration_Minutes(jsii.Number(5))), Test: synthetics.Test_Custom(&CustomTestOptions{ Code: synthetics.Code_FromAsset(path.join(__dirname, jsii.String("canary"))), Handler: jsii.String("index.handler"), }), Runtime: synthetics.Runtime_SYNTHETICS_NODEJS_PUPPETEER_4_0(), EnvironmentVariables: map[string]*string{ "stage": jsii.String("prod"), }, })
Deprecated.
func NewCanary ¶
func NewCanary(scope constructs.Construct, id *string, props *CanaryProps) Canary
Deprecated.
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 // // Deprecated. Runtime Runtime `field:"required" json:"runtime" yaml:"runtime"` // The type of test that you want your canary to run. // // Use `Test.custom()` to specify the test to run. // Deprecated. Test Test `field:"required" json:"test" yaml:"test"` // Lifecycle rules for the generated canary artifact bucket. // // Has no effect // if a bucket is passed to `artifactsBucketLocation`. If you pass a bucket // to `artifactsBucketLocation`, you can add lifecycle rules to the bucket // itself. // Default: - no rules applied to the generated bucket. // // Deprecated. ArtifactsBucketLifecycleRules *[]*awss3.LifecycleRule `field:"optional" json:"artifactsBucketLifecycleRules" yaml:"artifactsBucketLifecycleRules"` // The s3 location that stores the data of the canary runs. // Default: - A new s3 bucket will be created without a prefix. // // Deprecated. ArtifactsBucketLocation *ArtifactsBucketLocation `field:"optional" json:"artifactsBucketLocation" yaml:"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 // // Default: - A unique name will be generated from the construct ID. // // Deprecated. CanaryName *string `field:"optional" json:"canaryName" yaml:"canaryName"` // Specify the underlying resources to be cleaned up when the canary is deleted. // // Using `Cleanup.LAMBDA` will create a Custom Resource to achieve this. // Default: Cleanup.NOTHING // // Deprecated. Cleanup Cleanup `field:"optional" json:"cleanup" yaml:"cleanup"` // Whether or not to delete the lambda resources when the canary is deleted. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-deletelambdaresourcesoncanarydeletion // // Default: false. // // Deprecated: this feature has been deprecated by the service team, use `cleanup: Cleanup.LAMBDA` instead which will use a Custom Resource to achieve the same effect. EnableAutoDeleteLambdas *bool `field:"optional" json:"enableAutoDeleteLambdas" yaml:"enableAutoDeleteLambdas"` // 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. // Default: - No environment variables. // // Deprecated. EnvironmentVariables *map[string]*string `field:"optional" json:"environmentVariables" yaml:"environmentVariables"` // How many days should failed runs be retained. // Default: Duration.days(31) // // Deprecated. FailureRetentionPeriod awscdk.Duration `field:"optional" json:"failureRetentionPeriod" yaml:"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 // // Default: - A unique role will be generated for this canary. // You can add permissions to roles by calling 'addToRolePolicy'. // // Deprecated. Role awsiam.IRole `field:"optional" json:"role" yaml:"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()`. // Default: 'rate(5 minutes)'. // // Deprecated. Schedule Schedule `field:"optional" json:"schedule" yaml:"schedule"` // The list of security groups to associate with the canary's network interfaces. // // You must provide `vpc` when using this prop. // Default: - If the canary is placed within a VPC and a security group is // not specified a dedicated security group will be created for this canary. // // Deprecated. SecurityGroups *[]awsec2.ISecurityGroup `field:"optional" json:"securityGroups" yaml:"securityGroups"` // Whether or not the canary should start after creation. // Default: true. // // Deprecated. StartAfterCreation *bool `field:"optional" json:"startAfterCreation" yaml:"startAfterCreation"` // How many days should successful runs be retained. // Default: Duration.days(31) // // Deprecated. SuccessRetentionPeriod awscdk.Duration `field:"optional" json:"successRetentionPeriod" yaml:"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. // Default: - no limit. // // Deprecated. TimeToLive awscdk.Duration `field:"optional" json:"timeToLive" yaml:"timeToLive"` // The VPC where this canary is run. // // Specify this if the canary needs to access resources in a VPC. // Default: - Not in VPC. // // Deprecated. Vpc awsec2.IVpc `field:"optional" json:"vpc" yaml:"vpc"` // Where to place the network interfaces within the VPC. // // You must provide `vpc` when using this prop. // Default: - the Vpc default strategy if not specified. // // Deprecated. VpcSubnets *awsec2.SubnetSelection `field:"optional" json:"vpcSubnets" yaml:"vpcSubnets"` }
Properties for a canary.
Example:
canary := synthetics.NewCanary(this, jsii.String("MyCanary"), &CanaryProps{ Schedule: synthetics.Schedule_Rate(awscdk.Duration_Minutes(jsii.Number(5))), Test: synthetics.Test_Custom(&CustomTestOptions{ Code: synthetics.Code_FromAsset(path.join(__dirname, jsii.String("canary"))), Handler: jsii.String("index.handler"), }), Runtime: synthetics.Runtime_SYNTHETICS_NODEJS_PUPPETEER_4_0(), EnvironmentVariables: map[string]*string{ "stage": jsii.String("prod"), }, })
Deprecated.
type Cleanup ¶
type Cleanup string
Different ways to clean up underlying Canary resources when the Canary is deleted.
Example:
canary := synthetics.NewCanary(this, jsii.String("Canary"), &CanaryProps{ Test: synthetics.Test_Custom(&CustomTestOptions{ Handler: jsii.String("index.handler"), Code: synthetics.Code_FromInline(jsii.String("/* Synthetics handler code")), }), Cleanup: synthetics.Cleanup_LAMBDA, Runtime: synthetics.Runtime_SYNTHETICS_NODEJS_PUPPETEER_4_0(), })
Deprecated.
const ( // Clean up nothing. // // The user is responsible for cleaning up // all resources left behind by the Canary. // Deprecated. Cleanup_NOTHING Cleanup = "NOTHING" // Clean up the underlying Lambda function only. // // The user is // responsible for cleaning up all other resources left behind // by the Canary. // Deprecated. Cleanup_LAMBDA Cleanup = "LAMBDA" )
type Code ¶
type Code interface { // Called when the canary is initialized to allow this object to bind to the stack, add resources and have fun. // // Returns: a bound `CodeConfig`. // Deprecated. Bind(scope constructs.Construct, handler *string, family RuntimeFamily) *CodeConfig }
The code the canary should execute.
Example:
canary := synthetics.NewCanary(this, jsii.String("MyCanary"), &CanaryProps{ Schedule: synthetics.Schedule_Rate(awscdk.Duration_Minutes(jsii.Number(5))), Test: synthetics.Test_Custom(&CustomTestOptions{ Code: synthetics.Code_FromAsset(path.join(__dirname, jsii.String("canary"))), Handler: jsii.String("index.handler"), }), Runtime: synthetics.Runtime_SYNTHETICS_NODEJS_PUPPETEER_4_0(), EnvironmentVariables: map[string]*string{ "stage": jsii.String("prod"), }, })
Deprecated.
type CodeConfig ¶
type CodeConfig struct { // Inline code (mutually exclusive with `s3Location`). // Default: - none. // // Deprecated. InlineCode *string `field:"optional" json:"inlineCode" yaml:"inlineCode"` // The location of the code in S3 (mutually exclusive with `inlineCode`). // Default: - none. // // Deprecated. S3Location *awss3.Location `field:"optional" json:"s3Location" yaml:"s3Location"` }
Configuration of the code class.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import synthetics_alpha "github.com/aws/aws-cdk-go/awscdksyntheticsalpha" codeConfig := &CodeConfig{ InlineCode: jsii.String("inlineCode"), S3Location: &Location{ BucketName: jsii.String("bucketName"), ObjectKey: jsii.String("objectKey"), // the properties below are optional ObjectVersion: jsii.String("objectVersion"), }, }
Deprecated.
type CronOptions ¶
type CronOptions struct { // The day of the month to run this rule at. // Default: - Every day of the month. // // Deprecated. Day *string `field:"optional" json:"day" yaml:"day"` // The hour to run this rule at. // Default: - Every hour. // // Deprecated. Hour *string `field:"optional" json:"hour" yaml:"hour"` // The minute to run this rule at. // Default: - Every minute. // // Deprecated. Minute *string `field:"optional" json:"minute" yaml:"minute"` // The month to run this rule at. // Default: - Every month. // // Deprecated. Month *string `field:"optional" json:"month" yaml:"month"` // The day of the week to run this rule at. // Default: - Any day of the week. // // Deprecated. WeekDay *string `field:"optional" json:"weekDay" yaml:"weekDay"` }
Options to configure a cron expression.
All fields are strings so you can use complex expressions. Absence of a field implies '*' or '?', whichever one is appropriate.
Example:
schedule := synthetics.Schedule_Cron(&CronOptions{ Hour: jsii.String("0,8,16"), })
Deprecated.
type CustomTestOptions ¶
type CustomTestOptions struct { // The code of the canary script. // Deprecated. Code Code `field:"required" json:"code" yaml:"code"` // The handler for the code. // // Must end with `.handler`. // Deprecated. Handler *string `field:"required" json:"handler" yaml:"handler"` }
Properties for specifying a test.
Example:
canary := synthetics.NewCanary(this, jsii.String("MyCanary"), &CanaryProps{ Schedule: synthetics.Schedule_Rate(awscdk.Duration_Minutes(jsii.Number(5))), Test: synthetics.Test_Custom(&CustomTestOptions{ Code: synthetics.Code_FromAsset(path.join(__dirname, jsii.String("canary"))), Handler: jsii.String("index.handler"), }), Runtime: synthetics.Runtime_SYNTHETICS_NODEJS_PUPPETEER_4_0(), EnvironmentVariables: map[string]*string{ "stage": jsii.String("prod"), }, })
Deprecated.
type InlineCode ¶
type InlineCode interface { Code // Called when the canary is initialized to allow this object to bind to the stack, add resources and have fun. // Deprecated. Bind(_scope constructs.Construct, handler *string, _family RuntimeFamily) *CodeConfig }
Canary code from an inline string.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import synthetics_alpha "github.com/aws/aws-cdk-go/awscdksyntheticsalpha" inlineCode := synthetics_alpha.NewInlineCode(jsii.String("code"))
Deprecated.
func AssetCode_FromInline ¶
func AssetCode_FromInline(code *string) InlineCode
Specify code inline.
Returns: `InlineCode` with inline code. Deprecated.
func Code_FromInline ¶
func Code_FromInline(code *string) InlineCode
Specify code inline.
Returns: `InlineCode` with inline code. Deprecated.
func InlineCode_FromInline ¶
func InlineCode_FromInline(code *string) InlineCode
Specify code inline.
Returns: `InlineCode` with inline code. Deprecated.
func S3Code_FromInline ¶
func S3Code_FromInline(code *string) InlineCode
Specify code inline.
Returns: `InlineCode` with inline code. Deprecated.
type Runtime ¶
type Runtime interface { // The Lambda runtime family. // Deprecated. Family() RuntimeFamily // The name of the runtime version. // Deprecated. Name() *string }
Runtime options for a canary.
Example:
canary := synthetics.NewCanary(this, jsii.String("MyCanary"), &CanaryProps{ Schedule: synthetics.Schedule_Rate(awscdk.Duration_Minutes(jsii.Number(5))), Test: synthetics.Test_Custom(&CustomTestOptions{ Code: synthetics.Code_FromAsset(path.join(__dirname, jsii.String("canary"))), Handler: jsii.String("index.handler"), }), Runtime: synthetics.Runtime_SYNTHETICS_NODEJS_PUPPETEER_4_0(), EnvironmentVariables: map[string]*string{ "stage": jsii.String("prod"), }, })
Deprecated.
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_NODEJS_PUPPETEER_3_3 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_3() Runtime
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_4 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_4() Runtime
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_5 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_5() Runtime
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_6 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_6() Runtime
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_7 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_7() Runtime
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_8 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_8() Runtime
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_9 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_3_9() Runtime
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_4_0 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_4_0() Runtime
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_5_0 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_5_0() Runtime
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_5_1 ¶
func Runtime_SYNTHETICS_NODEJS_PUPPETEER_5_1() Runtime
func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_0 ¶
func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_0() Runtime
func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_1 ¶
func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_1() Runtime
func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_2 ¶
func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_2() Runtime
func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_3 ¶
func Runtime_SYNTHETICS_PYTHON_SELENIUM_1_3() Runtime
type RuntimeFamily ¶
type RuntimeFamily string
All known Lambda runtime families. Deprecated.
const ( // All Lambda runtimes that depend on Node.js. // Deprecated. RuntimeFamily_NODEJS RuntimeFamily = "NODEJS" // All lambda runtimes that depend on Python. // Deprecated. RuntimeFamily_PYTHON RuntimeFamily = "PYTHON" // Any future runtime family. // Deprecated. RuntimeFamily_OTHER RuntimeFamily = "OTHER" )
type S3Code ¶
type S3Code interface { Code // Called when the canary is initialized to allow this object to bind to the stack, add resources and have fun. // Deprecated. Bind(_scope constructs.Construct, _handler *string, _family RuntimeFamily) *CodeConfig }
S3 bucket path to the code zip file.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import synthetics_alpha "github.com/aws/aws-cdk-go/awscdksyntheticsalpha" import "github.com/aws/aws-cdk-go/awscdk" var bucket bucket s3Code := synthetics_alpha.NewS3Code(bucket, jsii.String("key"), jsii.String("objectVersion"))
Deprecated.
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
Deprecated.
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
Deprecated.
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
Deprecated.
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
Deprecated.
type Schedule ¶
type Schedule interface { // The Schedule expression. // Deprecated. ExpressionString() *string }
Schedule for canary runs.
Example:
canary := synthetics.NewCanary(this, jsii.String("MyCanary"), &CanaryProps{ Schedule: synthetics.Schedule_Rate(awscdk.Duration_Minutes(jsii.Number(5))), Test: synthetics.Test_Custom(&CustomTestOptions{ Code: synthetics.Code_FromAsset(path.join(__dirname, jsii.String("canary"))), Handler: jsii.String("index.handler"), }), Runtime: synthetics.Runtime_SYNTHETICS_NODEJS_PUPPETEER_4_0(), EnvironmentVariables: map[string]*string{ "stage": jsii.String("prod"), }, })
Deprecated.
func Schedule_Cron ¶
func Schedule_Cron(options *CronOptions) Schedule
Create a schedule from a set of cron fields. Deprecated.
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)')` Deprecated.
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()`. Deprecated.
type Test ¶
type Test interface { // The code that the canary should run. // Deprecated. Code() Code // The handler of the canary. // Deprecated. Handler() *string }
Specify a test that the canary should run.
Example:
canary := synthetics.NewCanary(this, jsii.String("MyCanary"), &CanaryProps{ Schedule: synthetics.Schedule_Rate(awscdk.Duration_Minutes(jsii.Number(5))), Test: synthetics.Test_Custom(&CustomTestOptions{ Code: synthetics.Code_FromAsset(path.join(__dirname, jsii.String("canary"))), Handler: jsii.String("index.handler"), }), Runtime: synthetics.Runtime_SYNTHETICS_NODEJS_PUPPETEER_4_0(), EnvironmentVariables: map[string]*string{ "stage": jsii.String("prod"), }, })
Deprecated.
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. Deprecated.
Source Files ¶
- ArtifactsBucketLocation.go
- AssetCode.go
- AssetCode__checks.go
- Canary.go
- CanaryProps.go
- Canary__checks.go
- Cleanup.go
- Code.go
- CodeConfig.go
- Code__checks.go
- CronOptions.go
- CustomTestOptions.go
- InlineCode.go
- InlineCode__checks.go
- Runtime.go
- RuntimeFamily.go
- Runtime__checks.go
- S3Code.go
- S3Code__checks.go
- Schedule.go
- Schedule__checks.go
- Test.go
- Test__checks.go
- main.go