API Gateway for CloudFormation

CloudFormation offers native support for API Gateway. This project is kept alive and offered as an alternative because I feel that the native resources aren't sufficient.

It's deployed via the CloudFormation Console and runs on AWS Lambda.
Follow me on Twitter to get the latest news and updates (and the occasional random tweet about something else).

Overview

This setup allows you to manage the majority of the API Gateway related resources.
The installation will create a Lambda function in the region corresponding to the template location in your AWS account. This Lambda function is a CloudFormation Custom Resource and acts as a liaison between CloudFormation and API Gateway.
Once the Lambda function has been installed you can start writing your CloudFormation templates using the resources described in this document.

If you want to learn more about CloudFormation, Custom Resources or API Gateway I suggest the following links:

Experimental resources

Some resources may be flagged as experimental which means that they haven't been tested thoroughly, it doesn't necessarily mean that they don't work.
If you use an experimental resource I am extra curious as to how it worked.

A note on terminology before we begin

Throughout this document there are references to resources and API Resources. It is very important to distinguish between the two:

  • A resource is a CloudFormation term and can refer to any AWS resource.
  • An API Resource is a specific type of AWS resource (Custom::ApiResource) and is called "Resource" in API Gateway.

Setup

Prerequisites

  • You need an Amazon AWS Account
  • You need an IAM user with the permissions described below

Setup IAM permissions

To be able to install the Custom Resource library you require a set of permissions. Configure your IAM user with the following policy:

Note: This Policy contains delete permissions. If you do not want to give these permissions you can omit the last block of permissions in the policy. If you do so, the IAM user won't be able to delete the installation.

                        {
                            "Version": "2012-10-17",
                            "Statement": [
                                {
                                    "Effect": "Allow",
                                    "Action": [
                                        "cloudformation:CreateStack",
                                        "cloudformation:DescribeStacks",
                                        "iam:CreateRole",
                                        "iam:CreatePolicy",
                                        "iam:AttachRolePolicy",
                                        "iam:GetRole",
                                        "iam:PassRole",
                                        "lambda:CreateFunction",
                                        "lambda:UpdateFunctionCode",
                                        "lambda:GetFunctionConfiguration",

                                        "cloudformation:DeleteStack",
                                        "lambda:DeleteFunction",
                                        "iam:ListPolicyVersions",
                                        "iam:DetachRolePolicy",
                                        "iam:DeletePolicy",
                                        "iam:DeleteRole"
                                    ],
                                    "Resource": [
                                        "*"
                                    ]
                                }
                            ]
                        }
                    

Install

  1. Pick the version you want from the Change log. The latest is usually the one you want.
  2. Copy the template link that corresponds to the region you want to deploy your Lambda in.
  3. Open your AWS CloudFormation Console and choose "Create stack".
  4. Select "Specify an Amazon S3 template URL" and paste the template link.
  5. Enter the Lambda memory allocation and execution timeout. The defaults should suffice.
  6. Approve the IAM resource creation and create the stack.

Update

Follow the steps above but instead of creating a new stack you update your existing stack. Note that you need to change the template URL when updating.

Uninstall

Simply delete the stack from your AWS CloudFormation Console.
Don't forget to revoke any obsolete IAM permissions you may have added during setup.

Resources

All resources accept a common parameter: lastModified. This parameter is optional but can be passed to a resource to force an update even if there are no changes to be made. This can be useful for certain resources such as ApiDeploy. Parameters that are not specified in the schemas will fail validation.

Custom::ApiImport Since v1.5.0

By using the Import API resource you define our entire API in swagger and import it in one go.
You can also utilize the import to make partial updates to an API by supplying a REST API Id in the request.
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#importRestApi-property
http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html

Update operations executed on non-partial APIs will overwrite the entire API, including resources added by partial updates.

If you use this resource to make partial updates of an API you will not be able to delete the resources or methods you define in the partial update.
Deleting a partial resource has no effect on the actual API.

However, since an update of the non-partial resource overwrites the entire API and the partial updates are applied afterwards, in effect, forcing an update of all API resources, partial and non-partial, will also delete any resources removed from partial APIs.

Parameters

JSON Schema

apiDefinition Required

Swagger definition of the REST API. Either the complete API or a partial API if you provide the restApiId parameter.

Type: Object
Update: No interruption

parameters Optional

Custom header parameters as part of the request.

Type: Object
Update: No interruption, partial support. You may add/change this property but not remove it.

failOnWarnings Optional

If set to true, the operation will fail on minor issues.

Type:String
Default:false
Update:No interruption.

restApiId Optional

If you provide a restApiId the resource will make a partial update to the REST API.

Type: String
Update: No interruption.

Custom::RestApi

Creates a new API Gateway REST API
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#createRestApi-property

Parameters

JSON Schema

name Required

Name of the REST API.

Type: String
Update: No interruption

description Optional

An optional description of your REST API.

Type: String
Update: No interruption, partial support. You may add/change this property but not remove it.

corsConfiguration Optional Since v1.6.0

If you supply cors configuration the parent resource in the API will enable CORS requests.
See API Resource corsConfiguration for detailed configuration options.

Type: Object
Update: No interruption

Custom::ApiResource

Creates a new API Resource in an existing API.
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#createResource-property

If you delete an API Resource from your CloudFormation template, all child resources are deleted by API Gateway. This may create certain data inconsistencies between the actual API and what is believed to be setup from the Custom Resource perspective. It's therefore recommend to remove any child resources associated with the API Resource you delete.

Parameters

JSON Schema

restApiId Required

Reference to the REST API in which you want to create this API Resource.

TypeString
UpdateNot supported

parentId Required

Id of the parent API Resource under which you want to place this API Resource. If you are creating a top level resource, use the parentResourceId output from Custom::RestApi.

Type: String
Update: No interruption, partial support. You may add/change this property but not remove it.

pathPart Required

The path suffix of this API Resource, appended to the full path of the parent API Resource.

Type: String
Update: No interruption, partial support. You may add/change this property but not remove it.

corsConfiguration Optional

If you supply cors configuration this API Resource will enable CORS requests.
For more information on CORS, please refer to http://www.w3.org/TR/cors/.
Changes made to the CORS configuration will have direct impact on the methods you list (or remove) in the CORS config. It will also create an OPTIONS method for you.

Type: Object
Update: No interruption

corsConfiguration.allowMethods Optional

A list of HTTP methods that allow CORS requests under this API Resource.

Breaking change in v2.0.0

You can no longer specify allowMethods: "*".
Instead, omit the property and it will default to all methods.

Type: String array
Default: All methods
Update: No interruption

corsConfiguration.allowHeaders Optional

A list of headers that the server should allow the user-agent to send in requests.
If this property is not set it will default to the headers that Amazon recommends: Content-Type,X-Amz-Date,Authorization,X-Api-Key.
If it is set it will override the default headers and exclude them. See corsConfiguration.allowDefaultHeaders for further details.

Type: String array
Update: No interruption

corsConfiguration.allowDefaultHeaders Optional

If you set corsConfiguration.allowHeaders and still want to include the default set of headers you can set this property to true and the default headers will be appended to the headers you specified in corsConfiguration.allowHeaders
The default headers are: Content-Type,X-Amz-Date,Authorization,X-Api-Key.

Type: Boolean
Update: No interruption

corsConfiguration.allowOrigin Optional

Origin from where CORS requests are allowed. If you omit it the origin will be set to * which means that any origin is allowed to call the API Resource.

Type: Object
Default: *
Update: No interruption

corsConfiguration.exposeHeaders Optional

A list of headers that are exposed to the client in the response.

Type:String array
Update:No interruption

corsConfiguration.maxAge Optional

Max age in seconds that a pre-flight check (OPTIONS) should be cached on the client.
If not supplied, the time that pre-flight requests are stored is at the discretion of the user agent.

Type: Integer
Update: No interruption

corsConfiguration.allowCredentials Optional

Sets the Access-Control-Allow-Credentials header to true if this configuration is set to true.

Type: Boolean
Default: False
Update: No interruption

Custom::ApiMethod

Creates a new Api Gateway Method including response, request and integration.
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#putMethod-property

Parameters

JSON Schema

restApiId Required

Reference id to the Rest API.

TypeString
UpdateNot supported

resourceId Required

Id of the API Resource on which the API Method should be applied.

TypeString
UpdateNo interruption

method Required

Method configuration container.

TypeObject
UpdateUpdate: Child properties may be changed according to documentation.

method.httpMethod Required

The HTTP verb that this method adheres to. E.g POST, GET etc.

TypeString
UpdateNo interruption

method.authorizationType Optional

API Method authorization type.
Set to CUSTOM if you want to use an API Authorizer.

TypeString
DefaultNONE
UpdateNo interruption

method.authorizerId Optional

Authorizer Id if method.authorizationType is set to CUSTOM.

TypeString
UpdateNo interruption

method.apiKeyRequired Optional

Set to true if this API Method requires an API Key.

TypeString
Defaultfalse
UpdateNo interruption

method.requestModels Optional

Specifies the Model resources used for the request's content type.
Request models are represented as a key/value map, with a content type as the key and a Model name as the value.

TypeMap{String(content-type)},String(model-name)}
UpdateNo interruption

method.parameters Optional

Represents request parameters that are sent with the backend request.
Request parameters are represented as a string array of parameter destinations.
The destination must match the pattern {location}.{name}, where {location} is either querystring, path, or header. {name} must be a valid, unique parameter name.

TypeString Array
UpdateNo interruption

integration Required

Backend integration configuration.
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#putIntegration-property

TypeObject
UpdateNot available

integration.type Required

Backend type.

TypeString
UpdateNo interruption

integration.credentials Optional

AWS credentials used to invoke the (AWS) backend.

TypeString
UpdateNo interruption

integration.cacheNamespace Optional

Integration input cache namespace.

TypeString
UpdateNo interruption

integration.cacheKeyParameters Optional

Integration input cache keys.

TypeString Array
UpdateNo interruption

integration.httpMethod Conditional

HTTP method of the backend integration request.
Must be set if the integration.type is not set to MOCK.

TypeString
UpdateNo Interruption

integration.passthroughBehaviour Optional Since v2.0.0

Request pass-through behaviour

TypeString
DefaultWHEN_NO_MATCH
UpdateNo interruption

integration.requestTemplates Optional

Specifies the templates used to transform the method request body.
Request templates are represented as a key/value map, where the key is the content-type and the value is a template.

For simple mappings the template can be expressed as a JSON object. More complex templates can be expressed as a string.

Breaking change in v2.0.0

As of version 2.0.0 you can no longer specify input-pass-through or input-pass-through-full. Use the passthroughBehaviour property instead.
Type
  • Map[String{content-type},String{template}] or
  • Map[String{content-type},Object{template}] or
  • String input-pass-through|input-pass-through-full or
  • Array where the first position is String input-pass-through|input-pass-through-full and the second is a custom JSON object or valid JSON string that is appended to the backend request.
UpdateNo interruption

integration.requestParameters Optional

Represents request parameters that are sent with the backend request.
Request parameters are represented as a key/value map, with a destination as the key and a source as the value.
A source must match an existing method request parameter, or a static value.
Static values must be enclosed with single quotes, and be pre-encoded based on their destination in the request.
The destination must match the pattern integration.request.{location}.{name}, where location is either querystring, path, or header. name must be a valid, unique parameter name.

TypeMap{String(destination)},{String(source)}
UpdateNot supported

integration.uri Conditional

URI to the backend service. Can be a url to another service, a Lambda ARN etc.
Must be set if integration.type is not set to MOCK.

TypeString
UpdateNo interruption

responses Optional

Configurations for both the IntegrationResponses and the MethodResponses.
The key is the selection pattern used to map the response to a status code.
There should be one selection pattern with the value "default" which acts as the default response. The value is a response configuration object.

http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#putIntegrationResponse-property http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#putMethodResponse-property

TypeMap{String,Object}
UpdateNot available

response.statusCode Required

The HTTP Status Code that this response configuration maps to.
Must be unique within the scope of each API Method definition.

TypeInteger
UpdateNo interruption

response.headers Optional

Map of headers where the key is the header name and value is the source, or static value of the header.
Static values are specified using enclosing single quotes, and backend response headers can be read using the pattern integration.response.header|body.{name}.
CORS headers should not be specified as they are added automatically if CORS is enabled on the API Resource.

The key should only be the name of the header that will be exposed to the client.
TypeMap{String(header name),String}
UpdateNo interruption

response.responseTemplates Optional

Specifies the templates used to transform the integration response body.
Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
The template can be represented as a JSON string or a JSON object.
A template represented by an empty string is the equivalent of output pass-through.

TypeMap{String,String} or Map{String,Object}
UpdateNo interruption

response.responseModels Optional

Specifies the Model resources used for the response's content type.
Response models are represented as a key/value map, with a content type as the key and a Model name as the value.

Type Map{String(content-type)},{String(model-name)}
UpdateNo interruption

Custom::ApiModel

Creates a new Api Gateway Model. http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#createModel-property

Parameters

JSON Schema

restApiId Required

Reference id to the Rest API.

TypeString
UpdateNo interruption

name Required

Name of the model

TypeString
UpdateNot supported

contentType Optional

The content-type for the model.

TypeString
Defaultapplication/json
UpdateNot supported

description Optional

Description of the model.

TypeString
UpdateNo interruption

schema Optional

The model schema. This can be represented by either a JSON Schema object or a stringified JSON Schema object.

TypeString
DefaultEmpty object
UpdateNo interruption

Custom::ApiDomainName Since v1.2.0

Creates a new Api Gateway Domain Name.
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#createDomainName-property

Once the domain name has been created you have to create a Route53 alias record that points to
{ "Fn::GetAtt": ["TestApiDomainName", "distributionDomainName"] }

Parameters

JSON Schema

domainName Required

The name of the DomainName resource.

TypeString
UpdateNot supported

certificateName Required

The name of the certificate.

TypeString
UpdateNot supported

iamServerCertificateName Conditional

A name reference to an existing certificate that ahs already been uploaded to IAM.
Note: The IAM certificate must have a valid chain.

You have to specify the iamServerCertificateName or the certificateBody and certificateChain

TypeString
UpdateNo interruption

certificateBody Conditional

The body of the server certificate provided by your certificate authority.

You have to specify the the certificateBody and certificateChain or an iamServerCertificateName

Type
  • A single line where " " (space) denotes a new line (header/footer are excepted):
    -----BEGIN CERT-----line1 line2 ... -----END CERT-----
  • A single line where "\n" denotes a new line:
    -----BEGIN CERT-----line1\nline2\n...\n-----END CERT-----
UpdateNo interruption

certificateChain Conditional

The certificate chain provided by your certificate authority.

You have to specify the the certificateBody and certificateChain or an iamServerCertificateName

Type
  • A single line where " " (space) denotes a new line (header/footer are excepted):
    -----BEGIN CERT-----line1 line2 ... -----END CERT-----
  • A single line where "\n" denotes a new line:
    -----BEGINCERT-----line1\nline2\n...\n-----END CERT-----
UpdateNot supported

certificatePrivateKey Required

Your certificate's private key.

Type
  • A single line where " " (space) denotes a new line (header/footer are excepted):
    -----BEGIN RSA PRIVATE KEY-----line1 line2 ... -----END RSA PRIVATE KEY-----
  • A single line where "\n" denotes a new line:
    -----BEGIN RSA PRIVATE KEY-----line1\nline2\n...\n-----END RSA PRIVATE KEY-----
UpdateNot supported

Custom::ApiBasePathMapping Since v1.2.0

Creates a new Api Gateway Base Path Mapping
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#createBasePathMapping-property

When you create an ApiBasePathMapping your API will be automatically deployed to the stage you've provided.
If the stage does not exist it will be created for you. However, if you delete the ApiBasePathMapping the stage will not be deleted and your API will remain deployed at the given stage.
Because creating a BasePathMapping will automatically deploy your API you have to ensure that it DependsOn all methods created in the API.

Parameters

JSON Schema

domainName Required

The domain name of the BasePathMapping resource to create.

TypeString
UpdateNot supported

restApiId Required

Reference to the REST API in which you want to create this API Base Path Mapping.

TypeString
UpdateNo interruption

basePath Optional

The base path name that callers of the API must provide as part of the URL after the domain name.
This value must be unique for all of the mappings across a single API.
Exclude this if you do not want callers to specify a base path name after the domain name.

The basePath replaces the stage name the ApiBasePathMapping is connected to in the url, even if you leave it empty.

If you exclude this parameter, or leave it empty, you can only create one base path mapping for the given Rest API.

TypeString
DefaultEmpty string
UpdateNo interruption

stage Required

The name of the API stage that you want to use for this mapping.

TypeString
UpdateNo interruption

Custom::ApiAuthorizer Since v1.0.4

Creates a new Api Gateway Authorizer
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#createAuthorizer-property

Parameters

JSON Schema

authorizerUri Required

Authorizer Api Gateway Lambda function invocation ARN.
E.g: arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:1234:function:LambdaName/invocations

TypeString
UpdateNo interruption

identitySource Required

Source header from where the token can be read.
Must match the regexp method.request.header.[a-zA-Z0-9._-]+

TypeString
UpdateNo interruption

name Required

Name of the Authorizer.

TypeString
UpdateNo interruption

restApiId Required

The Rest API this authorizer will be linked to.

TypeString
UpdateNot supported

authorizerCredentials Optional

Authorizer credentials, if any.

TypeString
UpdateNo interruption

authorizerResultTtlInSeconds Optional

The TTL of cached authorizer results.

TypeInteger
Default300
UpdateNo interruption

identityValidationExpression Optional

Optional RegEx statement for API Gateway to validate the input token before calling the authorizer.
This helps you avoid, or reduce the risk of, processing invalid tokens.

TypeString
UpdateNo interruption

Custom::ApiDeploy Since v1.5.0

API Deployments can be managed via the AWS Console, the AWS CLI or any AWS SDK.
However, this resource is provided as an alternative if you want to manage deployment via CloudFormation. This resource will create a new deployment and set the desired stage configuration.

As previously mentioned, your API is deployed when you create a Base Path Mapping. If you provide the same stage name to this resource your API will be deployed to the same stage but with additional configuration options.
From this perspective you can look at this resource as a way to configure your stage instead of a way to manage your deployments.
It comes down to taste.
Only resources that have been created are made available when you deploy your API. This means that this resources has to depend on every API Method you want to be included in the deploy.
This can be tricky as this list can be long but one strategy to resolve this is to put your resource and method definitions in a sub-stack and let this resource depend on that sub-stack only.
Deleting this resource has no practical effect. The API Stage will remain and the API will still be deployed.

Breaking change in v2.0.0

The stageConfig property has been flattened, see below.

For further details, please refer to these documents: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#createDeployment-property http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#updateStage-property

Parameters

JSON Schema

restApiId Required

The Rest API you want to deploy.

TypeString
UpdateNot supported

stageName Required

The name of the stage you want to deploy to. If the stage does not exist it will be created.

You may change the name of the stage but that will have no impact on the existing stage, thus the existing stage will remain deployed.
TypeString
UpdateNo interruption

stageDescription Optional

Stage description

TypeString
UpdateNo interruption but you can't remove it once set.

cacheClusterEnabled Optional

Set to true to enable API caching

TypeBoolean
Defaultfalse
UpdateNo interruption but you can't remove it once set.

cacheClusterSize Optional

Cache cluster size

TypeDouble, one of 0.5 | 1.6 | 6.1 | 13.5 | 28.4 | 58.2 | 118 | 237
UpdateNo interruption but you cannot remove it once set.

stageVariables Optional

Key/value map of stage variables where the key is the name of the variable and the value is the value of that variable.

TypeMap{String, String}
UpdateNo interruption

methodSettings Required

Method settings, global for the stage or specific for a method.

Known Issue

Due to a defect in API Gateway you cannot remove a method setting.
Once it is set you have to keep the setting with the exact path which in effect mean that to disable a setting you have to change the value, not remove it.
If you accidentally remove a setting or a path is changed the existing setting will not be removed by the Custom Resource.

Known Issue

A secondary issue in API Gateway is that any method specific setting (ie path = {resourcePath}/{httpVerb}/...) are prefixed with ~1. This will hopefully be fixed in the future which means that the actual paths will be changed in the future. The impact of this cannot be predicted at this time so you use this resource at your own risk for the time being.
TypeMap{String, Mixed}
UpdateNo interruption

Change Log

2.2.0 (2017-05-02)

  • New Added paramter for Lambda ARN (ServiceToken) Export name. Issue #51

2.0.1 (2016-07-21)

  • Fix API Domain Name certificate chains now supports multiple cerificates. Issue #49

2.0.0 (2016-07-12)

  • Breaking change Moved request validation to JSON Schema and with this, some validation is stricter than before. This should not affect correctly configured APIs unless specifically mentioned below.
  • Breaking change Removed support for shorthand pass-through templates. Use ApiMethod::.integration.passthroughBehaviour instead.
  • Breaking change ApiDeploy interface has changed slightly. The wrapper object stageConfig has been flattened.
  • Breaking change corsConfiguration.allowMethods no longer allows the value "*". Instead, you can omit the property and it will default to all methods.
  • New Added region: ap-southeast-2 (Sydney)
  • New Support for ApiMethod::.integration.passthroughBehaviour
  • New Parametrized NodejsRuntime, CodeBucket & CodeKey.
  • New Added and cleaned up the example templates.
  • Clean up Updated several npm dependencies including the aws-sdk
  • Clean up Updated several eslint and the eslint rule set
  • Clean up Renamed all files to dash-case

Upgrade Notes

  • Do not update the NodejsRuntime to nodejs4.3 on existing installations as this will break your APIs. Only use nodejs4.3 for new installations.
  • The new parameters, CodeBucket & CodeKey, should only be used if you want to build your own packages from source and not use the provided ones.

1.7.1 (2016-05-23)

  • Fix If an API Method failed to create due to a Conflict Exception the existing API Method was subsequently deleted by a too eager resource identification algorithm.

1.7.0 (2016-04-22)

  • New Increased AWS SDK retries to 32 and max interval to 5000ms to accomodate complex API deploys.

Upgrade Notes

If you are upgrading from a previous version, ensure that you increase the ExecutionTimeout parameter in CloudFormation to 180 to ensure that the Lambda doesn't timeout prematurely. This change will not have any notable impact on existing deploys but if your deploy is very complex the extra time may be needed to ensure that all resources are created.

1.6.0 (2016-04-20)

  • New Enable CORS on the parent API Resource by specifiying CORS settings on Custom::RestApi.

1.5.1 (2016-04-20)

  • Fix Stripped methodResponses, methodIntegration.integrationResponses, methodIntegration.requestTemplates and requestModels from the ApiMethod response.

1.5.0 (2016-04-10)

  • New Support for API import using swagger definitions with the new Custom::ApiImport resource.
  • New Manage deployment and stage configuration via the new Custom::ApiDeploy resource.

1.4.2 (2016-03-31)

  • Fix Ensure that the server certificate body & chain are set when getting certificate from IAM. Issue #35.

1.4.1 (2016-03-29)

  • New Added custom configuration object to be passed along with input-pass-through request templates.
  • Fix Changed default Lambda timeout to 30 seconds from previous 10.
  • Clean up Parameter validation throws errors rather than returning them.

1.4.0 (2016-03-24)

  • New Introducing ready-made pass-through templates for method integration request templates. @See Create an API Method.
  • Fix Improved CloudFormation error messages to give a direct indication to what went wrong in the AWS Console.

1.3.4 (2016-03-22)

  • New Allow CORS wildcard methods

1.3.3 (2016-03-18)

  • New Added support for eu-central-1

1.3.2 (2016-03-18)

  • Fix Moved support from us-west-1 to us-west-2

1.3.1 (2016-03-17)

  • Fix TooManyRequestsException not caught properly

1.3.0 (2016-03-17)

  • New Allow Api Domain name creation by specifying an IAM Server Certificate Name instead of the certificateBody & certificateChain.

1.2.1 (2016-03-14)

  • Fix Allow deletion of Api Resources that failed to create.

1.2.0 (2016-03-13)

  • New Deploy procedure via CFN instead of bash/powershell
  • New API BasePathMappings and Custom Domain Names
  • Fix Improved error logging when AWS calls fails

1.1.6 (2016-02-26)

This version is no longer supported.
  • Clean up Added error logging to deploy script.

1.1.4 (2016-02-21)

This version is no longer supported.
  • New Added installation scripts for windows (powershell).

1.1.3 (2016-02-21)

This version is no longer supported.
  • New Added installation scripts for unix that do not require npm or node to be installed.

1.1.0 (2016-02-19)

This version is no longer supported.
  • New Introduced installation package so that you no longer have to clone the repo to install and deploy.

1.0.4 (2016-02-18)

This version is no longer supported.

1.0.2 (2016-02-18)

This version is no longer supported.
  • Fix Ensure that moving an API Method to another resource cleans up the old method.

1.0.1 (2016-02-17)

This version is no longer supported.
  • New Removed Dynamo table for tracking resources, now tracked via the PhysicalResourceId. PR #4
  • New Added sample template for testing
  • New Installation packages and installation template is hosted on S3.
  • Fix Added backoff and retries if failure due to concurrent modifications. PR #5
  • Fix No longer validating parameters on delete. PR #3
  • Clean up Rewrote installation and deploy scripts in nodejs and npm.
  • Clean upImproved the README

0.0.1 (2016-01-04)

This version is no longer supported.
  • New Initial release

Contribute

I gladly accept PRs, issues and comments. Anything that will help improve stability, reduce complexity or add more functionality is appreciated. Please make sure that make testcode> does not fail before you push your PR. There are strict requirements on eslint and 100% unit test coverage for builds to succeed before they can be published.

Testing

I highly recommend that you deploy your changes and test them in a real environment before submitting the PR.
To package and deploy your changes manually, follow these steps:

  1. npm install --production
  2. zip -r source.zip lib/* lib/*/** node_modules/*/**
  3. Go to the AWS Console -> Lambda -> {Your API Gateway function} -> Code -> Upload a .ZIP file (select source.zip)

Issues

Open issues can be found at the Github page.

License

The MIT License (MIT)

Copyright (c) 2016 By Nordenfelt

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.