일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- 데이터 엔지니어링
- Kubernetes
- job
- aks
- Python
- 유럽
- ansible
- docker
- azure governance
- 아시아
- install
- data factory
- Jenkins
- docker katacoda
- AZURE
- BABOK
- packer
- automation
- GCP
- CCBA
- CI
- Network Design
- ADF
- pester
- PowerShell
- openhack
- 관심사
- arm
- streaming
- DevOps
Archives
- Today
- Total
소소한 기록
Linux Academy: Canary Code Deployments and Testing Within AWS Lambda 본문
DevOps/Serverless2
Linux Academy: Canary Code Deployments and Testing Within AWS Lambda
John C Kim 2019. 9. 29. 16:45Introduction
In this hands-on lab, we will create different Lambda function versions and aliases, which will then be used for canary testing.
Solution
Log in to the live AWS environment using the credentials provided. Make sure you're in the N. Virginia (us-east-1) region throughout the lab.
All of the code used in the lesson is available for download here.
Create Your Lambda Function
- Navigate to Lambda.
- Click Create a function.
- Make sure the Author from scratch option at the top is selected, and then use the following settings:
- Name: Function
- Runtime: Python 2.7
- Role: Choose an existing role
- Existing role: lambda_exec_role_LA
- Click Create function.
- On the Function page, scroll to the Function code section.
- Replace the existing code there with the code from GitHub.
- Click Save.
Publish Our First Version and Create Our First Alias
- At the top, click Actions and select Publish new version.
- Give it a description (e.g., "Version 1"), and click Publish.
- In the Actions dropdown, select Create alias, and set the following values:
- Name: PROD
- Description: Prod
- Version: 1
- Click Create.
Create and Deploy Our API Within API Gateway
- Navigate to API Gateway in a new browser tab.
- Click Get Started.
- Choose New API, and set the following values:
- API name: Hello
- Description: Hello
- Endpoint Type: Regional
- Click Create API.
- On the Resources page, click Actions and select Create Resource from the dropdown.
- Give it a Resource Name of "hello".
- Click Create Resource.
- Make sure you have the /hello resource selected, click Actions, and select Create Method.
- In the Options dropdown, select GET and then click the checkmark.
- In the /hello - GET - Setup window, set the following values:
- Integration type: Lambda Function
- Use Lambda Proxy integration: Check
- Lambda Region: us-east-1
- Lambda Function: Function:PROD
- Use Default Timeout: Check
- Click Save.
- Click Actions and select Deploy API.
- In the Deploy API dialog, set the following values:
- Deployment stage: [New Stage]
- Stage name: One
- Stage description: One
- Deployment description: One
- Click Deploy.
- In the One - GET - /hello section, open the invoke URL in a new browser tab. We should see the message we added in our Lambda code.
Publish Version 2 of Our Function and Update Our Alias
- In the Lambda console, click the Alias:PROD dropdown and select $LATEST.
- In the Function code section, replace the existing code with the code from GitHub.
- Click Save.
- Click Actions and select Publish new version.
- Give it a description (e.g., "Version 2"), and click Publish.
- In the Version: 2 dropdown, select the Aliases tab and click the PROD alias.
- Scroll to the Aliases section, and set the Additional Version to 2.
- Set the weight to 50%.
- Click Save.
- Refresh the browser tab with the invoke URL a few times to verify you are getting different versions of code based on the response.