Skip to content

Commit

Permalink
make sure AWS Lambda is always first; added clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeeu committed Nov 27, 2023
1 parent ea2350d commit 35f6861
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion content/en/deployment/lambda/create-iam-role-lambda.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: >

## {{% heading "prereq" %}}

Check warning on line 9 in content/en/deployment/lambda/create-iam-role-lambda.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/deployment/lambda/create-iam-role-lambda.md#L9

[Google.Headings] '{{% heading "prereq" %}}' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] '{{% heading \"prereq\" %}}' should use sentence-style capitalization.", "location": {"path": "content/en/deployment/lambda/create-iam-role-lambda.md", "range": {"start": {"line": 9, "column": 4}}}, "severity": "WARNING"}

Make sure you have [installed the CD-as-a-Service CLI]({{< ref "cli" >}}), which you can use to generate a deployment template.
Make sure you have [installed the CD-as-a-Service CLI]({{< ref "cli" >}}), which you use to load the AWS Cloud Formation template into your AWS Account.

## Create the Armory IAM role

Expand Down
16 changes: 9 additions & 7 deletions content/en/deployment/lambda/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CD-as-a-Service starts a deployment with a target environment, which is a combin

CD-as-a-Service automatically rolls back when:

* There is an error deploying your Lambda function
* There is an error deploying your AWS Lambda function
* Deployment fails to finish within 30 minutes
* A webhook fails
* You configured your retrospective analysis step to automatically rollback
Expand All @@ -31,13 +31,13 @@ CD-as-a-Service automatically rolls back when:
How CD-as-a-Service performs rollbacks:

* If you have specified an [AWS Lambda alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) to use for routing traffic, CD-as-a-Service points the alias to the old version.
* If you have not specified an alias to use for routing traffic, CD-as-a-Service publishes a new version with the old configuration, so that the 'latest' version of your Lambda function has the same configuration as before the deployment started.
* If you have not specified an alias to use for routing traffic, CD-as-a-Service publishes a new version with the old configuration, so that the live version of your AWS Lambda function has the same configuration as before the deployment started.

## How CD-as-a-Service integrates with AWS

Check warning on line 36 in content/en/deployment/lambda/overview/index.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/deployment/lambda/overview/index.md#L36

[Google.Headings] 'How CD-as-a-Service integrates with AWS' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'How CD-as-a-Service integrates with AWS' should use sentence-style capitalization.", "location": {"path": "content/en/deployment/lambda/overview/index.md", "range": {"start": {"line": 36, "column": 4}}}, "severity": "WARNING"}

{{< include "lambda/iam-role.md" >}}

You need to store your function zip files in an S3 bucket, and the S3 bucket should be in the same region you deploy to (this is an AWS limitation). For example, if you plan to deploy to three regions, you need three S3 buckets, one for each region. CD-as-a-Service deploys your Lambda function's archive from your S3 bucket.
You need to store your function zip files in an S3 bucket, and the S3 bucket should be in the same region you deploy to (this is an AWS limitation). For example, if you plan to deploy to three regions, you need three S3 buckets, one for each region. CD-as-a-Service deploys your AWS Lambda function's archive from your S3 bucket.

| AWS Accounts | ArmoryRole | Regions | S3 Buckets |
|--------------|-----------|---------|------------|
Expand All @@ -46,7 +46,7 @@ You need to store your function zip files in an S3 bucket, and the S3 bucket sho
| 4 | 4 | 4 | 4 |
| 2 | 2 | 6 | 6 |

For each Lambda function you want to deploy, CD-as-a-Service needs the following:
For each AWS Lambda function you want to deploy, CD-as-a-Service needs the following:

1. **ArmoryRole** ARN
1. Region
Expand Down Expand Up @@ -216,7 +216,7 @@ targets:

### Artifacts

An _artifact_ is your AWS Lambda function name and the S3 path to the function's archive.
An _artifact_ is your AWS Lambda function name and the S3 path to the function's archive. You should have an entry for each deployment target region. The `functionName` is unique for each entry in the `artifacts` collection.

```yaml
artifacts:
Expand Down Expand Up @@ -259,11 +259,13 @@ providerOptions:
runtime: python3.10
```

Be sure to view the [AWS Lambda Quickstart]({{< ref "get-started/lambda" >}}) and [config file reference]({{< ref "reference/deployment/config-file/artifacts" >}}) for additional examples.

### Strategies

A deployment strategy is the method by which CD-as-a-Service deploys your changes to a target. Strategies can use different techniques to allow for rapid rollback should a problem be discovered, minimizing the impact of potential issues to a small subset of users. You could also use a strategy optimized for speed.

For AWS Lambda, CD-as-a-Service supports a canary deployment strategy, which involves releasing a new software version to a small subset of users or systems while leaving the majority on the current version. This strategy allows for real-world testing and monitoring of the new version's performance and stability.
For AWS Lambda deployments, CD-as-a-Service supports a canary deployment strategy, which involves releasing a new software version to a small subset of users or systems while leaving the majority on the current version. This strategy allows for real-world testing and monitoring of the new version's performance and stability.
If the canary users experience positive results, the new version can be gradually rolled out to a wider audience.

This example **routes 100% of traffic** to the **new version**. You’d use this `allAtOnce` strategy to initially deploy your function to AWS Lambda when the function does not exist in the AWS Lambda console. **This strategy is also useful in non-production environments such as staging.**
Expand All @@ -281,7 +283,7 @@ For subsequent deployments, you could use a canary strategy that splits traffic.

>You must create the alias in the AWS Lambda console before using the alias in your CD-as-a-Service deployment.

This example uses a canary strategy that splits traffic. You declare your function's alias in the `trafficManagement` section. There are two entries in the `trafficManagement` section since both staging and prod targets use the traffic split strategy.
This example is for deployment to multiple regions in a single AWS Account. The canary strategy splits traffic. You declare your function's alias in the `trafficManagement` section. There are two entries in the `trafficManagement` section since both staging and prod targets use the traffic split strategy.

{{< readfile file="/includes/code/lambda-traffic-split-snippet.yaml" code="true" lang="yaml" >}}

Expand Down
2 changes: 1 addition & 1 deletion content/en/get-started/lambda/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ CD-as-a-Service has four kinds of constraints that you can use to control your d
- [External Automation (Webhooks)]({{< ref "webhooks/overview.md" >}}) to run integration tests and security audits or send notifications
- [Automated Canary Analysis]({{< ref "deployment/strategies/canary" >}})

You can use these constraints between environments and within environments. During your next deployment, you want to issue a manual approval before deploying to to the prod targets. Add an `afterDeployment` constraint with a manual judgment to your `staging` target:
You can use these constraints between environments and within environments. During your next deployment, you want to issue a manual approval before deploying to to the prod targets. Add to your `staging` target an `afterDeployment` constraint with a manual judgment:

{{< highlight yaml "linenos=table,hl_lines=15-17" >}}
targets:
Expand Down
7 changes: 3 additions & 4 deletions content/en/reference/deployment/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,13 @@ armory template kubernetes [template-type] > deployment-template.yaml

## Deployment config file examples

### Kubernetes

{{< include "dep-file/k8s-skeleton-config.md" >}}

### AWS Lambda

Check warning on line 65 in content/en/reference/deployment/_index.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/reference/deployment/_index.md#L65

[Google.Headings] 'AWS Lambda' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'AWS Lambda' should use sentence-style capitalization.", "location": {"path": "content/en/reference/deployment/_index.md", "range": {"start": {"line": 65, "column": 5}}}, "severity": "WARNING"}

{{< include "dep-file/lambda-skeleton-config.md" >}}

### Kubernetes

{{< include "dep-file/k8s-skeleton-config.md" >}}

Check failure on line 71 in content/en/reference/deployment/_index.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/reference/deployment/_index.md#L71

[Google.Units] Put a nonbreaking space between the number and the unit in '8s'.
Raw output
{"message": "[Google.Units] Put a nonbreaking space between the number and the unit in '8s'.", "location": {"path": "content/en/reference/deployment/_index.md", "range": {"start": {"line": 71, "column": 24}}}, "severity": "ERROR"}

## {{% heading "nextSteps" %}}

Expand Down
4 changes: 2 additions & 2 deletions content/en/reference/deployment/config-file/artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ artifacts:
* `path`: The S3 path to your function's zip file
* `type`: This value is always `zipFile`. CD-as-a-Service does not support deploying AWS Lambda containers.

If you want to deploy to multiple regions in the same AWS Account, your `functionName` should be unique for the region.
>If you want to deploy to multiple regions in the same AWS Account, your `functionName` should be unique for each region.

In this example, you deploy a function called `just-sweet-potatoes` to four regions in the same AWS Account:

Expand Down Expand Up @@ -155,7 +155,7 @@ providerOptions:
runtime: python3.10
```

## Multiple AWS Account example
## Multiple AWS Accounts example

Check warning on line 158 in content/en/reference/deployment/config-file/artifacts.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/reference/deployment/config-file/artifacts.md#L158

[Google.Headings] 'Multiple AWS Accounts example' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Multiple AWS Accounts example' should use sentence-style capitalization.", "location": {"path": "content/en/reference/deployment/config-file/artifacts.md", "range": {"start": {"line": 158, "column": 4}}}, "severity": "WARNING"}

This illustrates deploying a function to the same region in multiple AWS Accounts.

Expand Down

0 comments on commit 35f6861

Please sign in to comment.