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.84.0 (build 5404dcf)", date="2023-06-19T16:30:40.468Z") @Stability(Experimental) public abstract class Code extends software.amazon.jsii.JsiiObject
(experimental) 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_3_1)
         .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)
    (experimental) 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)
    (experimental) Specify code from a local path.
    static AssetCode
    fromAsset(String assetPath, AssetOptions options)
    (experimental) Specify code from a local path.
    static S3Code
    fromBucket(IBucket bucket, String key)
    (experimental) Specify code from an s3 bucket.
    static S3Code
    fromBucket(IBucket bucket, String key, String objectVersion)
    (experimental) Specify code from an s3 bucket.
    static InlineCode
    (experimental) 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