Module 04
Module 04
By- Shyam
AWS Automation, Architecture, and
Containerization
Event-Driven Architecture (EDA)
• Event-Driven Architecture (EDA) is a software design pattern in
which the production, detection, and consumption of events trigger
corresponding actions or workflows in a decoupled and asynchronous
manner. In the context of Amazon Web Services (AWS), event-driven
architecture can be implemented using various AWS services to build
scalable, loosely coupled, and responsive applications. Here's how
event-driven architecture is implemented in AWS:
Event-Driven Architecture (EDA)
Key Components of Event-Driven Architecture in AWS:
Event Sources:
• AWS services such as Amazon S3, Amazon DynamoDB, Amazon Kinesis, Amazon SQS
(Simple Queue Service), Amazon SNS (Simple Notification Service), AWS IoT, and AWS
CloudWatch can act as event sources by generating or publishing events when certain
conditions are met.
Event Processing:
• AWS Lambda is a serverless compute service that executes code in response to events. It can
be used to process events from event sources, such as processing files uploaded to Amazon S3,
consuming messages from Amazon SQS or Amazon Kinesis, or reacting to changes in
Amazon DynamoDB tables.
• Amazon EventBridge (formerly known as Amazon CloudWatch Events) is a serverless event
bus service that allows you to route events from various sources to AWS services, Lambda
functions, SNS topics, SQS queues, or custom targets for further processing or handling.
Event-Driven Architecture (EDA)
Key Components of Event-Driven Architecture in AWS:
Event Storage and Queuing:
• Amazon SQS and Amazon SNS are messaging services that provide scalable and reliable storage
and queuing for events. Amazon SQS allows you to decouple and buffer events between event
sources and event consumers, while Amazon SNS enables pub/sub messaging for distributing events
to multiple subscribers.
• Amazon Kinesis is a platform for streaming data on AWS, which can be used for real-time event
ingestion, processing, and analysis at scale.
Event Consumers:
• Event consumers are components or services that respond to events generated by event sources.
These consumers can be AWS Lambda functions, EC2 instances, containers running on Amazon
ECS or AWS Fargate, or custom applications running on-premises or in the cloud.
• Event consumers subscribe to events using event subscriptions, event rules, or event triggers
defined in AWS services like Amazon EventBridge, Amazon SNS, Amazon SQS, or Amazon
Kinesis.
Event-Driven Architecture (EDA)
Key Components of Event-Driven Architecture in AWS:
Event Logging and Monitoring:
• AWS CloudTrail provides event history logs of API calls made within your
AWS account, including events generated by event-driven architecture
components. It helps in auditing and monitoring the activity within your AWS
environment.
• AWS CloudWatch provides monitoring and alerting capabilities for AWS
resources and applications, allowing you to monitor metrics, set alarms, and
trigger automated actions based on events and thresholds.
Network Architecture Concepts
• In Amazon Web Services (AWS), network architecture refers to the
design and configuration of networking components and services to
create a scalable, reliable, and secure network infrastructure for your
applications and workloads. Here are some key concepts and
components related to network architecture in AWS:
Network Architecture Concepts
Virtual Private Cloud (VPC):
• A Virtual Private Cloud (VPC) is a logically isolated section of the AWS cloud where you
can launch AWS resources in a virtual network that you define. It allows you to define your
own IP address range, subnets, route tables, and network gateways.
Subnets:
• Subnets are segments of a VPC's IP address range where you can place groups of
resources. They allow you to logically organize and segregate resources within your VPC.
Subnets can be public, private, or VPN-only, depending on their connectivity requirements.
Internet Gateway (IGW):
• An Internet Gateway (IGW) is a horizontally scaled, redundant, and highly available AWS-
managed gateway that allows communication between resources within your VPC and the
internet. It enables instances in your VPC to connect to the internet for outbound traffic and
allows internet users to access resources in your VPC for inbound traffic.
Network Architecture Concepts
Virtual Private Gateway (VGW):
• A Virtual Private Gateway (VGW) is a VPN concentrator on the Amazon side of a VPN
connection. It provides a secure and private connection between your on-premises network
and your VPC using an IPsec VPN connection or AWS Direct Connect.
Peering Connection:
• VPC Peering allows you to connect two VPCs within the same AWS region and exchange
traffic between them using private IP addresses. It enables you to share resources and
collaborate with other AWS accounts while keeping network traffic within the AWS network.
NAT Gateway:
• A NAT Gateway is a managed service that enables instances in private subnets within your
VPC to initiate outbound traffic to the internet while preventing inbound traffic from reaching
those instances. It helps facilitate communication from private subnets to the internet and vice
versa.
Network Architecture Concepts
Security Groups:
• Security Groups act as virtual firewalls for your instances, controlling inbound
and outbound traffic at the instance level. You can define rules in a security
group to allow or deny traffic based on protocols, ports, and IP addresses.
Network Access Control Lists (NACLs):
• Network Access Control Lists (NACLs) act as stateless firewalls for your
subnets, controlling traffic at the subnet level. They allow you to define rules
to allow or deny traffic based on IP addresses and protocols.
Network Architecture Concepts
Elastic Load Balancer (ELB):
• Elastic Load Balancer automatically distributes incoming application traffic
across multiple targets, such as EC2 instances, containers, and IP addresses, in
multiple Availability Zones. It helps improve the availability and fault tolerance
of your applications.
Direct Connect:
• AWS Direct Connect enables you to establish a dedicated network connection
between your on-premises data center and AWS, bypassing the public internet. It
provides a consistent and predictable network performance and can be used for
hybrid cloud deployments.
Containerization with AWS Services
• Containerization with AWS services involves using various AWS
services to build, deploy, and manage containerized applications using
popular containerization technologies like Docker and Kubernetes.
• AWS provides a range of services and features that support
containerization workflows, making it easier to develop, deploy, and
scale containerized applications in the cloud. Here are some
Containerization with AWS Services:
Key AWS services for containerization:
Amazon Elastic Container Service (ECS):
• Amazon ECS is a fully managed container orchestration service that allows
you to run Docker containers on a scalable and highly available infrastructure.
It eliminates the need to install, operate, and scale your own container
orchestration platform.
• ECS supports both Fargate and EC2 launch types. With Fargate, you can run
containers without managing the underlying infrastructure, while with EC2,
you have more control over the underlying compute resources.
Containerization with AWS Services:
Key AWS services for containerization:
Amazon Elastic Kubernetes Service (EKS):
• Amazon EKS is a fully managed Kubernetes service that allows you to run
Kubernetes clusters on AWS without the need to install, operate, or manage
Kubernetes control plane components.
• EKS simplifies the process of deploying, managing, and scaling Kubernetes
applications, providing features like automated cluster provisioning,
integration with AWS services, and native Kubernetes tooling support.
Containerization with AWS Services:
Key AWS services for containerization:
AWS Fargate:
• AWS Fargate is a serverless compute engine for containers that allows you to run
containers without managing the underlying infrastructure. With Fargate, you can focus
on building and deploying containerized applications without worrying about server
provisioning, scaling, or patching.
• Fargate integrates seamlessly with ECS and EKS, allowing you to launch containers in
Fargate mode with a simple configuration.
Amazon Elastic Container Registry (ECR):
• Amazon ECR is a fully managed Docker container registry that makes it easy to store,
manage, and deploy Docker container images. It provides secure and reliable storage
for your container images, with integration with ECS, EKS, and other container
services.
Containerization with AWS Services:
Key AWS services for containerization:
AWS App Runner:
• AWS App Runner is a fully managed container-based service that simplifies the process of deploying
and managing containerized web applications. It automatically provisions the underlying
infrastructure, deploys your container images, and scales the application based on traffic.
AWS Lambda with Container Image Support:
• AWS Lambda now supports running container images as functions, allowing you to package and
deploy containerized applications as serverless functions. Lambda with container image support
provides a flexible and scalable compute platform for running event-driven container workloads.
AWS CloudFormation and AWS CDK:
• AWS CloudFormation and AWS Cloud Development Kit (CDK) allow you to define and provision
infrastructure as code (IaC) for containerized applications. You can use templates or code to define
the resources and configurations needed to deploy containerized applications on AWS.
Continuous Integration and Deployment (CI/CD) Testing
• Docker is a platform that enables developers to build, ship, and run applications
inside containers. Containers are lightweight, portable, and isolated
environments that package everything needed to run an application, including its
dependencies, libraries, and runtime environment.
• Docker provides several components and features for container orchestration,
which is the process of managing and coordinating multiple containers across a
distributed infrastructure.
• Docker plays a crucial role in container orchestration by providing a
standardized platform for building, packaging, and running applications inside
containers. It simplifies the deployment and management of containerized
applications, making it easier for developers to build and deploy scalable,
portable, and resilient applications across diverse environments.
Continuous Integration and Deployment (CI/CD) Testing
AWS X-Ray:
• AWS X-Ray is a distributed tracing service that helps developers analyze and debug distributed
applications. It provides insights into requests flowing through the application and identifies
performance bottlenecks, errors, and latencies. X-Ray integrates with AWS services like Lambda,
API Gateway, EC2, and more.
AWS CloudTrail:
• CloudTrail records API activity and events for AWS accounts and services. It provides a history of
actions taken by users, applications, and AWS services, including API calls, resource changes, and
configuration updates. CloudTrail logs can be used for security analysis, compliance auditing, and
troubleshooting.
AWS Config:
• AWS Config provides a detailed inventory of AWS resources and tracks changes to resource
configurations over time. It helps users assess the compliance of their AWS environments with
predefined rules and policies, detect drift from desired configurations, and troubleshoot
configuration changes.
AWS Monitoring Tools
• Visualizing Trace Data: X-Ray provides visualizations and diagrams that show the
flow of requests through the application architecture. Developers can view traces in the
X-Ray console, which displays a graphical representation of the request flow, including
the duration of each segment, error rates, and external service dependencies.
• Performance Analysis: X-Ray captures performance metrics for each segment, such
as response times, latency, and error rates. Developers can use these metrics to analyze
the performance of individual components and identify areas for optimization and
improvement.
• Root Cause Analysis: X-Ray helps developers pinpoint the root causes of performance
issues and errors by correlating trace data with other monitoring and logging
information. Developers can drill down into individual traces to identify bottlenecks,
investigate errors, and understand the impact of changes on application performance.
AWS Monitoring Tools
Prometheus:
• Prometheus is an open-source monitoring and alerting toolkit designed for collecting and storing time-
series data. It is highly efficient and scalable, making it well-suited for monitoring dynamic,
containerized environments.
Key features of Prometheus include:
• Data Collection: Prometheus scrapes metrics from instrumented targets using a pull model. It supports
various service discovery mechanisms for dynamically discovering targets in cloud environments.
• Data Storage: Prometheus stores collected metrics in a time-series database optimized for high
performance and retention. Metrics can be queried using the Prometheus Query Language (PromQL)
for real-time analysis and visualization.
• Alerting: Prometheus integrates with alerting systems to generate alerts based on predefined rules and
thresholds. It supports alert managers like Alertmanager for managing and routing alerts to appropriate
channels.
• Exporters and Integrations: Prometheus ecosystem includes exporters and integrations for collecting
metrics from a wide range of systems and services, including Kubernetes, Docker, AWS, and more.
AWS Monitoring Tools
Grafana:
• Grafana is an open-source analytics and visualization platform that allows users to create and share
dynamic dashboards for monitoring and analyzing time-series data. It supports various data sources,
including Prometheus, to visualize metrics and logs.
Key features of Grafana include:
• Dashboard Creation: Grafana provides a rich set of visualization options, including graphs, charts,
tables, and heatmaps, to create customizable dashboards for monitoring metrics and logs.
• Data Source Integration: Grafana integrates with various data sources, including Prometheus,
Graphite, InfluxDB, Elasticsearch, and more. Users can query and visualize data from multiple
sources within the same dashboard.
• Alerting and Annotations: Grafana supports alerting based on metric thresholds and annotations to
add contextual information to dashboards. It integrates with alerting systems like Prometheus
Alertmanager for sending notifications.
• Templating: Grafana allows users to create dynamic dashboards using templating variables, enabling
them to switch between different data sources, time ranges, or dimensions dynamically.
AWS DevOps Services
AWS CodeBuild:
• AWS CodeBuild is a fully managed build service that compiles source code,
runs tests, and produces deployable artifacts such as executable files or
Docker images. It supports various programming languages and build tools,
and can be integrated with CodePipeline to automate the build process as part
of a CI/CD pipeline.
AWS CodeDeploy:
• AWS CodeDeploy is a deployment automation service that facilitates the
automated deployment of applications to Amazon EC2 instances, AWS
Lambda functions, and on-premises servers. It supports blue-green
deployments, in-place deployments, and can integrate with CodePipeline to
automate the deployment process as part of a CI/CD pipeline.
AWS DevOps Services
AWS CodeCommit:
• AWS CodeCommit is a fully managed source code repository service that allows teams to securely
store and version control their source code in the cloud. It supports Git-based version control
workflows and integrates with other AWS DevOps services such as CodePipeline and CodeBuild.
AWS CodeStar:
• AWS CodeStar is a cloud-based integrated development environment (IDE) that provides project
templates, code repositories, CI/CD pipelines, and collaboration tools to help teams quickly
develop, build, and deploy applications on AWS. It streamlines the setup of development
environments and automates the integration of AWS DevOps services.
AWS CodeArtifact:
• AWS CodeArtifact is a fully managed artifact repository service that allows organizations to store,
share, and manage software packages and dependencies. It supports popular package formats such
as npm, Maven, and PyPI, and integrates with CI/CD pipelines to automate package management
and distribution.
AWS DevOps Services
AWS CodeGuru:
• AWS CodeGuru is a machine learning-powered developer tool that provides
automated code reviews and performance recommendations. It analyzes code
to identify issues, security vulnerabilities, and performance optimizations,
helping developers improve code quality and application performance.
AWS Amplify:
• AWS Amplify is a set of tools and services for building and deploying full-
stack web and mobile applications. It provides features such as authentication,
data storage, hosting, and CI/CD integration, enabling developers to build and
deploy applications quickly and easily.
AWS DevOps Services
• The AWS Code Suite is a collection of services and tools provided by
Amazon Web Services (AWS) to support software development
processes and enable DevOps practices.
• These services are designed to automate various aspects of the
software development lifecycle (SDLC), including code management,
build automation, testing, deployment, and monitoring.
AWS DevOps Services
Key components of the AWS Code Suite:
AWS CodeCommit:
• AWS CodeCommit is a fully managed source control service that enables teams to
securely store and version control their source code in the cloud.
• It provides Git-based repositories for hosting code, supports branching and merging
workflows, and integrates with other AWS DevOps services.
AWS CodeBuild:
• AWS CodeBuild is a fully managed build service that compiles source code, runs
tests, and produces deployable artifacts such as executable files or Docker images.
• It supports various programming languages and build tools, and can be integrated
with other AWS services for continuous integration (CI) and continuous delivery
(CD) workflows.
AWS DevOps Services
AWS CodeDeploy:
• AWS CodeDeploy is a deployment automation service that facilitates the automated
deployment of applications to Amazon EC2 instances, AWS Lambda functions, and
on-premises servers.
• It supports blue-green deployments, in-place deployments, and integrates with other
AWS DevOps services to automate the deployment process.
AWS CodePipeline:
• AWS CodePipeline is a fully managed continuous integration and continuous
delivery (CI/CD) service that automates the build, test, and deployment processes for
applications.
• It allows users to define and visualize release pipelines, integrate with various source
code repositories and build tools, and automate the testing and deployment of
applications across different environments.
AWS DevOps Services
AWS CodeStar:
• AWS CodeStar is a cloud-based integrated development environment (IDE) that provides project
templates, code repositories, CI/CD pipelines, and collaboration tools to help teams quickly
develop, build, and deploy applications on AWS. It streamlines the setup of development
environments and automates the integration of AWS DevOps services.
AWS CodeArtifact:
• AWS CodeArtifact is a fully managed artifact repository service that allows organizations to store,
share, and manage software packages and dependencies. It supports popular package formats such
as npm, Maven, and PyPI, and integrates with CI/CD pipelines to automate package management
and distribution.
AWS CodeDeploy Application Load Balancer (ALB) Deployment:
• This is a specialized deployment option within AWS CodeDeploy that allows users to perform
blue-green deployments of applications behind an Application Load Balancer (ALB). It enables
seamless and controlled traffic shifting between different versions of the application during
deployment.
Elastic Beanstalk
• AWS Elastic Beanstalk is a Platform as a Service (PaaS) offering from Amazon
Web Services (AWS) that simplifies the deployment and management of web
applications and services.
• It allows developers to quickly deploy applications without worrying about the
underlying infrastructure details, such as provisioning servers, configuring load
balancers, or managing scaling policies.
• AWS Elastic Beanstalk simplifies the deployment and management of web
applications and services by abstracting away the complexity of infrastructure
management and allowing developers to focus on building and deploying their
applications.
• It provides a scalable, reliable, and cost-effective platform for running various
types of applications on AWS.
Elastic Beanstalk
Overview of AWS Elastic Beanstalk:
• Ease of Deployment: Elastic Beanstalk streamlines the deployment process
by providing a managed platform where developers can simply upload their
application code (e.g., Java, .NET, Node.js, Python, Ruby, Go, Docker) and
Elastic Beanstalk handles the rest, including application provisioning, load
balancing, auto-scaling, and health monitoring.
• Multiple Programming Languages and Platforms: Elastic Beanstalk
supports a wide range of programming languages, frameworks, and platforms,
making it suitable for various types of applications. Developers can choose
from pre-configured platform configurations for specific languages and
frameworks, or they can use custom platform configurations to deploy their
own environment.
Elastic Beanstalk
Overview of AWS Elastic Beanstalk:
• Managed Environment: Elastic Beanstalk automatically provisions and manages the underlying
infrastructure, including EC2 instances, load balancers, auto-scaling groups, and networking components. It
provides a choice of environment types (e.g., Web server environment, Worker environment) and
configuration options to tailor the environment to the specific needs of the application.
• Auto Scaling: Elastic Beanstalk automatically scales the underlying infrastructure based on application
demand. It monitors application metrics, such as CPU utilization, memory usage, and network traffic, and
adjusts the number of EC2 instances accordingly to handle traffic spikes and maintain performance.
• Load Balancing: Elastic Beanstalk automatically provisions and configures an Elastic Load Balancer
(ELB) to distribute incoming traffic across multiple EC2 instances. This helps improve application
availability, fault tolerance, and scalability by distributing traffic evenly and automatically routing around
unhealthy instances.
• Managed Updates and Rollbacks: Elastic Beanstalk handles application updates and deployments
seamlessly, allowing developers to perform rolling updates with zero downtime. It also supports automatic
rollbacks in case of deployment failures or errors, ensuring application availability and reliability.
Elastic Beanstalk
• Integration with AWS Services: Elastic Beanstalk integrates with various AWS
services, such as RDS (Relational Database Service), S3 (Simple Storage
Service), CloudWatch (monitoring and logging), and more, enabling developers
to leverage additional AWS features and services within their applications.
• Monitoring and Logging: Elastic Beanstalk provides built-in monitoring and
logging capabilities through integration with AWS CloudWatch. Developers can
monitor application health, view performance metrics, and access application
logs in the Elastic Beanstalk console or through CloudWatch.
• CLI and APIs: Elastic Beanstalk offers command-line interface (CLI) tools and
APIs that enable developers to automate deployment and management tasks,
integrate with CI/CD pipelines, and customize their deployment workflows
programmatically.
Amazon Web Services (AWS) - LABS
Thank you