import iam = require('@aws-cdk/aws-iam'); import s3 = require('@aws-cdk/aws-s3'); import cdk = require('@aws-cdk/cdk'); /** * Defines the way an asset is packaged before it is uploaded to S3. */ export declare enum AssetPackaging { /** * Path refers to a directory on disk, the contents of the directory is * archived into a .zip. */ ZipDirectory = "zip", /** * Path refers to a single file on disk. The file is uploaded as-is. */ File = "file" } export interface GenericAssetProps { /** * The disk location of the asset. */ path: string; /** * The packaging type for this asset. */ packaging: AssetPackaging; /** * A list of principals that should be able to read this asset from S3. * You can use `asset.grantRead(principal)` to grant read permissions later. */ readers?: iam.IPrincipal[]; } /** * An asset represents a local file or directory, which is automatically uploaded to S3 * and then can be referenced within a CDK application. */ export declare class Asset extends cdk.Construct { /** * Attribute that represents the name of the bucket this asset exists in. */ readonly s3BucketName: s3.BucketName; /** * Attribute which represents the S3 object key of this asset. */ readonly s3ObjectKey: s3.ObjectKey; /** * Attribute which represents the S3 URL of this asset. * @example https://s3.us-west-1.amazonaws.com/bucket/key */ readonly s3Url: s3.S3Url; /** * Resolved full-path location of this asset. */ readonly assetPath: string; private readonly bucket; constructor(parent: cdk.Construct, id: string, props: GenericAssetProps); /** * Grants read permissions to the principal on the asset's S3 object. */ grantRead(principal?: iam.IPrincipal): void; } export interface FileAssetProps { /** * File path. */ path: string; /** * A list of principals that should be able to read this file asset from S3. * You can use `asset.grantRead(principal)` to grant read permissions later. */ readers?: iam.IPrincipal[]; } /** * An asset that represents a file on disk. */ export declare class FileAsset extends Asset { constructor(parent: cdk.Construct, id: string, props: FileAssetProps); } export interface ZipDirectoryAssetProps { /** * Path of the directory. */ path: string; /** * A list of principals that should be able to read this ZIP file from S3. * You can use `asset.grantRead(principal)` to grant read permissions later. */ readers?: iam.IPrincipal[]; } /** * An asset that represents a ZIP archive of a directory on disk. */ export declare class ZipDirectoryAsset extends Asset { constructor(parent: cdk.Construct, id: string, props: ZipDirectoryAssetProps); }