Skip to content

Domain 3: Deployment & Operating Methods

CLF-C02 Exam Domain 3, Task 3.1 | 34% of Scored Content

Learning Objectives

By the end of this section, you will be able to:

  • Define methods of deploying and operating in the AWS Cloud (Domain 3, Task 3.1)
  • Understand various ways to access AWS services
  • Compare one-time operations vs repeatable processes
  • Identify cloud deployment models

Overview: Methods of Deploying and Operating in AWS

AWS provides multiple ways to provision, deploy, and operate resources in the cloud. Understanding these methods is crucial for choosing the right approach for your use case.

Key Decision Factors

FactorOne-Time OperationsRepeatable Processes
Use CaseQuick testing, learning, small projectsProduction deployments, scaling
ConsistencyManual configurationAutomated, consistent
EfficiencyFaster for simple tasksFaster for complex deployments
Best PracticeFor exploration onlyFor production workloads

1. AWS Management Console

Overview

The AWS Management Console is a web-based user interface for managing AWS services.

Key Characteristics

FeatureDescription
Web-BasedAccessible from any browser
User-FriendlyGraphical interface, no coding required
InteractiveClick-to-configure resources
Best ForLearning, exploration, one-time tasks
Not Recommended ForProduction deployments at scale

Console Features

  • Service Dashboard: Quick access to all AWS services
  • Resource Search: Find resources across services
  • Cost Explorer: Monitor spending
  • CloudWatch: View metrics and logs
  • Billing Dashboard: Track usage and costs

Advantages

  • Easy to learn
  • Visual feedback
  • No coding required
  • Great for beginners

Limitations

  • Not automated
  • Prone to human error
  • Difficult to replicate configurations
  • Not version-controlled

Use Cases

  • Learning AWS services
  • Quick resource exploration
  • One-time configuration tasks
  • Emergency manual interventions

2. Programmatic Access: AWS APIs

Overview

AWS APIs provide programmatic access to AWS services through HTTP requests.

API Types

API TypeDescriptionExample
REST APIsHTTP-based, statelessGET https://ec2.amazonaws.com/
Query APIsHTTP request with query parametersOlder AWS services
SOAP APIsLegacy protocolMostly deprecated

API Request Components

http
POST / HTTP/1.1
Host: ec2.amazonaws.com
X-Amz-Date: 20250111T000000Z
X-Amz-Security-Token: <session-token>
Authorization: AWS4-HMAC-SHA256 Credential=<access-key>/<date>/<region>/ec2/aws4_request

Advantages

  • Full service capability
  • Language-agnostic
  • Direct control
  • Can be automated

Limitations

  • Complex authentication
  • Verbose code
  • Error-prone manual coding
  • Requires SDK wrapper for most use cases

3. AWS SDKs (Software Development Kits)

Overview

AWS SDKs provide language-specific APIs that simplify working with AWS services.

Supported Languages

SDKLanguageUse Cases
SDK for Python (Boto3)PythonMost popular, data science, automation
SDK for JavaScriptNode.js, BrowserWeb applications, Lambda
SDK for JavaJavaEnterprise applications
SDK for .NETC#, F#Windows applications
SDK for GoGoCloud-native applications
SDK for RubyRubyWeb applications, DevOps
SDK for PHPPHPWeb applications
SDK for C++C++High-performance applications
SDK for RustRustSystems programming

Boto3 (Python SDK) Example

python
import boto3

# Create EC2 client
ec2 = boto3.client('ec2', region_name='us-east-1')

# Launch instance
response = ec2.run_instances(
    ImageId='ami-0c55b159cbfafe1f0',
    InstanceType='t2.micro',
    MinCount=1,
    MaxCount=1
)

instance_id = response['Instances'][0]['InstanceId']
print(f"Launched instance: {instance_id}")

SDK Features

FeatureDescription
AuthenticationHandles credentials and signing
Error HandlingStructured exceptions
PaginationAutomatic response pagination
Type HintsIDE autocomplete support
DocumentationBuilt-in docstrings

Advantages

  • Simplified API calls
  • Language-native patterns
  • Error handling built-in
  • Widely supported
  • Best practice for custom applications

Use Cases

  • Custom application development
  • Lambda functions
  • Automation scripts
  • Data processing pipelines

4. AWS CLI (Command Line Interface)

Overview

The AWS CLI provides a unified command-line interface to manage AWS services.

Installation

bash
# Using pip
pip install awscli

# Using bundled installer (Linux/macOS)
# Download from https://aws.amazon.com/cli/

# Using homebrew (macOS)
brew install awscli

Configuration

bash
aws configure
# AWS Access Key ID: YOUR_ACCESS_KEY
# AWS Secret Access Key: YOUR_SECRET_KEY
# Default region name: us-east-1
# Default output format: json

CLI Command Structure

bash
aws <service> <sub-command> [options]

Common CLI Examples

bash
# S3 Operations
aws s3 ls s3://my-bucket/
aws s3 cp file.txt s3://my-bucket/
aws s3 mb s3://my-new-bucket

# EC2 Operations
aws ec2 describe-instances
aws ec2 run-instances --image-id ami-12345 --instance-type t2.micro
aws ec2 stop-instances --instance-ids i-12345

# Lambda Operations
aws lambda list-functions
aws lambda invoke --function-name my-function response.json

# IAM Operations
aws iam list-users
aws iam create-user --user-name john

CLI Features

FeatureDescription
Unified InterfaceOne tool for all services
ScriptablePerfect for shell scripts
Output FormatsJSON, text, table, YAML
PaginationAuto-paginated results
WaitersPoll for resource state
Shell CompletionTab completion (bash/zsh)

Advantages

  • Quick commands
  • Scriptable
  • Consistent across services
  • Easy to learn
  • No compilation needed

Use Cases

  • Shell scripting
  • Quick administrative tasks
  • CI/CD pipelines
  • System administration
  • Development workflow

5. Infrastructure as Code (IaC)

Overview

Infrastructure as Code (IaC) is the practice of managing and provisioning infrastructure through machine-readable definition files rather than physical hardware configuration or interactive configuration tools.

Benefits of IaC

BenefitDescription
ConsistencySame configuration every time
Version ControlTrack changes with Git
ReusabilityTemplates across environments
DocumentationCode serves as documentation
AutomationAutomated deployments
Disaster RecoveryQuick infrastructure rebuild

AWS IaC Tools

ToolTypeLanguageBest For
AWS CloudFormationAWS-nativeYAML/JSONAWS-only deployments
AWS CDKAWS-nativeTypeScript, Python, Java, C#, GoDevelopers familiar with programming languages
TerraformMulti-cloudHCLMulti-cloud or hybrid deployments

CloudFormation

Overview

AWS CloudFormation is a service that helps you model and set up your Amazon Web Services resources.

CloudFormation Concepts

ConceptDescription
TemplateJSON/YAML file defining infrastructure
StackCollection of resources as a single unit
Change SetPreview of changes before applying
StackSetManage stacks across multiple accounts/regions

CloudFormation Template Example (YAML)

yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: EC2 instance with S3 bucket

Resources:
  MyS3Bucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: my-unique-bucket-name

  MyEC2Instance:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: ami-0c55b159cbfafe1f0
      InstanceType: t2.micro
      Tags:
        - Key: Name
          Value: MyCloudFormationInstance

Outputs:
  BucketName:
    Description: Name of the S3 bucket
    Value: !Ref MyS3Bucket

  InstanceId:
    Description: ID of the EC2 instance
    Value: !Ref MyEC2Instance

CloudFormation Features

FeatureDescription
DeclarativeDeclare desired state, AWS figures out how
RollbackAutomatic rollback on failure
Drift DetectionDetect manual changes
Nested StacksModular templates
MacrosCustom template processing

AWS CDK (Cloud Development Kit)

Overview

AWS CDK is an open-source software development framework to define cloud infrastructure in code.

CDK Advantages

AdvantageDescription
Programming LanguagesTypeScript, Python, Java, C#, Go
AbstractionsHigher-level constructs (L1, L2, L3)
Type SafetyCompile-time checking
IDE SupportAutocomplete, refactoring
TestingUnit test infrastructure code

CDK Construct Levels

LevelDescriptionExample
L1Direct CloudFormation mappingCfnBucket
L2AWS-curated defaultsBucket (with encryption, lifecycle)
L3Multi-resource patternsFullStackRestApi

CDK Example (TypeScript)

typescript
import * as s3 from 'aws-cdk-lib/aws-s3';
import { Stack, StackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';

export class MyS3Stack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    // L2 construct - AWS-curated defaults
    const bucket = new s3.Bucket(this, 'MyBucket', {
      versioned: true,
      encryption: s3.BucketEncryption.S3_MANAGED,
      lifecycleRules: [{
        expiration: 30 // days
      }]
    });
  }
}

Terraform

Overview

Terraform is an open-source IaC tool by HashiCorp that works with multiple cloud providers.

Terraform Concepts

ConceptDescription
ConfigurationHCL files defining infrastructure
StateCurrent state of infrastructure
PlanPreview of changes
ApplyExecute changes
ProviderPlugin for cloud services

Terraform Configuration Example

hcl
# Configure AWS provider
provider "aws" {
  region = "us-east-1"
}

# Create S3 bucket
resource "aws_s3_bucket" "my_bucket" {
  bucket = "my-unique-bucket-name"

  tags = {
    Name        = "My Bucket"
    Environment = "Dev"
  }
}

# Create EC2 instance
resource "aws_instance" "web_server" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"

  tags = {
    Name = "WebServer"
  }
}

Terraform vs CloudFormation

FeatureTerraformCloudFormation
Cloud SupportMulti-cloudAWS only
LanguageHCL (HashiCorp Config Language)YAML/JSON
State ManagementRemote state fileAWS-managed
CommunityLarge ecosystemAWS-only
CostFree (open source)Free (AWS service)

6. Cloud Deployment Models

Overview

Organizations can choose different deployment models based on their requirements.

Deployment Models Comparison

ModelDescriptionExampleBest For
CloudAll resources in AWSS3, EC2, LambdaStartups, new applications
HybridCloud + on-premisesAWS + Direct ConnectMigration, data sovereignty
On-PremisesPrivate data centerAWS OutpostsCompliance, latency

Cloud Deployment (All-in AWS)

Characteristics:

  • All resources hosted in AWS
  • No on-premises infrastructure
  • Full cloud benefits

Use Cases:

  • New applications
  • Startups
  • Greenfield projects
  • Bursting workloads

AWS Services: All AWS services available

Hybrid Cloud

Characteristics:

  • Resources split between AWS and on-premises
  • Connected via dedicated network or VPN
  • Gradual migration path

Use Cases:

  • Data sovereignty requirements
  • Gradual cloud migration
  • Bursting for peak demand
  • Legacy system integration

AWS Hybrid Services:

ServicePurpose
AWS Direct ConnectDedicated network connection
AWS Site-to-Site VPNSecure VPN tunnel
AWS Storage GatewayHybrid storage integration
AWS OutpostsAWS infrastructure on-premises
AWS SnowballPhysical data transfer device

On-Premises (Private Cloud)

Characteristics:

  • Resources in your own data center
  • AWS-managed on-premises hardware
  • Same AWS APIs and services

Use Cases:

  • Data residency requirements
  • Regulatory compliance
  • Ultra-low latency needs
  • Local data processing

AWS On-Premises Services:

ServiceDescription
AWS OutpostsFull AWS rack on-premises
AWS SnowballData transfer appliance
AWS Snowball EdgeCompute + storage on edge
AWS VMware CloudVMware on AWS infrastructure

7. Choosing the Right Deployment Method

Decision Framework

┌─────────────────────────────────────────────────────────────┐
│                  Choose Deployment Method                    │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  One-time / Learning?                                        │
│    ├─ Yes → Management Console                               │
│    └─ No → Need automation?                                  │
│           ├─ Yes → Scripting?                                │
│           │        ├─ Yes → AWS CLI / SDK                    │
│           │        └─ No → Infrastructure as Code            │
│           │                  ├─ AWS-only → CloudFormation     │
│           │                  ├─ Developer → AWS CDK          │
│           │                  └─ Multi-cloud → Terraform      │
│           └─ No → Manual configuration                      │
│                                                              │
└─────────────────────────────────────────────────────────────┘

Use Case Examples

ScenarioRecommended MethodRationale
Learning AWSConsoleQuick feedback, no coding
Automating backupsAWS CLI SDKScriptable, language-native
Production infrastructureCloudFormation / CDKVersion control, reproducible
Multi-cloud deploymentTerraformProvider-agnostic
Lambda functionSDKLanguage-specific integration
Quick admin taskAWS CLIOne-liner commands
Enterprise applicationAWS CDKAbstractions, testing

8. Best Practices for Deploying and Operating

Infrastructure as Code Best Practices

  1. Use Version Control: Store all IaC in Git
  2. Modularize: Break into reusable components
  3. Document: Add comments and README files
  4. Test: Test infrastructure code
  5. Review: Code review for changes
  6. Automate: CI/CD pipelines for deployments
  7. Tag Resources: Cost allocation and organization

Security Best Practices

  1. Least Privilege: Minimal IAM permissions
  2. No Secrets in Code: Use Secrets Manager / Parameter Store
  3. Encrypt Data: At rest and in transit
  4. Enable Logging: CloudTrail, CloudWatch
  5. Regular Audits: Review access and configurations

Operational Excellence

  1. Monitor: CloudWatch alarms and metrics
  2. Automate Recovery: Auto Scaling, health checks
  3. Document Runbooks: Incident response procedures
  4. Test Disaster Recovery: Regular drills
  5. Tag Everything: Resource organization

Exam Tips - Deployment Methods

High-Yield Topics

  1. Console vs Programmatic:

    • Console = Learning, one-time tasks
    • Programmatic = Automation, production
  2. SDK vs CLI:

    • SDK = For applications (custom code)
    • CLI = For scripting/administration
  3. IaC Benefits:

    • Consistency, version control, reusability, automation
  4. CloudFormation:

    • AWS-native, YAML/JSON templates
    • Stacks, Change Sets, Rollback
    • Declarative (declare desired state)
  5. AWS CDK:

    • Programming languages (TypeScript, Python, etc.)
    • L1, L2, L3 constructs
    • For developers, familiar patterns
  6. Terraform:

    • Multi-cloud, HCL language
    • State management, Plan/Apply workflow
    • Not AWS-specific
  7. Deployment Models:

    • Cloud = All AWS
    • Hybrid = AWS + On-premises (Direct Connect, VPN)
    • On-premises = Outposts, Snowball

Additional Resources

DigitalCloud Training Cheat Sheets

Official AWS Documentation

Practice Resources


Next: Compute Services

Released under the MIT License.