Tutorial Dojo - DVA-C02 - Summary

Domain 1: Development with AWS Services

NoQARef
I.4AWS SAM: shift traffic to new versionSAM Deployment strategy[SAM - Deploying gradually]
I.12Lambda: Response to user after 5 minLambda Invoke API InvocationType[Invoke - InvocationType]
I.14S3: Remove PII before return to applicationUse S3 Object Lambda to process object before return to application[S3 Object Lambda] [S3 Object Lambda Use with CloudFront]
I.18Only allow authorized clients to invalidate an API Gateway cache- API Gateway Additional settings / Per-key cache invalidation / Require authorization[Invalidate an API Gateway cache entry]
I.21Lambda: 50 requests/s; 100 s/request 👉️ 5.000 concurrency executionDefault quota of Lambda concurrency execution: 1.000 (can be increased to 10.000)
II.7Tracking number of visitors on website (use DynamoDB)1. (May over/under count) “Atomic counter” - just increase the counter without checking current value
II.8Kinesis Data Streams: Duplicate Records- Two primary reasons: 1. Producer retries; 2. Consumer retries.[Handling Duplicate Records - Kinesis]
II.9X-Ray: Include info about calls to AWS servicesInclude sub-segment in the segment document
II.10DynamoDB: Forum (PK) - Subject (SK) - LastPostUpdateTime. Finds on posts of a forum in last 3 monthsAdd LSI: Forum (PK) - LastPostUpdateTime (SK). Use Query operation.
II.19Elastic Beanstalk: Deploy infrastructure has an RDS instance coupling with EB. How to migrate RDS?1. Create RDS snapshot; enable RDS deletion protection
II.31Lambda: Concurrency quotas- Account-level: 1.000 unit of concurrency[Lambda Concurrency Quotas]
II.33Elastic Beanstalk: Environment manifest (environment name, solution stack…)- Environment manifest: /env.yaml[Environment manifest (env.yaml) - Elastic Beanstalk]
III.3API Gateway: Lambda Proxy integrationRecommend: Simple setup
III.12Deploy serverless app: Run C++Lambda doesn’t support C++ -> Create custom runtime
III.14SQS: postpone delivery messages to queueDelay queue (not using visibility timeout)
III.16ECS: EC2. Task placement?1. Cluster constraint; 2. Task placement constraint; 3. Task placement strategy
III.18Kinesis Data Streams: Re-sharding, Scaling, and Parallel Processing1. One worker can process many shards. 2. Optimal ratio is 1 worker : 1 shard
III.19DynamoDB: Concurrency writeOptimistic Locking + Conditional Writes
III.20DynamoDB: For each request, return WCU consumed (base table & GSI)ReturnConsumedCapacity: NONE (default), TOTAL, INDEXES
IV.8DynamoDB - GSI: Consumed throughput; Consistency?GSI has its own consumed throughput. GSI only supports eventually consistent read
IV.15ECS: Tasks are scheduled on instances with enough resources. Which task placement strategy?Random
IV.33Deploy containerized apps? ECS, EKS or Elastic Beanstalk?Under the hood, Elastic Beanstalk uses ECS (& ELB, ASG)
V.1Lambda: Debug - Return log stream for the function instanceUse context.logStreamName
V.8X-Ray: Group the traceSubsegment: breakdown segment & provide granular timing detail about downstream calls (to AWS services, HTTP APIs, SQL queries)
V.14Step Functions: Break a task into multiple tasks (process synchronously)Step Functions state types:[1.14]
V.18Lambda: Provide a public HTTPS endpoint & ensure it executes only if the request’s from valid user1. Use Lambda function URL[1.18]
V.19In-house authentication system, support sync user data between devices/platformsCognito Identity Pools - Developer-authenticated identities:
V.22DynamoDB: Python call BatchGetItem return partial data. Why? Fix?- BatchGetItem use more than the provisioned throughput limit
VI.17Lambda: Use C++Build a custom runtime for C++[1.17]

Domain 2: Security

NoQARef
I.1Give a program to AWS services- Best practice: EC2 instance profile (IAM Role)
I.3Database credential - How to encrypt & auto rotate?- AWS Secret Manager + Enable auto rotate
I.8S3 - Ensure all objects are encryption at rest with SSE-KMSAdd a bucket policy which denies any s3:PutObject action unless the request includes the x-amz-server-side-encryption header.
II.6Provide application in ECS access to the required AWS resourcesFargate: IAM Role -> attach to task
II.7KMS: Envelope Encryption1. encrypt plaintext data with a data key
IV.11 bucket - many users. How to redact PII & manage access permission?Use S3 Object Lambda (+) Access Point
V.1S3: Encryption each files with different keys. Cost-effective, low overhead- SSE-S3: use the same key for all files.
V.5KMS features
V.9AWS CLI: UnauthorizedOperation error with encoded authorization message. What to do?Decode the message with STS decode-authorization-message[2.9]
V.12Serverless app defined with Cloud Development Kit (CDK). How to test local?1. (From CDK template) “Synthesize” & output Cfn template with cdk synth[2.12 What is CDK?] [2.12 CDK toolkit commands]
V.13Cognito Identity Pools: What does Cognito returns to authenticated/unauthenticated user?- For authenticated users: Cognito returns the token
VI.8System Managers Parameter Store: Notify if a parameter hasn’t been rotated in 90 days.1. Use Advanced tier / Parameter polices / Notification policies

Domain 3: Deployment

NoQARef
I.1Implement subscription with API GatewayUse usage plan to distribute APIs & throttle usages based on defined limit/quota[API Gateway - Usage plan]
I.2Lambda, pause task & wait for external processStep Function - Callback pattern (SQS + SNS + Lambda)[Step Function - Callback Pattern]
I.5SAM template requires sectionsTransform & Resources
I.6Create Lambda function with CLI error InvalidParameterValueExceptionInvalid parameter: maybe a role can’t be assumed
I.7ECS schedule task based on CPU/memoryECS - Task placement strategy: binpack, spread, random
II.5CodeDeploy AppSpec - Run a task before traffic is shifted to a Lambda functionAppSpec hook
III.6CodeDeploy deployment type (How the latest revision is deployed to instance?)1. In-place (EC2/On-Premises); 2. Blue/green
IV.1SAM deploy process (From local machine)1. Build (local); 2. Package (“Publish” to S3); 3. Deploy (Use artifact on S3)
V.2CodeDeploy: RollbackCodeDeploy rolls back deployments by redeploying a previously deployed revision of an application as a new deployment (with new deployment ID)[3.2]
V.7CodeCommit: How to setup for a new user?Use AWS credential (with credential-helper)[3.7]
V.9SAM: How to deploy (& test)?1. (Once time) sam init

Domain 4: Troubleshooting and Optimization

NoQARef
I.6Serve private content from CloudFront1. Use signed-URL, sign-cookies
I.7X-ray: How to debug?_X_AMZN_TRACE_ID + AWS_XRAY_CONTEXT_MISSING
I.12CloudFront HTTPSViewer Protocol Policy: Only HTTPS or Redirect HTTP to HTTPS
I.14DynamoDB Scan improve performance- Default page size: 1MB (Max) -> Reduce page size
I.19Use Lambda function inside a VPC- By default, Lambda is public (has internet access)
I.20X-Ray filter trace1. Add annotation to record data used to group traces (indexed to used with filter expression)
I.22API Gateway: Lambda Proxy - 502 Bad GatewayIn Lambda proxy integration, the backend Lambda function must return output according a JSON format[Output format of a Lambda function for proxy integration]
II.5Kinesis Data Streams: Not enough shards & Instances CPU 100%1. Increase number of shards (shard splitting). 2. Increase instance size
II.6RDS can’t handle read1. Use RDS Multi-AZ Cluster (not Multi-AZ Instance)
II.7X-Ray - namespace, metadataX-Ray namespace: distinguish AWS/remote
II.8CloudWatch - namespaceCloudWatch namespace: container for metrics, e.g. aws/lambda
III.1Collect trace from multiple backends, AWS SDK, SQL queries…AWS Distro for OpenTelemetry (supports collect from X-Ray)
V.1Lambda: Function created with Cfn doesn’t send logs to CW?Modify ExecutionRole & add AWSLambdaBasicExecutionRole managed policy
V.2ECS: EC2 launch type. Terminate an instance (after it’s stopped), but the container instance still appear in ECS clusterTerminate an instance:
V.4API Gateway: Enable API caching. How to test the function without caching?0. Create a resource-based policy to allows the API Gateway execution service to invalidate the cache for requests on the specified resource[4.4]
V.13DynamoDB: Optimize Scan in low-demand time?Parallel scan: distribute workload across the partitions of the table (by passing Segment and TotalSegments parameters into the Scan operation)[4.13]