java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.synthetics.Code
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
Direct Known Subclasses:
AssetCode, InlineCode, S3Code

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:25.618Z") @Stability(Stable) public abstract class Code extends software.amazon.jsii.JsiiObject
The code the canary should execute.

Example:

 Canary canary = Canary.Builder.create(this, "MyCanary")
         .schedule(Schedule.rate(Duration.minutes(5)))
         .test(Test.custom(CustomTestOptions.builder()
                 .code(Code.fromAsset(join(__dirname, "canary")))
                 .handler("index.handler")
                 .build()))
         .runtime(Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2)
         .environmentVariables(Map.of(
                 "stage", "prod"))
         .build();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    Code(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Code(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract CodeConfig
    bind(software.constructs.Construct scope, String handler, RuntimeFamily family)
    Called when the canary is initialized to allow this object to bind to the stack, add resources and have fun.
    static AssetCode
    fromAsset(String assetPath)
    Specify code from a local path.
    static AssetCode
    fromAsset(String assetPath, AssetOptions options)
    Specify code from a local path.
    static S3Code
    fromBucket(IBucket bucket, String key)
    Specify code from an s3 bucket.
    static S3Code
    fromBucket(IBucket bucket, String key, String objectVersion)
    Specify code from an s3 bucket.
    static InlineCode
    Specify code inline.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson