wolke-next-cdk

Wolke AWS Next.js deployment

Usage no npm install needed!

<script type="module">
  import wolkeNextCdk from 'https://cdn.skypack.dev/wolke-next-cdk';
</script>

README

Wolke Next CDK

Project to deploy Next.js via CDK on AWS

Useful commands

  • npm run build compile typescript to js
  • npm run watch watch for changes and compile
  • npm run test perform the jest unit tests
  • cdk deploy deploy this stack to your default AWS account/region
  • cdk diff compare deployed stack with current state
  • cdk synth emits the synthesized CloudFormation template

IAM Role to allow CDK stuff

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": ["cloudformation:*"],
      "Resource": "*",
      "Effect": "Allow"
    },
    {
      "Condition": {
        "ForAnyValue:StringEquals": {
          "aws:CalledVia": ["cloudformation.amazonaws.com"]
        }
      },
      "Action": "*",
      "Resource": "*",
      "Effect": "Allow"
    },
    {
      "Action": "s3:*",
      "Resource": "arn:aws:s3:::cdktoolkit-stagingbucket-*",
      "Effect": "Allow"
    }
  ]
}

Optimized static assets

Please move all assets into /public/static/*. This is an optimized path that directly access S3 from Cloudfront. /public/* is passed through Lambda function, so takes longer and is more expensive.