DVA Specific


Deployment (Publishing Strategies)

RequirementService
Least impact on user accessing prodBlue-Green Deployment
Least impact on user accessing prod and lower costCanary Release (small percentage test)
Deployment that test on a small percentage and then deploy for all usersCanary (e.g. Canary10Percent5Minutes -> 5 min)
Deployment that deploy the same amount of users periodicallyLinear (e.g. Linear10PercentEvery10Minutes -> 50 min)
ECS Rolling Update and keep same capacity during rollingMin 100%, Max 150%
Deploy a configuration change with the ability to roll-backAWS AppConfig
Instantly effortlessly switch traffic to a new tested LambdaSet AutoPublishAlias property
Deploy new version of a Lambda but keep the ability to return to older versionUse function alias with different versions
Use AWS Fault Injection Simulator only on a specified regionUse resource filter of a target component in the template

Troubleshooting and Optimization

RequirementService
ThrottlingExeptionUse exponential back off (retry 1s > 2s > 4s > 8s > 16s > ...)
5xx errors and throttlingImplement retries
4xx errorsDo not implement retries
Troubleshoot when getting HTTP 503 slow down response on S3 PUT or DELETEProbably due to objects having millions of versions, so S3 automatically throttles. Use Amazon S3 Inventory to create a report
Signed AWS HTTP API requestSigV4 (header Authorization or X-Amz-...)

Application Integration


SQS

RequirementService
SQS need to manage message that are > 256KBSQS extended Library for Java
Configure messages to be processed only after 5 minutes of being published in the queueUse DelaySeconds parameter
Messages are processed more than onceIncrease Visibility Timeout (default: 30s, min: 0s, max: 12h)
Consumers are polling the SQS Queue too often and are getting empty resultEnable Long Polling
Some messages are not processed correctlyAdd SQS Dead Letter Queue
Multiple consumers need to receive same message form SQSSNS with SQS Fan Out Pattern

SNS

RequirementService
Send SNS message to certain subscribers and not othersSNS Message Filtering

Compute


Beanstalk

RequirementService
Ignoring application HTTP errors in BeanstalkEnhanced health monitoring
Beanstalk deployment mode for development and test purposeSingle Instance (no ASG)
Beanstalk deployment mode for production purposeHigh Availability (ASG)
Beanstalk update deployment all at the same time (fast but downtime)All at once
Beanstalk update deployment by batches called buckets (no additional cost but run at below capacity)Rolling
Beanstalk update deployment by batches but not running below capacity (small additional cost)Rolling with additional batches
Beanstalk update deployment using a temporary ASG to confirm new version works (higher cost)Immutable
Specify how the application will be deployed to the underlying instancesFile appspec.yml
  • Beanstalk is free, but we pay for the infrastructure deployed by Beanstalk.
  • We can choose between 2 Tier:
    • Web Server Tier: Architecture with an ELB in front of an Auto Scaling Group of EC2 web servers.
    • Worker Tier: Architecture with an SQS Queue in front of an Auto Scaling Group of EC2 workers.
  • Beanstalk can store at most 1000 application versions. They can be removed with a Lifecycle Policy (based on time or space).
  • Beanstalk source bundle (extension) have to respect the following rules:
    • Folder named .ebextension (<500MB).
    • Files in YAML or JSON with .config extension.

Lambda

RequirementService
Stop a Lambda function that recursively call itselfSet function concurrent execution to 0
Improve performance of a Lambda that is CPU, network or memory boundIncrease memory
  • Lambda@Edge functions can only be created in us-east-1.

SAM

RequirementService
Define serverless resources in a YAML templateAWS Serverless Application Model (SAM)
Test a Lambda in a SAM locallyRun cdk synth and sam local start-lambda commands

Containers


ECS

RequirementService
Place tasks on the EC2 with the least available CPU or Memory (cost-effective)Binpack Placement Strategy
Place task randomly on available EC2sRandom Placement Strategy
Spread tasks based on a specified parameter (instance ID, AZ, ...)Spread Placement Strategy
Constraint to place tasks on different EC2Constraint distinctInstance
Allow tasks to access AWS resourcesCreate an IAM role at the task level and enable ECS_ENABLE_TASK_IAM_ROLE in /etc/ecs/ecs.config
  • The Load Balancer can only be added during the creation of a service (it can't be modified or removed).

Database


DynamoDB

RequirementService
Use one Partition Key in a queryQuery
Use the Partition Key and the Sort Key in a queryGetItem
Use multiple Partition Keys in a single queryBatchGetItem
Capture and store (for 24h) time ordered item modifications on a DynamoDB tableDynamoDB Streams

Developer Tools


Code Suite

RequirementService
Fully managed VCS, can contain file > 5GBAWS CodeCommit
Service that can compile and test codeAWS CodeBuild
Help to troubleshoot issue in codeAmazon CloudGuru

X-Ray

RequirementService
Trace Lambda invoked by non-instrumented serviceEnable Active Tracing in AWS Lambda config
Filter X-Ray traces (logs) on a specific value (e.g. a user)Use Annotations (key-value pair that can be used with filters)
Enable X-Ray logs on BeanStalkAdd the .ebextensions/xray-daemon.config
Enable X-Ray on EC2Run X-Ray Daemon
Change X-Ray Daemon listening portUse --bind flag
X-Ray Default Sampling Rule1 request/second & 5% of any additional request per host

Security and Compliance


IAM

RequirementService
Tool to analyze access control policies to resources like S3IAM Access Analyzer
Report on IAM users and the status of their credentialsIAM Credentials

Manager & Governance


AWS CLI

RequirementService
AWS CLI credential precedence usageCLI options > Environment variables > Files in ~/.aws > Resource Instance profile (EC2, ECS, Lambda)

CloudFormation

RequirementService
Create a CloudFormation stack in multiple AWS accounts in multiple RegionsCloudFormation StackSets
Detect changes made to a stack resource outside of CloudFormationCloudFormation Drift
Analyze upcoming changes on a stack update without executing itChangeSets

CloudWatch

RequirementService
Not all data is deliveredIteratorAge (age of the last records processed by functions)
Monitor EC2 memory usage (RAM is not included in EC2 metrics)Use Unified CloudWatch Agent (custom metric)
Collect metrics for EC2 every 5 minutesBasic Monitoring
Collect metrics for EC2 every 1 minuteDetailed Monitoring
High Resolution Custom Metrics can be collected at minimumEvery 1 second
Regular alarms can be triggeredAny multiple of 60 seconds
High Resolution alarms can be triggeredEvery 10 or 30 seconds
Detect unusual activity on all AWS RegionsCloudTrail Insights
Test a CloudWatch AlarmUse the set-alarm-state CLI command
  • CloudWatch Metric Filters do not retroactively filter data. CloudWatch only publish metrics after the Filter has been created.