aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 2.98 kB
JavaScript
var _a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.EnvironmentFileType=exports.S3EnvironmentFile=exports.AssetEnvironmentFile=exports.EnvironmentFile=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var aws_s3_assets_1=()=>{var tmp=require("../../aws-s3-assets");return aws_s3_assets_1=()=>tmp,tmp};class EnvironmentFile{static fromAsset(path,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_s3_assets_AssetOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromAsset),error}return new AssetEnvironmentFile(path,options)}static fromBucket(bucket,key,objectVersion){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_s3_IBucket(bucket)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromBucket),error}return new S3EnvironmentFile(bucket,key,objectVersion)}}exports.EnvironmentFile=EnvironmentFile,_a=JSII_RTTI_SYMBOL_1,EnvironmentFile[_a]={fqn:"aws-cdk-lib.aws_ecs.EnvironmentFile",version:"2.185.0"};class AssetEnvironmentFile extends EnvironmentFile{constructor(path,options={}){super(),this.path=path,this.options=options;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_s3_assets_AssetOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,AssetEnvironmentFile),error}}bind(scope){if(this.asset||(this.asset=new(aws_s3_assets_1()).Asset(scope,"EnvironmentFile",{path:this.path,...this.options})),!this.asset.isFile)throw new Error(`Asset must be a single file (${this.path})`);return{fileType:EnvironmentFileType.S3,s3Location:{bucketName:this.asset.s3BucketName,objectKey:this.asset.s3ObjectKey}}}}exports.AssetEnvironmentFile=AssetEnvironmentFile,_b=JSII_RTTI_SYMBOL_1,AssetEnvironmentFile[_b]={fqn:"aws-cdk-lib.aws_ecs.AssetEnvironmentFile",version:"2.185.0"};class S3EnvironmentFile extends EnvironmentFile{constructor(bucket,key,objectVersion){super(),this.key=key,this.objectVersion=objectVersion;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_s3_IBucket(bucket)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,S3EnvironmentFile),error}if(!bucket.bucketName)throw new Error("bucketName is undefined for the provided bucket");this.bucketName=bucket.bucketName}bind(_scope){return{fileType:EnvironmentFileType.S3,s3Location:{bucketName:this.bucketName,objectKey:this.key,objectVersion:this.objectVersion}}}}exports.S3EnvironmentFile=S3EnvironmentFile,_c=JSII_RTTI_SYMBOL_1,S3EnvironmentFile[_c]={fqn:"aws-cdk-lib.aws_ecs.S3EnvironmentFile",version:"2.185.0"};var EnvironmentFileType;(function(EnvironmentFileType2){EnvironmentFileType2.S3="s3"})(EnvironmentFileType||(exports.EnvironmentFileType=EnvironmentFileType={}));
;