0Pricing
Serverless Backend with AWS Lambda & API Gateway · Lektion

Sichere Deployments mit Canary und Rollback

Veröffentlichen Sie Änderungen an Serverless-Anwendungen ohne Ausfallzeit. Lernen Sie Lambda-Aliase, gewichtete Traffic-Verteilung, Canary-Deployments mit CodeDeploy und automatische Rollbacks bei Alarmen.

Sichere Deployments mit Canary und Rollback ist eine kostenlose Serverless Backend with AWS Lambda & API Gateway-Lektion auf CoddyKit. Dies ist Lektion 4 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Serverless Backend with AWS Lambda & API Gateway-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Serverless Backend with AWS Lambda & API Gateway-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

The Risk of Big-Bang Deploys

Switching all traffic to new code at once means a bug hits every user instantly. Progressive deployments shift traffic gradually so problems surface on a small slice first.

Lambda Versions and Aliases

Publishing a Lambda creates an immutable version. An alias is a pointer (like live) you can move between versions, enabling controlled cutovers.

Weighted Aliases

An alias can split traffic between two versions by weight, sending, say, 10% to the new version and 90% to the old.

aws lambda update-alias \
  --function-name api --name live \
  --function-version 12 \
  --routing-config '{"AdditionalVersionWeights":{"11":0.9}}'

Canary Deployments

A canary sends a small percentage of traffic to the new version, waits, then promotes the rest if healthy. CodeDeploy automates this for Lambda.

Deployment Preferences in SAM

SAM exposes this via DeploymentPreference, choosing a canary or linear pattern.

AutoPublishAlias: live
DeploymentPreference:
  Type: Canary10Percent5Minutes
  Alarms:
    - !Ref ErrorAlarm

Linear Deployments

A linear pattern shifts traffic in equal increments over time (e.g. 10% every minute), giving a slower, steadier rollout than a single canary step.

CloudWatch Alarms as Gates

Attach alarms (error rate, latency) to the deployment. If an alarm fires during the shift, the deployment is considered failed.

Automatic Rollback

When an alarm trips, CodeDeploy automatically moves the alias back to the previous version, restoring known-good code with no manual action.

Pre and Post Traffic Hooks

Lifecycle hook Lambdas run before and after traffic shifts, letting you run smoke tests and abort the deploy if they fail.

Blue/Green vs Canary

Blue/green stands up a full second environment and switches over; canary shifts a percentage within one environment. For Lambda, weighted aliases make canary the simpler, cheaper default.

Best Practices

Deploy safely:

  • Always deploy behind an alias
  • Start with a small canary percentage
  • Gate on meaningful alarms
  • Run smoke tests in pre-traffic hooks

Quick Check

Test your safe-deployment knowledge.

Recap

You learned progressive delivery:

  • Versions are immutable; aliases point to them
  • Weighted aliases and canaries shift traffic gradually
  • SAM DeploymentPreference automates canary/linear patterns
  • Alarms gate the rollout and trigger automatic rollback

Häufig gestellte Fragen

Ist die Lektion „Sichere Deployments mit Canary und Rollback“ kostenlos?

Ja — der vollständige Text von „Sichere Deployments mit Canary und Rollback“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Serverless Backend with AWS Lambda & API Gateway-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Serverless Backend with AWS Lambda & API Gateway-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „Sichere Deployments mit Canary und Rollback“?

Veröffentlichen Sie Änderungen an Serverless-Anwendungen ohne Ausfallzeit. Lernen Sie Lambda-Aliase, gewichtete Traffic-Verteilung, Canary-Deployments mit CodeDeploy und automatische Rollbacks bei Al… Du übst Serverless Backend with AWS Lambda & API Gateway mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um Serverless Backend with AWS Lambda & API Gateway zu starten?

Keine Vorkenntnisse erforderlich. Serverless Backend with AWS Lambda & API Gateway auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 4 von 4.

Wie lange dauert die Lektion „Sichere Deployments mit Canary und Rollback“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser Serverless Backend with AWS Lambda & API Gateway-Lektion Code schreiben und ausführen?

Ja. Jede Serverless Backend with AWS Lambda & API Gateway-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. CodeCommit und CodeBuild
  2. CodePipeline für Deployments
  3. Serverless-Deployments automatisieren
  4. Sichere Deployments mit Canary und Rollback
← Zurück zu Serverless Backend with AWS Lambda & API Gateway