nikovirtala / cdk-amplify-console

Configure AWS Amplify Console deployment using AWS CDK

Home Page:https://amplified.host

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Configure AWS Amplify Console with AWS CDK

TL;DR

In this example, I'll show you how to configure AWS Amplify Console using the AWS Cloud Development Kit (CDK).

This example enables the following configuration:

All this configuration is done on: lib/cdk-amplify-console-stack.ts

The sample code reads the GitHub Personal Access Token from AWS Secrets Manager. You can store the secret there, using the following CLI command:

aws secretsmanager create-secret --name github-access-token --secret-string <github-personal-access-token>

The Stack

AWS Amplify Console

The AWS Amplify Console provides a Git-based workflow for hosting fullstack serverless web apps with continuous deployment. A fullstack serverless app consists of a backend built with cloud resources such as GraphQL or REST APIs, file and data storage, and a frontend built with single page application frameworks such as React, Angular, Vue, or Gatsby.

AWS Amplify Console supports common Single Page App (SPA) frameworks (e.g. React, Angular, Vue.js, Ionic, Ember), as well as static-site generators like Gatsby, Eleventy, Hugo, VuePress, and Jekyll.

AWS Cloud Development Kit

The AWS Cloud Development Kit (AWS CDK) is a software development framework for defining your cloud infrastructure in code and provisioning it through AWS CloudFormation.

In my example we use Typescript, and the project was inited with the command: cdk init app --language typescript

aws-amplify CDK Module

In this example we use aws-amplify CDK module.

GitHub Actions

To-Do

  • Complete the GitHub Actions workflow

Useful commands

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

About

Configure AWS Amplify Console deployment using AWS CDK

https://amplified.host

License:MIT License


Languages

Language:TypeScript 79.0%Language:JavaScript 21.0%