Skip to content

Commit

Permalink
bit more content to lambda quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeeu committed Nov 15, 2023
1 parent a1eb011 commit 002ff34
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion content/en/get-started/lambda/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ description: A sample function for deployment using CD-as-a-Service

### Add a canary strategy

A strategy defines how CD-as-a-Service deploys your Lambda function to a target.

A [canary strategy]({{< ref "deployment/strategies/canary.md" >}}) is a linear sequence of steps. The `setWeight` step defines the ratio of traffic between function versions.

<!-- change this once traffic split is supported -->
Add a basic [canary strategy]({{< ref "deployment/strategies/canary" >}}) with a single step that sets the weight to 100.

Expand All @@ -153,14 +157,16 @@ strategies:

### Add targets

In CD-as-a-Service, a `target` is an (AWS Account, region) pair.

```mermaid
flowchart LR
A[dev] --> B[staging]
B --> C[prod-west-1]
B --> D[prod-west-2]
```

CD-as-a-Service deploys your Lambda function from your S3 bucket to the `dev` target first. You want a linear, success-dependent progression from `dev` to `prod`, so there is a `dependsOn` constraint for staging and prod targets. `staging` depends on `dev` and the prod targets depend on `staging`.
When deploying to multiple targets, you can specify dependencies between targets using the `constraints.dependsOn` field. CD-as-a-Service deploys your Lambda function from your S3 bucket to the `dev` target first. You want a linear, success-dependent progression from `dev` to `prod`, so there is a `dependsOn` constraint for staging and prod targets. `staging` depends on `dev` and the prod targets depend on `staging`.

Add the four targets, one in each region:

Expand Down Expand Up @@ -356,6 +362,14 @@ Go to the `us-east-1` Lamba section of your AWS Account. You should see your de

{{< figure src="function-test.webp" >}}


## Clean up

1. Delete the deployed Lambda functions from each region.
1. Delete the Lambda zip files from each S3 bucket. Delete each S3 bucket.
1. Delete the CloudFormation Stack. This also deletes the associated IAM Role.


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

Check warning on line 373 in content/en/get-started/lambda/index.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/get-started/lambda/index.md#L373

[Google.Headings] '{{% heading "nextSteps" %}}' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] '{{% heading \"nextSteps\" %}}' should use sentence-style capitalization.", "location": {"path": "content/en/get-started/lambda/index.md", "range": {"start": {"line": 373, "column": 4}}}, "severity": "WARNING"}

* {{< linkWithTitle "integrations/ci-systems/gh-action.md" >}}
Expand Down

0 comments on commit 002ff34

Please sign in to comment.