I’m using cdklocal
with localstack
to deploy my cdk stack in my local environment. When executing the S3 Deployment, I get the error [Errno 2] No such file or directory: '/opt/awscli/aws'
. The stack will still deploy locally, but no files will be deployed to my s3 bucket. The deployment works just fine if I deploy to my AWS account.
new s3deploy.BucketDeployment(this, 'WebsiteDeployment', {
sources: [s3deploy.Source.asset('./app/build')],
destinationBucket: bucket,
distribution,
distributionPaths: ['/*']
});
Why am I getting this error?
Expected Behavior
The S3 Deployment should upload the contents of ./app/build
to my bucket.
Current Behavior
The bucket is created but the contents of ./app/build
is not uploaded to my bucket.
Reproduction Steps
localstack start
cdklocal deploy
Stack:
const bucket = new s3.Bucket(this, 'Bucket', {
publicReadAccess: true,
removalPolicy: RemovalPolicy.DESTROY,
websiteIndexDocument: 'index.html'
});
new s3deploy.BucketDeployment(this, 'Deployment', {
sources: [s3deploy.Source.asset('./app/build')],
destinationBucket: bucket
});
CDK CLI Version
2.22.0 (build 1db4b16)
Node.js Version
v16.15.0
OS
Mac OS Monterey
Language
Typescript