Write a CloudFormation template that creates an S3 bucket with encryption and block public access.
BeginnerScenarioObservability, Secrets, KMS and CloudFormation
Answer
Situation read → Declarative resource with properties.
What I'd do →
- Define
AWS::S3::BucketwithBucketEncryptionSSE andPublicAccessBlockConfigurationall true - Add
DeletionPolicy: Retainfor data - Validate:
aws cloudformation validate-template --template-body file://t.yaml - Deploy:
aws cloudformation deploy --template-file t.yaml --stack-name app-bucket
Why → Defaults in code remove manual drift.
Interview tip → Retain policy protects data on stack deletion.
More on Observability, Secrets, KMS and CloudFormation
You need to be paged when 5xx errors on the ALB exceed 2 percent for 5 minutes. How?BeginnerHow do you centralize application logs from many EC2 and ECS services?BeginnerCloudWatch costs exploded. Where do you look?IntermediateInvestigate a latency spike across microservices on AWS. What tools do you use?IntermediateAn auditor asks for proof of every configuration change to security groups for 12 months. What do you provide?IntermediateAuto-remediate any security group opened to 0.0.0.0/0 on port 22.Advanced