Interview Prep/AWS/Observability, Secrets, KMS and CloudFormation

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 →

  1. Define AWS::S3::Bucket with BucketEncryption SSE and PublicAccessBlockConfiguration all true
  2. Add DeletionPolicy: Retain for data
  3. Validate: aws cloudformation validate-template --template-body file://t.yaml
  4. 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.

aws All AWS questions

More on Observability, Secrets, KMS and CloudFormation