Git Product home page Git Product logo

domains's Introduction

Domains

This repository shows how to configure a new domain on AWS, and assumes there are two AWS accounts for dev and prod.

1. Setup: Production

NOTE: A production deployment should be first when provisioning a new domain.

Follow the steps below to initiate your domain configuration:

  1. Export the AWS production credentials to your environment.
  2. Configure necessary AWS resources with a new file under ./aws/<domain>.yml.
  3. (Optional) Configure subdomain AWS resources with another file under ./aws/<subdomain>.yml.
  4. Reference this file(s) under ./serverless.yml in the resources section.
  5. Configure all required dev and prod parameters in ./serverless.yml in the custom.param.* section.
  6. Validate your configuration with the command npm run validate:prod.
  7. Deploy the AWS domain resources to your prod environment with the command npm run deploy:prod.

NOTE: You can also configure ./circleci/config.yml to automatically handle environment-specific deployments.

During the deployment process, remember the following steps to speed-up the deployment:

  1. Select the created ACM certificate (*.example.com) and manually add the certificate records in the hosted zone you've created.
  2. Lower the domain's hosted zone TTL (example.com), and revert them back once the changes are picked-up.
  3. Manually copy the domain's hosted zone NS records (example.com), and paste them to your domain's registrar.
  4. If you are deploying a CloudFront resource, remember to initiate an invalidation request.
  5. Revert the default domain's hosted zone TTL (example.com).

Note: At this point, your ACM certificate should be issued and the CloudFront resource successfully deployed.

2. Setup: Development

  1. Export the AWS development credentials to your environment.
  2. Configure necessary AWS resources with a new file under ./aws/<domain>.yml.
  3. (Optional) Configure subdomain AWS resources with another file under ./aws/<subdomain>.yml.
  4. (Optional) Use CloudFormation conditions in ./aws/cfnConditions.yml to deploy dev-only AWS resources.
  5. Reference this file(s) under ./serverless.yml in the resources section.
  6. Configure all required dev and prod parameters in ./serverless.yml in the custom.param.* section.
  7. Validate your configuration with the command npm run validate:dev.
  8. Deploy the AWS domain resources to your prod environment with the command npm run deploy:dev.

NOTE: You can also configure ./circleci/config.yml to automatically handle environment-specific deployments.

During the deployment process, remember the following steps to speed-up the deployment:

  1. Select the created ACM certificate (*.dev.example.com), and manually add the certificate records in the hosted zone you've created.
  2. Lower the domain's hosted zone TTL (dev.example.com), and revert them back once the changes are picked-up.
  3. Manually copy the domain's hosted zone NS records (dev.example.com), and paste them to your domain's hosted zone (example.com) in the production AWS account.
  4. If you are deploying a CloudFront resource, remember to initiate an invalidation request.
  5. Revert the default domain's hosted zone TTL (dev.example.com).

Note: At this point, your ACM certificate should be issued and the CloudFront resource successfully deployed.

domains's People

Contributors

gilbertly avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.