Instead of uploading the files manually through the AWS console, a better solution would be to automatically upload the asset
directory (or any other directory we'd like to upload) whenever we deploy our stack. After all, with CDK we'd like to reduce the manual work to minimum and focus on building an architecture and solving our problems.
In this lesson we're going to learn how to use the aws-s3-deployment
construct in order to upload an assets
directory to an s3 bucket automatically whenever we deploy the CDK stack.
I have one query, does AWS CDK support all infrastructure components like creating VPC, EC2 instances, NAT gateway, load balancers etc.
I have one query, does AWS CDK support all infrastructure components like creating VPC, EC2 instances, NAT gateway, load balancers etc.
Absolutely! Take a look at https://docs.aws.amazon.com/cdk/api/latest/docs/aws-construct-library.html - CDK has constructs for nearly every single AWS service!
In case anyone else runs into 'Assets must be defined indirectly within a "Stage" or an "App" scope', I had to lock all my AWS node module versions to 1.62.0 after upgrading to 1.64.1.