Skip to content

Commit f7af65a

Browse files
authored
Adding Globals section and DeploymentPreference definition
1 parent 97a8ad9 commit f7af65a

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

versions/2016-10-31.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ In order to include objects defined by AWS SAM within a CloudFormation template,
3030
- [Resource types](#resource-types)
3131
- [Event source types](#event-source-types)
3232
- [Property types](#property-types)
33+
- [Globals Section](#globals-section)
3334

3435

3536
### Example: AWS SAM template
@@ -48,6 +49,24 @@ Resources:
4849
4950
All property names in AWS SAM are **case sensitive**.
5051
52+
### Globals Section
53+
Lambda functions within a SAM template tend to have shared configuration such as Runtime, Memory, VPC Settings, Environment Variables etc. Instead of duplicating this information in every function, you can write them once in the Globals section and let all Functions inhert it.
54+
55+
Example:
56+
57+
```
58+
Globals:
59+
Function:
60+
Runtime: nodejs6.10
61+
Timeout: 180
62+
Handler: index.handler
63+
Environment:
64+
Variables:
65+
TABLE_NAME: data-table
66+
```
67+
68+
Read the [Globals Guide](../docs/globals.rst) for more detailed information.
69+
5170
### Resource types
5271
- [AWS::Serverless::Function](#awsserverlessfunction)
5372
- [AWS::Serverless::Api](#awsserverlessapi)
@@ -77,7 +96,7 @@ Tags | Map of `string` to `string` | A map (string to string) that specifies the
7796
Tracing | `string` | String that specifies the function's [X-Ray tracing mode](http://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html). Accepted values are `Active` and `PassThrough`
7897
KmsKeyArn | `string` | The Amazon Resource Name (ARN) of an AWS Key Management Service (AWS KMS) key that Lambda uses to encrypt and decrypt your function's environment variables.
7998
DeadLetterQueue | `map` <span>&#124;</span> [DeadLetterQueue Object](#deadletterqueue-object) | Configures SNS topic or SQS queue where Lambda sends events that it can't process.
80-
DeploymentPreference | [DeploymentPreference Object](../docs/safe_lambda_deployments.rst) | Settings to enable Safe Lambda Deployments
99+
DeploymentPreference | [DeploymentPreference Object](#deploymentpreference-object) | Settings to enable Safe Lambda Deployments. Read the [usage guide](../docs/safe_lambda_deployments.rst) for detailed information.
81100
AutoPublishAlias | `string` | Name of the Alias. Read [AutoPublishAlias Guide](../docs/safe_lambda_deployments.rst#instant-traffic-shifting-using-lambda-aliases) for how it works
82101

83102
##### Return values
@@ -487,3 +506,20 @@ DeadLetterQueue:
487506
Type: `SQS` or `SNS`
488507
TargetArn: ARN of the SQS queue or SNS topic to use as DLQ.
489508
```
509+
510+
#### DeploymentPreference Object
511+
Specifies the configurations to enable Safe Lambda Deployments. Read the [usage guide](../docs/safe_lambda_deployments.rst) for detailed information. The following shows all available properties of this object
512+
513+
```yaml
514+
DeploymentPreference:
515+
Enabled: true
516+
Type: Linear10PercentEvery10Minutes
517+
Alarms:
518+
# A list of alarms that you want to monitor
519+
- !Ref AliasErrorMetricGreaterThanZeroAlarm
520+
- !Ref LatestVersionErrorMetricGreaterThanZeroAlarm
521+
Hooks:
522+
# Validation Lambda functions that are run before & after traffic shifting
523+
PreTraffic: !Ref PreTrafficLambdaFunction
524+
PostTraffic: !Ref PostTrafficLambdaFunction
525+
```

0 commit comments

Comments
 (0)