Swiftorial Logo
Home
Swift Lessons
Tutorials
Learn More
Career
Resources

AWS Cloud Native System Overview

Introduction to AWS Cloud Native System

This AWS Cloud Native System Overview presents a scalable, secure, and observable architecture leveraging **microservices** hosted on **ECS/EKS** with **containers**. **App Mesh** with **Envoy** sidecars ensures resilient service-to-service communication, while **CloudWatch** and **X-Ray** provide comprehensive observability. Security is enforced through **IAM**, **VPC**, **WAF**, and **KMS**, ensuring compliance and data protection. Designed for high availability and agility, this system supports modern applications like APIs, web platforms, or data pipelines.

A cloud-native approach with microservices, service mesh, and robust observability powers scalable AWS deployments.

Cloud Native Architecture Diagram

The vertical diagram illustrates a layered AWS cloud-native system: **Clients** access via **CloudFront** and **API Gateway**, protected by **WAF**. **Microservices** on **ECS/EKS** with **Envoy** sidecars communicate via **App Mesh**. **DynamoDB** and **RDS** store data, with **ElastiCache** for caching. **CloudWatch**, **X-Ray**, and **CloudTrail** ensure observability, while **IAM**, **VPC**, and **KMS** enforce security. Arrows are color-coded: yellow (dashed) for client traffic, orange-red for service interactions, blue for data flows, purple for observability, and green for security.

graph TD %% Styling for nodes classDef client fill:#ffeb3b,stroke:#ffeb3b,stroke-width:2px,rx:10,ry:10; classDef edge fill:#ff9800,stroke:#ffffff,stroke-width:2px,color:#ffffff,rx:5,ry:5; classDef compute fill:#f44336,stroke:#ffffff,stroke-width:2px,color:#ffffff,rx:5,ry:5; classDef mesh fill:#2196f3,stroke:#ffffff,stroke-width:2px,color:#ffffff,rx:5,ry:5; classDef data fill:#4caf50,stroke:#ffffff,stroke-width:2px,color:#ffffff; classDef observability fill:#9c27b0,stroke:#ffffff,stroke-width:2px,color:#ffffff,rx:2,ry:2; classDef security fill:#673ab7,stroke:#ffffff,stroke-width:2px,color:#ffffff; classDef cache fill:#ff5722,stroke:#ffffff,stroke-width:2px,color:#ffffff; %% Vertical Flow A[Client: Web/Mobile] A -->|HTTPS| B[CloudFront] B -->|Protects| C[WAF] C -->|Routes| D[API Gateway] D -->|Invokes| E[ALB] E -->|Distributes| F[ECS/EKS Cluster] subgraph Compute Layer F -->|Hosts| G[Microservice A] F -->|Hosts| H[Microservice B] G -->|Proxied| I[Envoy Sidecar] H -->|Proxied| J[Envoy Sidecar] I -->|Routes| K[App Mesh] J -->|Routes| K end K -->|Accesses| L[(DynamoDB)] K -->|Queries| M[(RDS)] K -->|Caches| N[(ElastiCache)] L -->|Encrypts| O[(KMS)] M -->|Encrypts| O F -->|Secures| P[(VPC)] F -->|Authenticates| Q[(IAM)] G -->|Traces| R[(AWS X-Ray)] H -->|Traces| R G -->|Logs/Metrics| S[(CloudWatch)] H -->|Logs/Metrics| S D -->|Audits| T[(CloudTrail)] %% Apply styles class A client; class B,C,D,E edge; class F,G,H compute; class I,J,K mesh; class L,M data; class N cache; class O,P,Q security; class R,S,T observability; %% Annotations linkStyle 0 stroke:#ffeb3b,stroke-width:2.5px,stroke-dasharray:6,6 linkStyle 1,2,3,4 stroke:#ff9800,stroke-width:2.5px linkStyle 5,6 stroke:#f44336,stroke-width:2.5px linkStyle 7,8,9 stroke:#2196f3,stroke-width:2.5px linkStyle 10,11 stroke:#4caf50,stroke-width:2.5px linkStyle 12 stroke:#ff5722,stroke-width:2.5px linkStyle 13,14 stroke:#673ab7,stroke-width:2.5px linkStyle 15,16 stroke:#673ab7,stroke-width:2.5px linkStyle 17,18 stroke:#9c27b0,stroke-width:2.5px linkStyle 19,20 stroke:#9c27b0,stroke-width:2.5px,stroke-dasharray:4,4
A vertical, layered design with **App Mesh** and **observability** ensures a secure, scalable cloud-native system.

Key Components

The cloud-native system comprises integrated components for compute, networking, observability, and security:

  • CloudFront: Global CDN for low-latency delivery of static and dynamic content.
  • WAF: Protects against web exploits like SQL injection and DDoS attacks.
  • API Gateway: Manages secure, scalable API endpoints with authentication.
  • ALB: Distributes traffic to ECS/EKS microservices for load balancing.
  • ECS/EKS Cluster: Hosts containerized microservices with auto-scaling.
  • App Mesh: Manages service-to-service communication with Envoy sidecars.
  • Envoy Sidecar: Proxies traffic for routing, mTLS, and resilience.
  • DynamoDB: NoSQL database for high-performance, scalable data storage.
  • RDS: Relational database for structured data with multi-AZ support.
  • ElastiCache: In-memory caching for low-latency data access.
  • AWS X-Ray: Provides distributed tracing for microservice interactions.
  • CloudWatch: Collects metrics, logs, and alarms for system monitoring.
  • CloudTrail: Audits API calls for compliance and security tracking.
  • IAM: Enforces least-privilege access for services and resources.
  • VPC: Isolates resources with subnets and security groups.
  • KMS: Manages encryption keys for data at rest.

Benefits of AWS Cloud Native System

This architecture delivers significant advantages for modern applications:

  • Scalability: ECS/EKS and DynamoDB scale seamlessly with demand.
  • Security: WAF, IAM, KMS, and VPC ensure robust protection.
  • Observability: X-Ray, CloudWatch, and CloudTrail provide deep insights.
  • Resilience: App Mesh enables retries, circuit breaking, and load balancing.
  • Agility: Microservices and containers accelerate development cycles.
  • Cost Efficiency: Pay-as-you-go pricing optimizes resource usage.
  • Global Reach: CloudFront ensures low-latency access worldwide.

Implementation Considerations

Building this cloud-native system requires addressing key considerations:

  • Security Hardening: Configure WAF rules, enable mTLS in App Mesh, and rotate KMS keys.
  • Performance Optimization: Tune ElastiCache, optimize DynamoDB capacity, and configure ALB health checks.
  • Cost Management: Use Savings Plans for ECS/EKS and monitor usage with Cost Explorer.
  • Scalability Planning: Set auto-scaling policies for ECS/EKS and DynamoDB on-demand mode.
  • Observability Setup: Create X-Ray service maps, CloudWatch dashboards, and CloudTrail log analysis.
  • Resilience Testing: Simulate service failures and traffic spikes to validate App Mesh behavior.
  • Compliance Requirements: Enable CloudTrail for audits and ensure encryption for GDPR/SOC compliance.
  • CI/CD Integration: Automate deployments with CodePipeline and CodeBuild.
Security, observability, and resilience are critical for a production-grade cloud-native system.

Example Configuration: ECS Task Definition with App Mesh

Below is a JSON task definition for an ECS service with an Envoy sidecar for App Mesh.

{
  "family": "microservice-a",
  "networkMode": "awsvpc",
  "containerDefinitions": [
    {
      "name": "app",
      "image": "my-app:1.0",
      "portMappings": [
        {
          "containerPort": 8080,
          "protocol": "tcp"
        }
      ],
      "essential": true,
      "logConfiguration": {
        "logDriver": "awslogs",
        "options": {
          "awslogs-group": "/ecs/microservice-a",
          "awslogs-region": "us-west-2",
          "awslogs-stream-prefix": "app"
        }
      }
    },
    {
      "name": "envoy",
      "image": "aws-appmesh-envoy:v1.22.2.0-prod",
      "essential": true,
      "environment": [
        {
          "name": "APPMESH_RESOURCE_NAME",
          "value": "microservice-a"
        }
      ],
      "user": "1337",
      "logConfiguration": {
        "logDriver": "awslogs",
        "options": {
          "awslogs-group": "/ecs/microservice-a",
          "awslogs-region": "us-west-2",
          "awslogs-stream-prefix": "envoy"
        }
      }
    }
  ],
  "requiresCompatibilities": ["FARGATE"],
  "cpu": "512",
  "memory": "1024",
  "executionRoleArn": "arn:aws:iam::123456789012:role/ecsTaskExecutionRole",
  "taskRoleArn": "arn:aws:iam::123456789012:role/ecsTaskRole"
}
                
This ECS task definition integrates a microservice with an Envoy sidecar for App Mesh communication.

Example Configuration: App Mesh Virtual Node and Router

Below is a CloudFormation template for an App Mesh virtual node and router.

AWSTemplateFormatVersion: '2010-09-09'
Resources:
  Mesh:
    Type: AWS::AppMesh::Mesh
    Properties:
      MeshName: cloud-native-mesh
      Spec:
        EgressFilter:
          Type: ALLOW_ALL
  VirtualNodeA:
    Type: AWS::AppMesh::VirtualNode
    Properties:
      MeshName: !Ref Mesh
      VirtualNodeName: microservice-a
      Spec:
        ServiceDiscovery:
          DNS:
            Hostname: microservice-a.default.svc.cluster.local
        Listeners:
          - PortMapping:
              Port: 8080
              Protocol: http
        Backends:
          - VirtualService:
              VirtualServiceName: microservice-b.default.svc.cluster.local
  VirtualNodeB:
    Type: AWS::AppMesh::VirtualNode
    Properties:
      MeshName: !Ref Mesh
      VirtualNodeName: microservice-b
      Spec:
        ServiceDiscovery:
          DNS:
            Hostname: microservice-b.default.svc.cluster.local
        Listeners:
          - PortMapping:
              Port: 8080
              Protocol: http
  VirtualServiceB:
    Type: AWS::AppMesh::VirtualService
    Properties:
      MeshName: !Ref Mesh
      VirtualServiceName: microservice-b.default.svc.cluster.local
      Spec:
        Provider:
          VirtualNode:
            VirtualNodeName: !Ref VirtualNodeB
  VirtualRouter:
    Type: AWS::AppMesh::VirtualRouter
    Properties:
      MeshName: !Ref Mesh
      VirtualRouterName: microservice-b-router
      Spec:
        Listeners:
          - PortMapping:
              Port: 8080
              Protocol: http
  Route:
    Type: AWS::AppMesh::Route
    Properties:
      MeshName: !Ref Mesh
      VirtualRouterName: !Ref VirtualRouter
      RouteName: microservice-b-route
      Spec:
        HttpRoute:
          Match:
            Prefix: /
          Action:
            WeightedTargets:
              - VirtualNode: !Ref VirtualNodeB
                Weight: 100
          RetryPolicy:
            MaxRetries: 3
            PerRetryTimeout:
              Unit: ms
              Value: 2000
            HttpRetryEvents:
              - server-error
                
This template configures App Mesh for secure microservice communication with routing and retries.

Example Configuration: CloudWatch Alarms for Observability

Below is a CloudFormation template for CloudWatch alarms to monitor system health.

Resources:
  HighCPUMetricAlarm:
    Type: AWS::CloudWatch::Alarm
    Properties:
      AlarmName: HighCPUUsage
      AlarmDescription: Triggers when ECS CPU usage exceeds 80%
      MetricName: CPUUtilization
      Namespace: AWS/ECS
      Statistic: Average
      Period: 300
      EvaluationPeriods: 2
      Threshold: 80
      ComparisonOperator: GreaterThanThreshold
      Dimensions:
        - Name: ClusterName
          Value: CloudNativeCluster
      AlarmActions:
        - !Ref SNSTopic
      TreatMissingData: notBreaching
  SNSTopic:
    Type: AWS::SNS::Topic
    Properties:
      TopicName: CloudNativeAlerts
                
This template sets up a CloudWatch alarm for high CPU usage in the ECS cluster.