Skip to content

Commit

Permalink
docs(lambda): update for alias creation (#97)
Browse files Browse the repository at this point in the history
CDAAS-3107
  • Loading branch information
aimeeu authored Dec 6, 2023
1 parent 6604991 commit af02774
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
13 changes: 13 additions & 0 deletions assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
/*
Add styles or override variables from the theme here.
https://www.docsy.dev/docs/adding-content/lookandfeel/#fonts
Docsy's default colors
$primary: #30638e !default;
$secondary: #ffa630 !default;
$success: #3772ff !default;
$info: #c0e0de !default;
$warning: #ed6a5a !default;
$danger: #ed6a5a !default;
$light: #d3f3ee !default; // TODO: consider using BS value
$dark: #403f4c !default; // TODO: consider using BS value
*/


Expand All @@ -23,6 +33,7 @@ https://www.docsy.dev/docs/adding-content/lookandfeel/#fonts

$primary: #001321;
$dark: #001321;
$info: #ffa62f;
$google_font_name: "Open Sans";
$google_font_family: "Open+Sans:300,300i,400,400i,700,700i";

Expand All @@ -34,6 +45,8 @@ $border_grey: #D7DDE3;
$container_spacing: 16px;
$mustard_yellow: #F3B722;



@mixin mobile {
@media (max-width: 500px) { @content; }
}
Expand Down
7 changes: 5 additions & 2 deletions content/en/deployment/lambda/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,16 @@ strategies:

For subsequent deployments, you could use a canary strategy that splits traffic. CD-as-a-Service uses your function's AWS Lambda [alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) when splitting traffic between versions.

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

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.

{{< include "lambda/alias-info.md" >}}

This example assumes you have already created an alias named `v2`

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



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

* Work through the [AWS Lambda Quickstart]({{< ref "get-started/lambda" >}}) to deploy a sample function to your AWS Account.
Expand Down
4 changes: 2 additions & 2 deletions content/en/includes/code/lambda-traffic-split-snippet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ trafficManagement:
- targets: ['prod-us-east-1']
alias:
- functionName: just-sweet-potatoes-us-east-1
aliasName: live-version
aliasName: v2
- targets: ['prod-us-east-2']
alias:
- functionName: just-sweet-potatoes-us-east-2
aliasName: live-version
aliasName: v2
7 changes: 7 additions & 0 deletions content/en/includes/lambda/alias-info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
---
{{% alert title="Important" color="info" %}}
* When CDaaS creates an alias as part of a deployment, it creates the alias at the end of the deployment.
* During the deployment that creates the alias, CD-as-a-Service ignores the `setWeight` steps for that function.
* You should only route traffic to the alias after the deployment has completed.
{{% /alert %}}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ description: >

You declare your AWS Lambda alias per target in this section. CD-as-a-Service uses [aliases](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) when routing traffic from the previous version to the latest version of your function.

CD-as-a-Service creates the alias if the alias doesn't already exist in AWS Lambda.

{{< include "lambda/alias-info.md" >}}

```yaml
trafficManagement:
- targets: ["<target-name>"]
Expand All @@ -22,7 +26,7 @@ trafficManagement:
* `targets`: the list of targets using this alias
* `functionName`: This is the same value as `artifacts.functionName` and `providerOptions.lambda.name`. See {{< linkWithTitle "reference/deployment/config-file/artifacts.md" >}} for details on those sections.
* `aliasName`: The alias name, such as "live-version". Your function's alias must already exist in the AWS Lambda console.
* `aliasName`: The alias name, such as "live-version". CD-as-a-Service creates the alias if it doesn't already exist in the AWS Lambda console.

This example declares a traffic split canary strategy. You must declare your function's alias for each deployment target that uses the traffic split strategy.

Expand Down

0 comments on commit af02774

Please sign in to comment.