Skip to content

ammobin infrastructure built with aws cdk

Notifications You must be signed in to change notification settings

ammobinDOTca/ammobin-cdk

Repository files navigation

ammobin-cdk

ammobin.ca rebuilt on AWS serverless technologies using AWS-CDK

setup

  • create aws account + configure cli (set region to ca-central-1) + create profiles for each region + stage
  • install node 16 + cdk
export publicUrl=<your site domain aka ammobin.ca>
npm run build

(for each region + stage)
region=us-west-2 npx cdk bootstrap --profile beta-us
region=us-west-2 site_region=US  stage=beta npx cdk deploy IamStack --profile beta-us
cdk deploy GrafanaIamStack (optional) ?

cdk deploy AmmobinPipelineStack
(get all AGW + CF resources)
cdk deploy Route53 (TODO not yet)

undocumented work:


issues

lambda size limit

ammobin-client is too large to be uploaded as a lambda

why not ecs?

https://aws.amazon.com/elasticloadbalancing/pricing/ => $20 a month before any network costs


open todos

update arch diagram

arm lambdas

do route53 stack -> move to cloudflare instead? revisit cache headers

doc

  • beta + prod accounts
  • domain
  • github secret
    • webhooks
    • repo commit status (even for public)

todo params:

  • accounts
  • route53 config

todo code:

  • run nuxt within lambda -> remove images from zip
  • cold starts for api/graphql lambdas (webpack helped a lot -> smaller packages, and 600ms reduced boot time)