AWS Serverless Express sample with CI/CD(CircleCI)
CircleCI を利用したServerless Expressの動作サンプルです
- AWS Serverless Express sample
- deploy from CircleCI
- CircleCI 0.1.5607+f705856+
- yarn 1.10.1+
- node 10.10.0+
- aws-cli 1.11.129+
- aws-sam 0.16.1+
fork this repository
- add Circle CI IAM User for deploying from CI
- generate Access Key(Copied)
- Add your CircleCI Project. (build failed, but no problem)
- Go settings, add AWS Permissions
- Go settings, add Environment Variable
- AWS_ACCOUNT_ID: your aws account id
- AWS_REGION: region for deploy
- SERVERLESS_EXPLESS_BUCKET: bucket name for upload
Finaly, rebuild CircleCi workflow.
After the setup steps completes, open the AWS CloudFormation console https://console.aws.amazon.com/cloudformation/home and switch to the region you specified. Select the AwsServerlessExpressStack
stack, then click the ApiUrl
value under the Outputs section - this will open a new page with your running API. The API index lists the resources available in the example Express server (app.js
), along with example curl
commands.
If you would prefer to delete AWS assets that were just created, run like bellow.
$ npm run config -- --account-id="$AWS_ACCOUNT_ID" \
--bucket-name="$SERVERLESS_EXPLESS_BUCKET" \
--region="$AWS_REGION"
$ npm run delete-stack
$ npm run delete-bucket