Exams / SAP-C02 / D1 Continuous Improvement for Existing Solutions
D1.1
Continuous Improvement for Existing Solutions (part 1 of 4)
- Exam domain: Continuous Improvement for Existing Solutions
You are reading a free preview. The rest of the SAP-C02 course unlocks with an Exam pass or All access.See plans
This chapter covers fixing and hardening an existing AWS workload: resilience, governance across accounts, cost, security hygiene and safe deployment.
1. Resilience and failover
| Need | Choice | Why |
|---|---|---|
| Static assets survive a Regional failure | S3 Cross-Region Replication + CloudFront origin group | "You can set up CloudFront with origin failover for scenarios that require high availability." |
| Existing objects must also be copied | S3 Batch Replication | "To replicate already existing objects, you can use" Batch Replication on demand |
| App must reconnect after RDS failover | RDS Proxy | "Connecting through a proxy makes your applications more resilient to database failovers." |
| No data loss when a downstream call fails | API Gateway → SQS (+ DLQ) → Lambda | Failed messages become visible again after the visibility timeout |
| Detect a failed application process | CloudWatch agent procstat + alarm → SNS → Lambda |
procstat collects per-process metrics; EC2 status checks do not |
| Protect data from leaked credentials | Separate account, S3 Object Lock (needs Versioning) | "Object Lock works only in buckets that have S3 Versioning enabled." |
2. Governance across accounts
| Goal | Tool | Note |
|---|---|---|
| Make a tag mandatory at creation | Deny SCP with Null on aws:RequestTag/<key> |
Tag policies "do not enforce missing tag keys" |
| Restrict Regions for some accounts | SCP + tag policy on a dedicated OU | Accounts in an OU inherit policies |
| Find untagged resources | AWS Config required-tags + aggregator |
Detects only; "does not prevent you from creating resources with incorrect tags" |
| Block non-approved services/instance types | SCP (Control Tower preventive controls are SCPs) | Detective controls and Config rules do not block |
| Central WAF rules | Firewall Manager (needs AWS Config enabled in member accounts) | Covers new resources automatically |
| Chargeback by tag | Activate cost allocation tag in the management account, use CUR | "For tags to appear on your billing reports, you must activate them." |
SCPs never grant: "SCPs do not grant permissions to the IAM users and IAM roles in your organization."
3. Performance and cost
| Symptom | Fix |
|---|---|
| Athena on VPC flow logs getting slower | Parquet format + partitions |
| CloudFront hit ratio falling because of query string order/case | Lambda@Edge viewer request normalises the query string |
| Slow large uploads via presigned URL | S3 Transfer Acceleration + multipart upload (best practice from 100 MB) |
| Underused single-type ASG | Attribute-based instance type selection (vCPU/memory) |
| Dev/test run 24/7 | Scheduled stop/start (EventBridge + Lambda), not terminate |
| Spiky low-average load | Burstable instances; static site on S3 |
| Compute Savings Plans | Also apply to Fargate and Lambda |
| Encryption percentage dashboard | S3 Storage Lens default dashboard |
Aurora Serverless v1 was the classic answer for spiky Aurora MySQL; it is retired, so today think Aurora Serverless v2.
4. Security hygiene and safe deployment
| Task | Tool |
|---|---|
| Least-privilege roles from real usage | IAM Access Analyzer policy generation from CloudTrail |
| Close public S3 access now | Block Public Access IgnorePublicAcls |
| Move SSE-S3 objects to a customer managed key | SSE-KMS default encryption + rewrite existing objects |
| Rotate DB secret in CloudFormation | AWS::SecretsManager::Secret + RotationSchedule |
| Reduce deployment downtime | Change sets + automated tests + CodeDeploy blue/green |
| Empty bucket before stack delete | Lambda-backed custom resource ("you must delete all objects in the bucket for deletion") |
| Scan ECR images and react | Scan on push → EventBridge event → Step Functions / SNS |
Exam traps
- Tag policy ≠ mandatory tag: use a Deny SCP with
Null; invertedNullvalue denies the wrong requests. - SCP at the management account only does not protect member accounts.
- Detective (Config, Control Tower detective) never blocks; preventive = SCP.
- RDS Proxy fixes reconnect-after-failover; migrating engines does not.
- Aurora Serverless v1 answers are outdated; Serverless v2 is current.
- Recreating an IAM role with the same name creates a new unique ID, so trust policies elsewhere must be re-saved.
- In-place deployment cannot roll back faster than redeploying; blue/green keeps the old fleet.
Docs
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html
- https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/high_availability_origin_failover.html
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.howitworks.html
- https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-enforcement.html
- https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html
- https://docs.aws.amazon.com/controltower/latest/controlreference/control-behavior.html
- https://docs.aws.amazon.com/config/latest/developerguide/required-tags.html
- https://docs.aws.amazon.com/waf/latest/developerguide/enable-config.html
- https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/activating-tags.html
- https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-policy-generation.html
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html
- https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html
- https://docs.aws.amazon.com/codedeploy/latest/userguide/deployments-rollback-and-redeploy.html
- https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html
- https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-attribute-deletionpolicy.html
- https://docs.aws.amazon.com/savingsplans/latest/userguide/what-is-savings-plans.html