Set up Elastic Beanstalk privately

Enhancing business success through smarter korea database management discussions.
Post Reply
Fgjklf
Posts: 205
Joined: Mon Dec 23, 2024 7:27 pm

Set up Elastic Beanstalk privately

Post by Fgjklf »

The second step is to set up an Elastic Beanstalk (EBS) application. One of the advantages of using EBS over pure EC2 instances is that EBS comes with many preconfigured features, such as auto-scaling and rolling updates.

We'll start by creating an EBS application by creating a new environment. The environment is actually where all the configuration takes place. Check out the Elastic Beanstalk (EBS) documentation for more information on how EBS actually works.

2.1. Setting up the environment
Let's see step by step how to configure a new environment:

Choose the “Web server environment”.
Name your environment and assign a domain name
Choose the platform that suits your needs, Go, Java, Node.js, etc.
Choose which application you want to deploy. You investor leads can use the “Sample application” or you can also upload your application “Upload your code”.

Configure the deployment type, in this case you will have to choose the “High availability” option. This will give us the option later to configure a network load balancer, it is very important that it is a network load balancer, since what we want is for the API Gateway to access our APP deployed in EBS via the network.
2.2. Configuring access to the service
Configuring service access will allow you to access the configuration of the permissions and users that will generate the infrastructure, that is, the servers with EC2 and the network load balancer as we mentioned above.

To configure access to the service you must:

Next, you will need to specify the IAMs associated with the EBS server deployment. To do this, you will need to have the “aws-elasticbeanstalk-service-role” in place. To configure the aws-elasticbeanstalk-ec2-role for Elastic Beanstalk, you can follow these steps:
Navigate to IAM: Go to the IAM (Identity and Managed Access) service.
Select Roles: In the left navigation panel.
Find the role: In the list of roles, find or create the aws-elasticbeanstalk-ec2-role role.
Edit role permissions: Select the role and click "Attach Policies".
Attach the necessary policies: For Elastic Beanstalk to work properly, make sure that the role has at least the necessary permissions to access the required resources, such as S3, EC2, etc. If it does not have permissions by default, you must make sure to attach these 3 permissions ( AWSElasticBeanstalkMulticontainerDocker, AWSElasticBeanstalkWebTier, AWSElasticBeanstalkWorkerTier).
Review and apply changes: Once you have attached the necessary policies, review the changes and click "Attach Policies" to apply them.
And also configure the service role that will manage the EBS “aws-elasticbeanstalk-service-role” in IAM.
Navigate to IAM: Go to the IAM (Identity and Managed Access) service.
Select Roles: In the left navigation panel.
Find the role: In the list of roles, find or create the aws-elasticbeanstalk-service-role role.
Edit role permissions: Select the role and click "Attach Policies".
Attach the necessary policies: For Elastic Beanstalk to work properly, make sure that the role has at least the necessary permissions to access the required resources such as S3, EC2, etc. If it does not have permissions by default, you must make sure to attach these 5 permissions (AWSElasticBeanstalkEnhancedHealth, AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy, AWSElasticBeanstalkMulticontainerDocker, AWSElasticBeanstalkWebTier, AWSElasticBeanstalkWorkerTier).
Review and apply changes: Once you have attached the necessary policies, review the changes and click "Attach Policies" to apply them.
Once you have all the permissions created, you can select them:
Post Reply