Application Design Framework (ADF)

High-level application design from use case to code

Note: It is not necessarily the actual Amazon EC2 design.

Use case

Offer virtual machines (instances) as a service.

Business flow

Features and stories

Instance type with Intel CPU and NVMe SSD instance store volumes

Requirements

Requirements are not described in this example for brevity.

Architecture

Technical flow

Application boundaries

Context

We need to define application boundaires based on the technical flow.

Decision

The decision is to create two applications: EC2 Instances Console and EC2 Instances Control Plane.

Consequences

EC2 Instances Console components

Context

We need to define EC2 Instances Console components based on the technical flow.

Decision

EC2 Instances Console application contains Toolchain and Service components. Toolchain component contains Deployment Pipeline and Pull Request Build components. Service component contains Network, Ingress, UI, Database and Monitoring components. Toolchain and Service resources deploy as a stack each.

Consequences

EC2 Instances Console technologies

Context

We need to choose technologies to implement EC2 Instances Console components.

Decision

Consequences

EC2 Instances Control Plane components

Context

We need to define EC2 Instances Control Plane components based on the technical flow.

Decision

EC2 Instances Control Plane is not described in this example for brevity.

Consequences

Code

Git repositories

EC2 Instances Console: ec2-instances-console

Project structure

EC2 Instances Console

The example uses AWS Cloud Development Kit (AWS CDK) pseudo code for resources configuration. It should be possible to use the same approach with other tools.

service/
    ui/
        app/
            Dockerfile
            instances.py
            main.py
        compute.py
            class Compute(Construct):
                ec2.SecurityGroup
                ecs.Cluster
                ecs.Service
                ecs.TaskDefinition
                ecr_assets.DockerImageAsset
    database.py
        class Database(Construct):
            ec2.SecurityGroup
            elasticache.CacheCluster
    ingress.py
        class Ingress(Construct):
            ec2.SecurityGroup
            elasticloadbalancingv2.NetworkLoadBalancer
            elasticloadbalancingv2.TargetGroup
            certificatemanager.Certificate
            route53.HostedZone
            route53.CNAMERecord
            waf.WebACL
    monitoring.py
        class Monitoring(Construct):
            cloudwatch.Metric
            cloudwatch.Alarm
            cloudwatch.Dashboard
            xray.Group
    network.py
        class Network:
            ec2.VPC
            ec2.Subnet
            ec2.RouteTable
    service_stack.py
        class ServiceStack(Stack):
            network.Network
            ingress.Ingress
            database.Database
            ui.compute.Compute
            monitoring.Monitoring
toolchain/
    deployment_pipeline.py
        class DeploymentPipeline(Construct):
            pipelines.CodePipeline
    pull_request_build.py
        class PullRequestBuild(Construct):
            codebuild.Project
    toolchain_stack.py
        class ToolchainStack(Stack):
            toolchain.deployment_pipeline.DeploymentPipeline
            toolchain.pull_request_build.PullRequestBuild
app.py
    service.service_stack.ServiceStack("EC2InstancesConsole-Service-Sandbox")
    toolchain.toolchain_stack.ToolchainStack("EC2InstancesConsole-Toolchain-Sandbox")
    toolchain.toolchain_stack.ToolchainStack("EC2InstancesConsole-Toolchain-Production")