class AssetImportSource
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CloudFront.AssetImportSource |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#AssetImportSource |
Java | software.amazon.awscdk.services.cloudfront.AssetImportSource |
Python | aws_cdk.aws_cloudfront.AssetImportSource |
TypeScript (source) | aws-cdk-lib » aws_cloudfront » AssetImportSource |
Extends
Import
An import source from a local file.
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_cloudfront as cloudfront } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_kms as kms } 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 assetImportSource = cloudfront.AssetImportSource.fromAsset('path', /* 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 AssetImportSource(path: string, options?: AssetOptions)
Parameters
- path
string
— the path to the local file. - options
Asset
— the configuration for the temporarily created S3 file.Options
Properties
Name | Type | Description |
---|---|---|
path | string | the path to the local file. |
path
Type:
string
the path to the local file.