# bpbpublications/aws-cloud-automation architecture

> Architecture diagram of the GitHub repository bpbpublications/aws-cloud-automation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bpbpublications/aws-cloud-automation
- Repository: https://github.com/bpbpublications/aws-cloud-automation

## Overview

AWS Cloud Automation is a book repository of Terraform examples for provisioning AWS infrastructure, not one integrated application. Its examples span CI/CD, account security and governance, storage and networking, compute and load balancing, and data services. The clearest runtime workflow in the sampled code processes CloudTrail notifications into Kinesis; separate DynamoDB examples handle CSV imports and HTTP CRUD. Many Terraform examples were not sampled, so their capabilities are represented by their actual directories without inferred cross-module calls.

Main entry points: [`Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/main.py`](https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/main.py) (Event handler), [`Chapter 10/terraform/prod_dynamodb/zip_files/lambda_csv_2_dynamodb.py`](https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2010/terraform/prod_dynamodb/zip_files/lambda_csv_2_dynamodb.py) (CSV importer), [`Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/transform.py`](https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/transform.py) (Log reader and chunker), [`Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/load.py`](https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/load.py) (Kinesis writer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_delivery["CI/CD automation"]
  node_pipeline["Terraform CI/CD"]
  node_pipeline_modules["Pipeline modules"]
end

subgraph group_governance["Identity and governance"]
  node_iam["IAM foundation"]
  node_org["Organizations policies"]
  node_scp["Service control policies"]
  node_backup["Organization backups"]
end

subgraph group_foundation["Cloud infrastructure"]
  node_storage["Storage services"]
  node_network["VPC networking"]
end

subgraph group_compute["Compute and scaling"]
  node_ec2["EC2 examples"]
  node_loadbalancers["Load balancers"]
  node_dns["Route 53 routing"]
  node_eks["EKS and Fargate"]
end

subgraph group_data["Data and observability"]
  node_dynamodb[("DynamoDB resources")]
  node_csv_import["CSV importer"]
  node_rest_api["DynamoDB HTTP handler<br/>[lambda_rest_api.py]"]
  node_cloudtrail["CloudTrail pipeline"]
  node_handler["Event handler<br/>[main.py]"]
  node_extract["Notification parser<br/>[extract.py]"]
  node_transform["Log reader and chunker<br/>[transform.py]"]
  node_load["Kinesis writer<br/>[load.py]"]
  node_telemetry["CloudWatch metrics<br/>[telemetry.py]"]
end

node_author(("Infrastructure author"))
node_notifications(("S3 notification"))
node_s3[("Amazon S3")]
node_kinesis["Amazon Kinesis"]
node_cloudwatch["Amazon CloudWatch"]
node_dynamo_service[("Amazon DynamoDB")]

node_handler -->|"parses notification"| node_extract
node_handler -->|"reads and chunks"| node_transform
node_handler -->|"writes batches"| node_load
node_handler -->|"logs count"| node_telemetry
node_notifications -.->|"invokes"| node_handler
node_transform -->|"reads object"| node_s3
node_load -->|"puts records"| node_kinesis
node_telemetry -->|"publishes metrics"| node_cloudwatch
node_csv_import -->|"fetches upload"| node_s3
node_csv_import -->|"inserts rows"| node_dynamo_service
node_rest_api -->|"reads and writes"| node_dynamo_service
node_author -->|"defines infrastructure"| node_pipeline
node_author -->|"defines infrastructure"| node_iam
node_author -->|"defines infrastructure"| node_network
node_author -->|"defines infrastructure"| node_dynamodb
node_author -->|"defines infrastructure"| node_eks

click node_pipeline "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2002/terraform/codepipeline2"
click node_pipeline_modules "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2002/terraform/codepipeline2/modules"
click node_iam "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2003/iam_foundation"
click node_org "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2003/aws-organizations"
click node_scp "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2003/scp-policy"
click node_backup "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2003/aws_org_complete_backup_policy"
click node_storage "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2004/terraform"
click node_network "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2005/terraform"
click node_ec2 "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2006/terraform"
click node_loadbalancers "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2007/terraform"
click node_dns "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2008/terraform"
click node_eks "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2009/terraform"
click node_dynamodb "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2010/terraform/prod_dynamodb"
click node_csv_import "https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2010/terraform/prod_dynamodb/zip_files/lambda_csv_2_dynamodb.py"
click node_rest_api "https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2010/terraform/prod_dynamodb/zip_files/lambda_rest_api.py"
click node_cloudtrail "https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis"
click node_handler "https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/main.py"
click node_extract "https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/extract.py"
click node_transform "https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/transform.py"
click node_load "https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/load.py"
click node_telemetry "https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/telemetry.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pipeline,node_pipeline_modules toneBlue
class node_iam,node_org,node_scp,node_backup,node_s3,node_dynamo_service toneAmber
class node_storage,node_network toneMint
class node_ec2,node_loadbalancers,node_dns,node_eks toneRose
class node_dynamodb,node_csv_import,node_rest_api,node_cloudtrail,node_handler,node_extract,node_transform,node_load,node_telemetry,node_author,node_notifications,node_kinesis,node_cloudwatch toneIndigo
```

## Components

### CI/CD automation

- [Terraform CI/CD](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2002/terraform/codepipeline2): `Chapter 02/terraform/codepipeline2`
- [Pipeline modules](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2002/terraform/codepipeline2/modules): `Chapter 02/terraform/codepipeline2/modules`

### Identity and governance

- [IAM foundation](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2003/iam_foundation): `Chapter 03/iam_foundation`
- [Organizations policies](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2003/aws-organizations): `Chapter 03/aws-organizations`
- [Service control policies](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2003/scp-policy): `Chapter 03/scp-policy`
- [Organization backups](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2003/aws_org_complete_backup_policy): `Chapter 03/aws_org_complete_backup_policy`

### Cloud infrastructure

- [Storage services](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2004/terraform): `Chapter 04/terraform`
- [VPC networking](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2005/terraform): `Chapter 05/terraform`

### Compute and scaling

- [EC2 examples](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2006/terraform): `Chapter 06/terraform`
- [Load balancers](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2007/terraform): `Chapter 07/terraform`
- [Route 53 routing](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2008/terraform): `Chapter 08/terraform`
- [EKS and Fargate](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2009/terraform): `Chapter 09/terraform`

### Data and observability

- [DynamoDB resources](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2010/terraform/prod_dynamodb): `Chapter 10/terraform/prod_dynamodb`
- [CSV importer](https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2010/terraform/prod_dynamodb/zip_files/lambda_csv_2_dynamodb.py): `Chapter 10/terraform/prod_dynamodb/zip_files/lambda_csv_2_dynamodb.py`
- [DynamoDB HTTP handler](https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2010/terraform/prod_dynamodb/zip_files/lambda_rest_api.py): `Chapter 10/terraform/prod_dynamodb/zip_files/lambda_rest_api.py`
- [CloudTrail pipeline](https://github.com/bpbpublications/aws-cloud-automation/tree/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis): `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis`
- [Event handler](https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/main.py): `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/main.py`
- [Notification parser](https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/extract.py): `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/extract.py`
- [Log reader and chunker](https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/transform.py): `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/transform.py`
- [Kinesis writer](https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/load.py): `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/load.py`
- [CloudWatch metrics](https://github.com/bpbpublications/aws-cloud-automation/blob/main/Chapter%2011/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/telemetry.py): `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/telemetry.py`

### Other components

- **Infrastructure author**
- **S3 notification**
- **Amazon S3**
- **Amazon Kinesis**
- **Amazon CloudWatch**
- **Amazon DynamoDB**

## Connections

- Event handler → Notification parser: parses notification (evidence: `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/main.py`)
- Event handler → Log reader and chunker: reads and chunks (evidence: `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/main.py`)
- Event handler → Kinesis writer: writes batches (evidence: `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/main.py`)
- Event handler → CloudWatch metrics: logs count (evidence: `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/main.py`)
- S3 notification → Event handler: invokes
- Log reader and chunker → Amazon S3: reads object (evidence: `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/transform.py`)
- Kinesis writer → Amazon Kinesis: puts records (evidence: `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/load.py`)
- CloudWatch metrics → Amazon CloudWatch: publishes metrics (evidence: `Chapter 11/terraform/prod_cloudtrail_s3_cloudwatch_kinesis/lambda/telemetry.py`)
- CSV importer → Amazon S3: fetches upload (evidence: `Chapter 10/terraform/prod_dynamodb/zip_files/lambda_csv_2_dynamodb.py`)
- CSV importer → Amazon DynamoDB: inserts rows (evidence: `Chapter 10/terraform/prod_dynamodb/zip_files/lambda_csv_2_dynamodb.py`)
- DynamoDB HTTP handler → Amazon DynamoDB: reads and writes (evidence: `Chapter 10/terraform/prod_dynamodb/zip_files/lambda_rest_api.py`)
- Infrastructure author → Terraform CI/CD: defines infrastructure (evidence: `README.md`)
- Infrastructure author → IAM foundation: defines infrastructure (evidence: `README.md`)
- Infrastructure author → VPC networking: defines infrastructure (evidence: `README.md`)
- Infrastructure author → DynamoDB resources: defines infrastructure (evidence: `README.md`)
- Infrastructure author → EKS and Fargate: defines infrastructure (evidence: `README.md`)
