class AssetCode
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Synthetics.AssetCode |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awssynthetics#AssetCode |
![]() | software.amazon.awscdk.services.synthetics.AssetCode |
![]() | aws_cdk.aws_synthetics.AssetCode |
![]() | aws-cdk-lib » aws_synthetics » AssetCode |
Extends
Code
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 * as cdk from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_kms as kms } from 'aws-cdk-lib';
import { aws_synthetics as synthetics } from 'aws-cdk-lib';
declare const dockerImage: cdk.DockerImage;
declare const grantable: iam.IGrantable;
declare const key: kms.Key;
declare const localBundling: cdk.ILocalBundling;
const assetCode = new synthetics.AssetCode('assetPath', /* all optional props */ {
assetHash: 'assetHash',
assetHashType: cdk.AssetHashType.SOURCE,
bundling: {
image: dockerImage,
// the properties below are optional
bundlingFileAccess: cdk.BundlingFileAccess.VOLUME_COPY,
command: ['command'],
entrypoint: ['entrypoint'],
environment: {
environmentKey: 'environment',
},
local: localBundling,
network: 'network',
outputType: cdk.BundlingOutput.ARCHIVED,
platform: 'platform',
securityOpt: 'securityOpt',
user: 'user',
volumes: [{
containerPath: 'containerPath',
hostPath: 'hostPath',
// the properties below are optional
consistency: cdk.DockerVolumeConsistency.CONSISTENT,
}],
volumesFrom: ['volumesFrom'],
workingDirectory: 'workingDirectory',
},
deployTime: false,
exclude: ['exclude'],
followSymlinks: cdk.SymlinkFollowMode.NEVER,
ignoreMode: cdk.IgnoreMode.GLOB,
readers: [grantable],
sourceKMSKey: key,
});
Initializer
new AssetCode(assetPath: string, options?: AssetOptions)
Parameters
- assetPath
string
— The path to the asset file or directory. - options
Asset
Options
Methods
Name | Description |
---|---|
bind(scope, handler, family, runtimeName?) | Called when the canary is initialized to allow this object to bind to the stack, add resources and have fun. |
bind(scope, handler, family, runtimeName?)
public bind(scope: Construct, handler: string, family: RuntimeFamily, runtimeName?: string): CodeConfig
Parameters
- scope
Construct
- handler
string
- family
Runtime
Family - runtimeName
string
Returns
Called when the canary is initialized to allow this object to bind to the stack, add resources and have fun.