@dawaltconley/contact-api

0.2.4 • Public • Published

AWS Contact Api

A serverless application for handling contact form requests.

Template

This project uses AWS CloudFormation templates by way of the Serverless Application Model (SAM). Refer to the template documentation for a complete list of template parameters, resources, and outputs.

Usage

This project can be installed and deployed in a number of ways.

As a nested CloudFormation template

The npm distribution packages the build artifacts from sam build for use in a regular CloudFormation stack. Install these and then reference them in your CloudFormation template.

npm install -D @dawaltconley/contact-api
# ...

Resources:
  ContactFormApi:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: 
      ./node_modules/@dawaltconley/contact-api/dist/build/template.yaml
      Parameters:
        Email: 'name@example.com'
        Honeypot: 'foo,bar'
        AllowOrigin: '*'

#...

You can then package and deploy like you would with any nested template. This requires the CAPABILITY_IAM and CAPABILITY_AUTO_EXPAND capabilities.

aws cloudformation package \
  --template-file $TEMPLATE \
  --s3-bucket $BUCKET \
  --output-template-file $OUTPUT
aws cloudformation deploy \
  --template-file $OUTPUT \
  --stack-name $STACK_NAME \
  --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND

As a standalone project

If you have SAM installed, you can deploy directly from the repository.

git clone https://github.com/dawaltconley/contact-api
cd contact-api
sam build
sam deploy --guided

Package Sidebar

Install

npm i @dawaltconley/contact-api

Weekly Downloads

6

Version

0.2.4

License

MIT

Unpacked Size

2.25 MB

Total Files

7

Last publish

Collaborators

  • dawaltconley