Operational Excellence and Security Pillars
Apply IaC, small reversible changes, and runbooks for operations; use the principle of least privilege, data protection, and incident response for security.
Operational Excellence and Security Pillars is a free AWS Solutions Architect lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Solutions Architect learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The Well-Architected Framework
The AWS Well-Architected Framework provides a set of best practices and guiding questions to help architects build secure, high-performing, resilient, and efficient cloud infrastructure. It is organised into six pillars: Operational Excellence, Security, Reliability, Performance Efficiency, Cost Optimisation, and Sustainability. This lesson covers the first two pillars. The SAA-C03 exam frequently asks which pillar a given design principle belongs to, so understanding each pillar clearly is essential.
# Six Pillars of the Well-Architected Framework:
# 1. Operational Excellence
# 2. Security
# 3. Reliability
# 4. Performance Efficiency
# 5. Cost Optimisation
# 6. Sustainability
# Each pillar has:
# - Design principles (practices to adopt)
# - Questions (evaluation criteria)
# - Best practices (specific implementation guidance)Operational Excellence: Core Design Principles
The Operational Excellence pillar focuses on running and monitoring systems to deliver business value and continually improving processes. Key design principles: Perform operations as code — use CloudFormation, CDK, or Systems Manager to automate infrastructure and operational tasks. Make frequent, small, reversible changes — deploy in small increments that can be rolled back. Anticipate failure — design for and practice recovering from failure. Learn from operational failures — conduct post-mortems and improve.
# CloudFormation: operations as code
aws cloudformation create-stack \
--stack-name my-app-stack \
--template-url s3://my-bucket/template.yaml \
--parameters ParameterKey=Env,ParameterValue=prod
# Rollback on failure is automatic
# Small, reversible change: deploy a new AMI
aws autoscaling start-instance-refresh \
--auto-scaling-group-name my-asg \
--preferences MinHealthyPercentage=90Infrastructure as Code for Operations
Treating infrastructure as code means your entire environment — VPCs, EC2 instances, RDS databases, IAM roles — is defined in version-controlled templates that can be reviewed, tested, and deployed consistently. AWS CloudFormation is the native IaC service with drift detection and change sets. AWS CDK lets you write infrastructure in familiar programming languages (Python, TypeScript). AWS Systems Manager Automation codifies operational runbooks (e.g., patching, snapshots) as executable documents.
# CloudFormation change set: preview before applying
aws cloudformation create-change-set \
--stack-name my-app-stack \
--change-set-name update-instance-type \
--template-url s3://my-bucket/updated-template.yaml
# Review the change set
aws cloudformation describe-change-set \
--stack-name my-app-stack \
--change-set-name update-instance-type
# Execute after review
aws cloudformation execute-change-set \
--change-set-name update-instance-type \
--stack-name my-app-stackObservability for Operational Excellence
You cannot improve what you cannot see. Operational Excellence requires observability: metrics, logs, and traces that give you insight into your system's behaviour. On AWS, this means CloudWatch Metrics for numeric data points, CloudWatch Logs for log aggregation and analysis, AWS X-Ray for distributed tracing across microservices, and CloudWatch Dashboards for real-time operational visibility. Define business and technical KPIs and measure them continuously to understand when you are meeting operational goals.
# Enable X-Ray tracing on Lambda
aws lambda update-function-configuration \
--function-name my-function \
--tracing-config Mode=Active
# X-Ray service map shows:
# - Which services are called
# - Response time percentiles
# - Error rates
# - Downstream dependencies
# Helps identify bottlenecks and failure pointsRunbooks and Playbooks
Runbooks are step-by-step operational procedures for routine tasks (deploying a new version, scaling up for a traffic event). Playbooks are procedures for responding to incidents (database failover, security breach). AWS Systems Manager Run Command and Automation let you execute runbooks programmatically across your EC2 fleet. Store runbooks in version control, review them regularly, and execute them in drills so on-call engineers are familiar with them before incidents occur.
# Systems Manager Automation: execute runbook
aws ssm start-automation-execution \
--document-name 'AWS-RestartEC2Instance' \
--parameters InstanceId=i-1234567890abcdef0
# Custom automation document for patching runbook
aws ssm create-document \
--name 'PatchAndRestart' \
--document-type Automation \
--content file://patch-runbook.jsonSecurity Pillar: Core Design Principles
The Security pillar focuses on protecting information, systems, and assets. Key design principles: Implement a strong identity foundation — use IAM with least privilege, eliminate long-term credentials. Enable traceability — log and audit all actions. Apply security at all layers — not just the perimeter, but at the network, compute, data, and application layers. Protect data in transit and at rest — encrypt everything. Automate security best practices — use Config rules and Security Hub for continuous evaluation.
# Security at all layers (defence in depth):
# Edge: AWS WAF + Shield
# Network: VPC, Security Groups, NACLs
# Compute: Security Groups, SSM Patch Manager
# Application: API Gateway authorizers, Cognito
# Data: KMS encryption, S3 bucket policies
# Identity: IAM least-privilege, MFA, roles
# Audit: CloudTrail, AWS Config, Security HubLeast Privilege and IAM Best Practices
Least privilege means granting only the minimum permissions required for a task — nothing more. In practice: use IAM roles instead of long-term access keys for services. Use permission boundaries to limit what roles can grant to other roles. Use Service Control Policies (SCPs) in AWS Organizations to set guardrails across accounts. Regularly review permissions with IAM Access Analyzer to detect overly permissive policies. Rotate access keys and enable MFA for all human users.
# IAM Access Analyzer to find overly permissive policies
aws accessanalyzer create-analyzer \
--analyzer-name my-analyzer \
--type ACCOUNT
# List findings (e.g., S3 bucket accessible externally)
aws accessanalyzer list-findings \
--analyzer-arn arn:aws:access-analyzer:us-east-1:123:analyzer/my-analyzer
# Check unused permissions
aws iam generate-service-last-accessed-details \
--arn arn:aws:iam::123:role/MyRoleEncryption: Data at Rest and in Transit
The Security pillar mandates encrypting data at rest and in transit. For data at rest: enable KMS encryption on S3 buckets, EBS volumes, RDS, DynamoDB, and EFS. Use customer-managed keys (CMK) for sensitive workloads where you need key rotation control. For data in transit: enforce TLS 1.2+ on all API endpoints (ALB, API Gateway), use ACM certificates, and configure security policies that reject weak cipher suites. Never transmit credentials or sensitive data in plaintext.
# Enforce HTTPS-only on S3 bucket
aws s3api put-bucket-policy \
--bucket my-sensitive-bucket \
--policy '{
"Statement": [{
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": "arn:aws:s3:::my-sensitive-bucket/*",
"Condition": {
"Bool": {"aws:SecureTransport": "false"}
}
}]
}'Incident Response Automation
Manual incident response is too slow when security events happen at cloud scale. The Security pillar emphasises automating incident response. Example: GuardDuty detects a compromised EC2 instance making suspicious outbound connections. An EventBridge rule triggers a Lambda function that automatically isolates the instance (removes it from ASG, applies restrictive security group) and sends a notification to the security team. This automated response happens in seconds, not hours.
# EventBridge rule for GuardDuty finding
aws events put-rule \
--name isolate-compromised-instance \
--event-pattern '{
"source": ["aws.guardduty"],
"detail-type": ["GuardDuty Finding"],
"detail": {
"severity": [{"numeric": [">", 7]}],
"type": [{"prefix": "UnauthorizedAccess"}]
}
}'
# Lambda target automatically:
# 1. Terminates instance from ASG
# 2. Creates forensic snapshot of EBS volume
# 3. Notifies security team via SNSDetective Controls: CloudTrail and Config
The Security pillar requires traceability — knowing who did what, when, and from where. AWS CloudTrail records every API call in your account: who made the call, from which IP, using which credentials, and what the result was. AWS Config continuously monitors resource configurations and detects when they deviate from your compliance rules (e.g., an S3 bucket became public). Together, CloudTrail and Config provide a comprehensive audit trail for security investigations and compliance evidence.
# Query CloudTrail to find who deleted an S3 bucket
aws cloudtrail lookup-events \
--lookup-attributes AttributeKey=EventName,AttributeValue=DeleteBucket \
--start-time 2026-06-01T00:00:00Z \
--end-time 2026-06-21T23:59:59Z
# AWS Config rule: S3 must not be publicly accessible
aws configservice put-config-rule \
--config-rule '{
"ConfigRuleName": "s3-bucket-public-read-prohibited",
"Source": {"Owner":"AWS","SourceIdentifier":"S3_BUCKET_PUBLIC_READ_PROHIBITED"}
}'Security Hub for Centralised Findings
AWS Security Hub aggregates security findings from GuardDuty, Inspector, Macie, IAM Access Analyzer, Config, and third-party tools into a single dashboard. It evaluates your environment against security standards like CIS AWS Foundations Benchmark, PCI DSS, and AWS Foundational Security Best Practices. Security Hub assigns severity scores to findings and lets you set automated remediation actions via EventBridge. Enable Security Hub as the central nerve centre for your security posture management.
# Enable Security Hub
aws securityhub enable-security-hub \
--enable-default-standards
# Enable specific standards
aws securityhub batch-enable-standards \
--standards-subscription-requests \
StandardsArn=arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0 \
StandardsArn=arn:aws:securityhub:us-east-1::standards/pci-dss/v/3.2.1Quick Check
Test your understanding of AWS Solutions Architect (SAA-C03) concepts from this lesson.
Lesson Recap
In this lesson you learned: Operational Excellence focuses on operations as code, small reversible changes, and learning from failures, the Security pillar mandates least privilege, defence in depth, and automated incident response, and CloudTrail, Config, and Security Hub provide detective controls for continuous security monitoring. Both pillars are foundational to every well-architected AWS system. Next up we explore the Reliability and Performance Efficiency pillars.
Frequently asked questions
Is the “Operational Excellence and Security Pillars” lesson free?
Yes — the full text of “Operational Excellence and Security Pillars” is free to read here on the web, and the AWS Solutions Architect course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Solutions Architect course, upgrade to CoddyKit PRO.
What will I learn in “Operational Excellence and Security Pillars”?
Apply IaC, small reversible changes, and runbooks for operations; use the principle of least privilege, data protection, and incident response for security. You practise AWS Solutions Architect with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start AWS Solutions Architect?
No prior experience is required. AWS Solutions Architect on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Operational Excellence and Security Pillars” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this AWS Solutions Architect lesson?
Yes. Every AWS Solutions Architect lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Operational Excellence and Security Pillars
- Reliability and Performance Efficiency Pillars
- Cost Optimisation and Sustainability Pillars
- Well-Architected Tool and Review Process