AWS

20 combinations to deploy your app on AWS 

20 combinations to deploy your app on AWS using EC2, Beanstalk, ECS, Fargate, AppRunner, Amplify, DynamoDB, S3, Llightsail, Outpost, CloudFormations, CodeDeploy, ELB, OpsWorks, EFS, Elastic Beanstalk, Elastic Kubernetes

20 combinations to deploy your app on AWS 

20 combinations to deploy your app on AWS 


Before you start

Before getting into the deployment of our application on Amazon Web Services (AWS), make sure that you meet these prerequisites:

  • Github account and source code repository.
  • AWS account - if you do not have one already, go ahead and create one.
  • IAM user authentication - if you do not have one already, create an IAM user.x 
  • Make sure you have the access key for the IAM user.
  • Setup AWS CDK to be able to create an infrastructure.
  • AWS CLI setup on the system.


If these prerequisites are fulfilled, we can compare the various ways to deploy applications on AWS.

Comparing the methods of deploying applications on AWS


Best used when


To deploy applications faster without investing in hardware upfront.

Steps to deploy an application

Step 1:
Create Infrastructure (EC2 instance) using AWS CDK (Cloud Development Kit).

Step 2: Automate Configuration - to install needed packages and deploy applications using EC2 user data.

Step 3: Deploy by bootstrapping the stack of AWS CDK.

Features

Regions and Availability zones.

  • Instances.
  • Instance types.
  • Elastic IP addresses.
  • Tags.
  • Amazon EBS Volumes.
  • Key pairs.
  • Security groups.
  • Amazon Machine Images (AMIs).

Best used when

To deploy a newer version of an already deployed application.

Steps to deploy an application


Step 1
: Choose from a deployment policy.

Step 2: Deploy a newer version of the application using the Beanstalk console.

Step 3: Redeploy previous versions of applications.

Features

  • Complete control over resources.
  • Unfeasible to outgrow.
  • Developer productivity.
  • Is Beginner friendly.

 


Best used when


To deploy applications with distributed in-memory cache environments in the cloud.


Steps to deploy an application

Step 1:
Create an ElastiCache cluster.

Step 2: Configure ElastiCache Security Group from Amazon EC2.

Step 3: Choose from a deployment policy.

Step 4: Deploy a newer application version using the Beanstalk console.

Step 5: Redeploy previous versions of applications.

Features

  • Detailed engine monitoring statistics.
  • AWS management console that provides ease of management.
  • Node hours- based resource payment.
  • Specific engine protocol-based compatibility.
  • Two engine support - Redis and Memcached.

Best used when

To deploy containerized applications quickly and run workloads of containers on the cloud.

Steps to deploy an application

Step 1: Create a CDK app.

Step 2: Create an ECS cluster with Fargate.

Step 3: Create a service and definition of the task to deploy the application.

Step 4: Deploy using AWS CDK after bootstrapping.

Features

  • Isolation and Security.
  • Logging and Monitoring.
  • Docker, Repository, and AWS Copilot support.
  • Container auto-recovery.
  • Service Mesh and Discovery.
  • Load balancing
  • Serverless by default.
  • Autonomous control plane operations.


Best used when

To deploy applications with end-to-end containerised solutions.

Steps to deploy an application

Step 1: Create an ECS Cluster.

Step 2: Create a task execution role, CloudWatch log group, and task definition.

Step 3: Create a load balancer for the application.

Step 4: Create an ECS service with Fargate.

Step 5: Create an ECR (Elastic Container Registry) for the rebuilt container image

Step 6: Fork nginx-codebuild to the GitHub account.

Step 7: Create the needed IAM roles and pipelines.

Features

  • Visibility and Logging.
  • Permission tiers.
  • Amazon ECS CLI.
  • Container Registry Support.
  • Flexible configuration options.
  • Load balancing.
  • Networking.
  • Fargate and EC2 Launch Type Compatibility.


Best used when

To deploy a source code (mainly web applications) or container image directly into the AWS server.

Steps to deploy an application

Step 1: Create an App Runner service. 

Step 2: Change the service code.

Step 3: Make changes in the configuration.

Step 4: Create a CDK application.

Step 5: Define an IAM role and policy.

Step 6: Using App Runner, deploy a container.


Features

  • Metrics and Logs.
  • Amazon Virtual Private Cloud (VPC).
  • Load balancing.
  • Cost Management.
  • Automatic Deployments.
  • Certificate Management.
  • Auto Scaling.

Best used when

To deploy extensible mobile and full-stack web applications with storage data and authentication.

Steps to deploy an application

Step 1: Connect to your Github repository where your source code lies.

Step 2: Add a custom domain (optional).

Step 3: Add a CNAME Record. 

Features

  • Interactions.
  • Content Management.
  • Amplify Libraries.
  • Amplify Hosting.
  • Analytics.
  • Command hooks.
  • CLI toolchain.
  • PubSub.
  • DataStore.
  • Override generated resources.
  • Push notifications.

Best used when

To deploy serverless full-stack applications utilizing the app client and user pool of Cognito.

Steps to deploy an application

Step 1: Setup Okta as an OpenID Connect identity provider.

Step 2: Create backend resources using CloudFormation.

Step 3: Initiate authentication using Cognito.

Step 4: Create a custom Lambda Authorizer.

Step 5: Connect to your Github repository where your source code lies.

Step 6: Add a custom domain (optional).

Step 7: Add a CNAME Record. 

Features

  • Security against credential compromisation.
  • AWS resources access control.
  • Adaptive authentication.
  • Enterprise and social identity federation.
  • Multiple compliance program support.
  • Standards-based authentication.


Best used when

To deploy applications using NoSQL databases with predictable performance.

Steps to deploy an application

Step 1: Create an IAM role for Amazon EC2.

Step 2: Create the games table.

Step 3: Bundle and deploy the application.

Step 4: Setup AWS Elastic Beanstalk Environment.

Features

  • Kinesis Data Streams for advanced streaming applications.
  • Point-in-time recovery.
  • Read/write capacity modes.
  • DynamoDB Accelerator for Microsecond latency.
  • Triggers for change in tracking.
  • ACID transactions.
  • Global tables for automated global replications.
  • Restore and backup on-demand.
  • Document data models and Key-value.
  • Encryption at rest.


Best used when

To deploy applications with object storage service.

Steps to deploy an application

Step 1: Create an Amazon S3 bucket (CLI).

Step 2: Create an Amazon S3 bucket (console).

Step 3: Give permissions to IAM users and the Amazon S3 bucket.

Step 4: For the bucket, prepare the files of the application.

Step 5: Create an archive file with all of the application's files in it, then push the archive file.


Features

  • Consistent Performance.
  • In place query.
  • S3 object ownership.
  • S3 storage lens.
  • Access management.
  • S3 with AWS PrivateLink.
  • S3 storage class.
  • S3 with IAM Access Analyzer.
  • S3 Object Lambda.
  • Data transfer.

Best used when

To deploy applications with automatic configuration of networking, security environments, and access.

Steps to deploy an application

Step 1: Prepare the container

Step 2: On Amazon Lightsail, create a container service.

Step 3: On Amazon Lightsail, deploy the container.

Step 4: Deploy a newer version of the application.


Features

  • Virtual servers of Lightsail.
  • Managed databases.
  • CDN distributions.
  • Containers.
  • Object and block storage.
  • Load balancers that are simplified.
  • AWS servers with access.



Best used when

To deploy applications with local data processing, low latency, or for which there are data residency conditions.


Steps to deploy an application

Step 1: Install and activate AWS Outpost.

Step 2: Install Helm 3.0 and kubectl version >= 1.20.

Step 3: Setup environment variables.

Step 4: Using the "-without-nodegroup" option of eksctl, create an Amazon Elastic Kubernetes Service (EKS) cluster.

Step 5: From the workstation, verify the connectivity of the EKS cluster.

Step 6: Obtain the VPC ID, build the Outpost Subnet, and tag it according to the EKS specifications.

Step 7: Connect a new route table to the Outpost Subnet.

Step 8: Create an IAM policy with the required permissions to use the IAM Instance profile for the node group.

Step 9: Using eksctl, create a node group.

Step 10: Use the Amazon EBS CSI driver to deploy.

Step 11: Use AWS Load Balance Controller to deploy.


Features

  • Regional services access.
  • Data security.
  • VPC extension.
  • Storage and computing.
  • AWS Nitro System with Enhanced Security.
  • AWS services with local support.
  • Model security.
  • AWS tools.

Best used when

To deploy identical and consistent applications.


Steps to deploy an application

Step 1: Create an EC2 instance.

Step 2: Initialize LAMP (Linux, Apache, MySQL, and PHP) installation.

Step 3: Configure LAMP.

Step 4: Create attributes for CreationPolicy.


Features

  • Dependency Management.
  • Safety Controls.
  • YAML/JSON authorization.
  • Extensibility.
  • Serverless Application Model (SAM) for serverless applications.
  • Widespread programming language authorization using CDK.
  • Cross-region and cross-account configuration.


Best used when

To deploy applications along with a variety of content with no limit.

Steps to deploy an application

Step 1: Launch an EC2 instance.

Step 2: Initiate source content configuration.

Step 3: Upload the application to Amazon S3.

Step 4: Deploy the application. 

Step 5: Redeploy the application after updating.


Features

  • Health tracking of deployment.
  • Deployment history.
  • Integration for the toolchain.
  • Architecture and language agnostic.
  • Rollback and stop.
  • Control and monitoring.
  • Defined events review.
  • History of deployment.
  • Green/Blue and rolling updates.
  • Repeatable deployments.
  • On-premises deployments.
  • Automatic scaling.


Best used when

To deploy applications with distributed network traffic.

Steps to deploy an application

Step 1: Pick a type of load balancer.

Step 2: Define the picked load balancer.

Step 3: To the VPC-based load balancer, assign security groups.

Step 4: For EC2 instances, configure health checks.

Step 5: With the load balancer, register the EC2 instances.

Step 6: Verify the load balancer after creating it.


Features

  • Protocol Listeners.
  • Logging.
  • Fixed response.
  • Zonal Isolation.
  • Health Checks.
  • Flow stickiness.
  • CloudWatch Metrics.
  • Cross-zone Load Balancing.
  • Outpost support.
  • SSL Offloading.
  • Direct-to-pod.
  • Server Name Indication(SNI).
  • Customer Security Policy.
  • Target failure behavior.
  • Custom Security Policy
  • Load Balancer deletion protection.
  • Application-Layer Protocol Negotiation (ALPN).
  • A long-lived TCP connection.


Best used when

To deploy applications with a variety of architectures.


Steps to deploy an application

Step 1: Implement a Recipe

Step 2: Update the Cookbooks of instances.

Step 3: To the custom IIS layer, add the recipe.

Step 4: Deploy the application.


Features

  • APIs and Management console.
  • Windows and Linux support.
  • Software configuration.
  • Auto Healing.
  • On-premises support.
  • Policy and permissions management.
  • Resource configuration.
  • Monitoring.

Best used when

To deploy applications in a set-and-forget, serverless system.

Steps to deploy an application

Step 1: Launch the application stack.

Step 2: Reset the auto-generated password.

Step 3: Create a file manager using the Lambda function.

Step 4: Create Users with Amazon Cognito.

Step 5: Choose groups with “User group for Simple File Manager Admins” in the description.

Features

  1. Compliance and security.
  2. Modes for throughput and performance.
  3. DataSync.
  4. Serverless and container file storage.
  5. Highly durable and available.
  6. Backup.
  7. Encryption.
  8. Lifecycle and storage class management.
  9. Transfer family.
  10. Managed fully.

Best used when

To deploy Beanstalk applications with their own runtime environments (to run on Linux-based application systems).


Steps to deploy an application

Step 1:  Containerise an Elastic Beanstalk application.

Step 2: Local test a container.

Step 3: With dockerfile, deploy a container.

Step 4: Initialise testing to a remote Docker image.

Step 5: To elastic beanstalk, deploy a remote docker image of the application.


Features

  • Rapid system scaling.
  • Easier and faster configuration.
  • Productivity increases.
  • Software-defined network.
  • Management of security.
  • Isolation of application.
  • Swarm.
  • Better software delivery.
  • Size reduction.


Best used when

To deploy Kubernetes-based applications.


Steps to deploy an application

Step 1: Create a namespace.

Step 2: Create a deployment on Kubernetes.

Step 3: To the application cluster, apply the deployment manifest.

Step 4: Create a service.

Step 5: To the application cluster, apply the service manifest.

Step 6: Run the shell on the pod with the application pod id.


Features

  • ARM and windows support.
  • Native Networking with VPC.
  • EKS Connector.
  • Certified conformant.
  • Hybrid deployments.
  • Advanced workload support.
  • Service Mesh and Discovery.
  • Compatibility with open-source.
  • Compliance.
  • Managed Cluster updates.


Best used when

To deploy applications in the chosen database engine in the Kubernetes environment.

Steps to deploy an application

Step 1: Setup the EKS cluster.

Step 2: Install the ACK service controller.

Step 3: For the PostgreSQL database instance, provision an RDS.

Step 4: To EKS, deploy Jira.


Features

  • Reserved instances.
  • Metrics and monitoring.
  • Permissions at the resource level.
  • Automatic host replacement.
  • Storage scaling is made easy.
  • Network isolation.
  • Encryption in transit and at rest.
  • Governance for configuration.
  • Automated backups.
  • General purpose SSD storage.
  • Start and Stop.
  • Multi-AZ deployments.
  • Notifications of events.

Conclusion

In this article, we learned about 20 different combinations to deploy an application on AWS. Every approach has its own set of features and the primary purpose of usage but all of them have one thing in common, i.e., they all belong to the Amazon Web Service (AWS). To find out which might be the best approach for deploying your application, consider the application type, the complexity of source code, and also the features that would assist the deployment of the application at its best.

Diksha B Patro
/
August 11, 2022