Class Code
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.synthetics.alpha.Code
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
AssetCode,InlineCode,S3Code
@Generated(value="jsii-pacmak/1.89.0 (build 2f74b3e)",
date="2023-10-16T19:21:19.999Z")
@Stability(Deprecated)
@Deprecated
public abstract class Code
extends software.amazon.jsii.JsiiObject
Deprecated.
(deprecated) 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_4_0)
.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 -
Method Summary
Modifier and TypeMethodDescriptionabstract CodeConfigbind(software.constructs.Construct scope, String handler, RuntimeFamily family) Deprecated.static AssetCodeDeprecated.static AssetCodefromAsset(String assetPath, AssetOptions options) Deprecated.static S3CodefromBucket(IBucket bucket, String key) Deprecated.static S3CodefromBucket(IBucket bucket, String key, String objectVersion) Deprecated.static InlineCodefromInline(String code) Deprecated.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Code
protected Code(software.amazon.jsii.JsiiObjectRef objRef) Deprecated. -
Code
protected Code(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) Deprecated. -
Code
Deprecated.
-
-
Method Details
-
fromAsset
@Stability(Deprecated) @Deprecated @NotNull public static AssetCode fromAsset(@NotNull String assetPath, @Nullable AssetOptions options) Deprecated.(deprecated) Specify code from a local path.Path must include the folder structure
nodejs/node_modules/myCanaryFilename.js.- Parameters:
assetPath- Either a directory or a .zip file. This parameter is required.options-- Returns:
AssetCodeassociated with the specified path.- See Also:
-
fromAsset
@Stability(Deprecated) @Deprecated @NotNull public static AssetCode fromAsset(@NotNull String assetPath) Deprecated.(deprecated) Specify code from a local path.Path must include the folder structure
nodejs/node_modules/myCanaryFilename.js.- Parameters:
assetPath- Either a directory or a .zip file. This parameter is required.- Returns:
AssetCodeassociated with the specified path.- See Also:
-
fromBucket
@Stability(Deprecated) @Deprecated @NotNull public static S3Code fromBucket(@NotNull IBucket bucket, @NotNull String key, @Nullable String objectVersion) Deprecated.(deprecated) 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.- Parameters:
bucket- The S3 bucket. This parameter is required.key- The object key. This parameter is required.objectVersion- Optional S3 object version.- Returns:
S3Codeassociated with the specified S3 object.- See Also:
-
fromBucket
@Stability(Deprecated) @Deprecated @NotNull public static S3Code fromBucket(@NotNull IBucket bucket, @NotNull String key) Deprecated.(deprecated) 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.- Parameters:
bucket- The S3 bucket. This parameter is required.key- The object key. This parameter is required.- Returns:
S3Codeassociated with the specified S3 object.- See Also:
-
fromInline
@Stability(Deprecated) @Deprecated @NotNull public static InlineCode fromInline(@NotNull String code) Deprecated.(deprecated) Specify code inline.- Parameters:
code- The actual handler code (limited to 5MB). This parameter is required.- Returns:
InlineCodewith inline code.
-
bind
@Stability(Deprecated) @Deprecated @NotNull public abstract CodeConfig bind(@NotNull software.constructs.Construct scope, @NotNull String handler, @NotNull RuntimeFamily family) Deprecated.(deprecated) Called when the canary is initialized to allow this object to bind to the stack, add resources and have fun.- Parameters:
scope- The binding scope. This parameter is required.handler- This parameter is required.family- This parameter is required.- Returns:
- a bound
CodeConfig.
-