Creating an Elastic Beanstalk environment
The following procedure launches a new environment running the default application. These steps are simplified to get your environment up and running quickly, using default option values.
Note about permissions
Creating an environment requires the permissions in the Elastic Beanstalk full access managed policy. See Elastic Beanstalk user policy for details.
To launch an environment with an application (console)
Open the Elastic Beanstalk console
, and in the Regions list, select your AWS Region. -
In the navigation pane, choose Applications. Select an existing application in the list. You can also choose to create one, following the instructions in Managing applications.
-
On the application overview page, choose Create environment.
This launches the Create environment wizard. The wizard provides a set of steps for you to create a new environment.
-
For Environment tier, choose the Web server environment or Worker environment environment tier. You can't change an environment's tier after creation.
Note
The .NET on Windows Server platform doesn't support the worker environment tier.
The Application information fields default, based on the application that you previously chose.
In the Environment information grouping the Environment name defaults, based on the application name. If you prefer a different environment name you can enter another value in the field. You can optionally enter a Domain name; otherwise Elastic Beanstalk autogenerates a value. You can also optionally enter an Environment description.
-
For Platform, select the platform and platform branch that match the language your application uses.
Note
Elastic Beanstalk supports multiple versions for most of the platforms that are listed. By default, the console selects the recommended version for the platform and platform branch you choose. If your application requires a different version, you can select it here. For information about supported platform versions, see Elastic Beanstalk supported platforms.
-
For Application code, you have several choices to proceed.
-
To launch the default sample application without supplying the source code, choose Sample application. This action chooses the single page application that Elastic Beanstalk provides for the platform you previously selected.
-
If you downloaded a sample application from this guide, or you have your own source code for an application, do the following steps.
-
Select Upload your code.
-
Next choose Local file, then under Upload application, select Choose file.
-
Your client machine's operating system will present you with an interface to select the local file that you downloaded. Select the source bundle file and continue.
-
-
-
Your choice for Presets depends on your purpose for the environment.
If you're creating a sample environment to learn about Elastic Beanstalk or a development environment, choose Single instance (free tier eligible).
If you're creating a production environment or an environment to learn more about load balancing, choose one of the High availability options.
-
Choose Next.
To configure service access
Next, you need two roles. A service role allows Elastic Beanstalk to monitor your EC2 instances and upgrade you environment’s platform. An EC2 instance profile role permits tasks such as writing logs and interacting with other services.
To create or select the Service role
-
If you have previously created a Service role and would like to choose an existing one, select the value from the Service role drop-down and skip the remainder of these steps to create a Service role.
-
If you don't see any values listed for Service role, or you'd like to create a new one, continue with the next steps.
-
For Service role, choose Create role.
-
For Trusted entity type, choose AWS service.
-
For Use case, choose Elastic Beanstalk – Environment.
-
Choose Next.
-
Verify that Permissions policies include the following, then choose Next:
-
AWSElasticBeanstalkEnhancedHealth
-
AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy
-
-
Choose Create role.
-
Return to the Configure service access tab, refresh the list, then select the newly created service role.
To create or select an EC2 instance profile
-
If you have previously created an EC2 instance profile and would like to choose an existing one, select the value from the EC2 instance profile drop-down and skip the remainder of these steps to create an EC2 instance profile.
-
If you don't see any values listed for EC2 instance profile, or you'd like to create a new one, continue with the next steps.
-
Choose Create role.
-
For Trusted entity type, choose AWS service.
-
For Use case, choose Elastic Beanstalk – Compute.
-
Choose Next.
-
Verify that Permissions policies include the following, then choose Next:
AWSElasticBeanstalkWebTier
AWSElasticBeanstalkWorkerTier
AWSElasticBeanstalkMulticontainerDocker
Choose Create role.
-
Return to the Configure service access tab, refresh the list, then select the newly created EC2 instance profile.
To finish configuring and creating your application
-
(Optional) If you previously created an EC2 key pair, you can select it from the EC2 key pair field dropdown. You would use it to securely log in to the Amazon EC2 instance that Elastic Beanstalk provisions for your application. If you skip this step, you can always create and assign an EC2 key pair after the environment is created. For more information, see EC2 key pair.
-
Choose Skip to Review on the Configure service access page.
-
The Review page displays a summary of all your choices.
To further customize your environment, choose Edit next to the step that includes any items you want to configure. You can set the following options only during environment creation:
-
Environment name
-
Domain name
-
Platform version
-
Processor
-
Load balancer type
-
Tier
You can change the following settings after environment creation, but they require new instances or other resources to be provisioned and can take a long time to apply:
-
Instance type, root volume, key pair, and AWS Identity and Access Management (IAM) role
-
Internal Amazon RDS database
-
VPC
For details on all available settings, see The create new environment wizard.
-
-
Choose Submit at the bottom of the page to initialize the creation of your new environment.
While Elastic Beanstalk creates your environment, you are redirected to the Elastic Beanstalk console. When the environment health turns green, choose the URL next to the environment name to view the running application. This URL is generally accessible from the internet unless you configure your environment to use a custom VPC with an internal load balancer.