Showing posts with label AWS Elastic Beanstalk Service. Show all posts
Showing posts with label AWS Elastic Beanstalk Service. Show all posts

Setup EB Environment & Run application using Elastic Beanstalk.

  

  1. Setup Environment & Run application using Elastic Beanstalk.

    1. Download a working application version from Elastic beanstalk from the existing environment.

      1. Use platform settings if needed and add permission to the files as follows:

        chmod +x .platform/hooks/postdeploy/01_managePermissions.sh

         

    2. Create a new Environment.

      1. Go to Elastic Beanstalk.

      2. Create a new Environment. https://us-west-2.console.aws.amazon.com/elasticbeanstalk/home?region=us-west-2#/environments

      3. Select environment tier → Web server environment.

      4. Enter

        1. Application Name,

        2. Environment Name

        3. Domain name [Optional]

        4. Platform → Managed platform

          1. Platform → PHP

          2. Platform branch → PHP 8.0 running on 64bit Amazon Linux 2

          3. Platform version → 3.3.6 (Recommended)

        5. Application code → Upload your code

          1. Source code origin → Local file → Choose file → Upload a working application version downloaded from Elastic beanstalk from the existing environment.

        6. Click on → Configure more options

    3. Set up Environment configuration page

      1. Modify software :

        1. Proxy server → apache

        2. Document root → /public

        3. Environment properties → [Provide the key-value pair for setting Environment variables.]
          ENVIRONMENT: Staging/Production

      2. Modify instances :

        1. Root volume type → General Purpose (SSD)

        2. Size → 50GB

        3. EC2 security groups → [Select the security group for access]

      3. Modify capacity :

        1. Auto scaling group → Environment type → Load Balancer

        2. Scaling triggers → CPU Utilization → Percentage [70, 20]

      4. Load Balancer : [Do later for HTTPS to avoid grey status]

        1. Add this once the Environment is ready to avoid any failure.
          Listeners → add 443 HTTPS
          [Use Valid certificate from ACM
          Check the HTTPS access using the test domains defined on Route53.]

      5. Rolling updates and deployments :

        1. Deployment policy → Rolling with additional batch

        2. Rolling update type → Rolling based on Health. [If multiple instances available]

      6. Security :

        1. Virtual machine permissions → Choose EC2 key pair

      7. Monitoring :

        1. Health reporting → Basic

      8. Click on → Create Environment

    4. Deployment to the new Environment using Pipeline.

      1. Update Pipeline with correct Application & Environment for deployment.

      2. Run the pipeline to deploy updated code to the new environment.

    5. Use the Domain name on Postman to verify the functionality.