Erik Erikson 34f4b5a3cc Tighten Log Rights/iamRoleARN=>role,roleArn/Add Docs
Switch from an all lambdas logging resource IAM policy to one that targets specifically and only those CloudWatch logs produces by the lambdas declared by the service.
Modify tests to ensure this is properly done.

Introduce a `role` property that specifies a role defined within the service.
Update tests to ensure this is properly used
Update documentation to describe this

Replace `iamRoleARN` with `roleArn`
Update tests and documentation to reflect this

Add Decision Trees describing the decision points and considerations between individual function rights and shared rights models
2016-09-13 17:06:00 -07:00
..
2016-08-24 11:37:19 +02:00

Deploy

This plugin (re)deploys the service to AWS.

How it works

Deploy starts by hooking into the deploy:setupProviderConfiguration lifecycle. It fetches the basic CloudFormation template from lib/templates and replaces the necessary names and definitions with the one it gets from the serverless.yml file.

Next up it deploys the CloudFormation template (which only includes the Serverless S3 deployment bucket) to AWS.

In the end it hooks into deploy:deploy lifecycle to update the previously created stack.

The resources section of the serverless.yml file is parsed and merged into the CloudFormation template. This makes sure that custom resources the user has defined inside the serverless.yml file are added correctly.

Note: Empty, but defined Resources or Outputs sections are set to an empty object before being merged.

Next up it removes old service directories (with its files) in the services S3 bucket. After that it creates a new directory with the current time as the directory name in S3 and uploads the services artifacts (e.g. the .zip file and the CloudFormation file) in this directory. Furthermore it updates the stack with all the Resources which are defined in serverless.service.resources.Resources (this also includes the custom provider resources).

The stack status is checked every 5 seconds with the help of the CloudFormation API. It will return a success message if the stack status is CREATE_COMPLETE or UPDATE_COMPLETE (depends if you deploy your service for the first time or redeploy it after making some changes).