AWS Security ChangesHomeSearch

AWS batch documentation change

Service: batch · 2025-05-22 · Documentation low

File: batch/latest/userguide/getting-started-ec2.md

Summary

Restructured tutorial with simplified steps, added overview/prerequisites sections, removed detailed configuration options, and added post-job cleanup guidance

Security assessment

Changes focus on tutorial structure simplification and user guidance rather than security aspects. Removed technical details about IAM roles/security groups but maintained references to required security components like ecsInstanceRole. No evidence of addressing vulnerabilities or adding security-specific documentation.

Diff

diff --git a/batch/latest/userguide/getting-started-ec2.md b/batch/latest/userguide/getting-started-ec2.md
index 53f4464c0..698584387 100644
--- a//batch/latest/userguide/getting-started-ec2.md
+++ b//batch/latest/userguide/getting-started-ec2.md
@@ -5 +5 @@
-Create a compute environmentCreate a job queueCreate a job definitionCreate a jobReview and create
+OverviewPrerequisitesStep 1: Create a compute environmentStep 2: Create a job queueStep 3: Create a job definitionStep 4: Create a jobStep 5: Review and createStep 6: View the Job's outputStep 7: Clean up your tutorial resourcesAdditional resources
@@ -7 +7 @@ Create a compute environmentCreate a job queueCreate a job definitionCreate a jo
-# Tutorial: Getting started with Amazon EC2 orchestration
+# Getting started with Amazon EC2 orchestration using the Wizard
@@ -13 +13 @@ You can use Amazon EC2 to launch as many or as few virtual servers as you need,
-## Create a compute environment
+## Overview
@@ -15 +15 @@ You can use Amazon EC2 to launch as many or as few virtual servers as you need,
-To create a compute environment for an Amazon EC2 orchestration, do the following:
+This tutorial demonstrates how to setup AWS Batch with the Wizard to configure Amazon EC2 and run `Hello World`. 
@@ -17 +17 @@ To create a compute environment for an Amazon EC2 orchestration, do the followin
-  1. Open the [AWS Batch console first-run wizard](https://console.aws.amazon.com/batch/home#wizard).
+**Intended Audience**
@@ -19 +18,0 @@ To create a compute environment for an Amazon EC2 orchestration, do the followin
-  2. For **Select orchestration type** , choose **Amazon Elastic Compute Cloud(Amazon EC2)**.
@@ -21 +20 @@ To create a compute environment for an Amazon EC2 orchestration, do the followin
-  3. Choose**Next**.
+This tutorial is designed for system administrators and developers responsible for setting up, testing, and deploying AWS Batch.
@@ -23 +22 @@ To create a compute environment for an Amazon EC2 orchestration, do the followin
-  4. In the **Compute environment configuration** section for **Name** , specify a unique name for your compute environment. The name can be up to 128 characters in length. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
+**Features Used**
@@ -25 +23,0 @@ To create a compute environment for an Amazon EC2 orchestration, do the followin
-  5. For **Instance role** , choose an existing instance profile that has the required IAM permissions attached. This instance profile allows the Amazon ECS container instances in your compute environment to make calls to the required AWS API operations. For more information, see [Amazon ECS instance role](./instance_IAM_role.html). 
@@ -27 +25 @@ To create a compute environment for an Amazon EC2 orchestration, do the followin
-  6. (Optional) A tag is a label that's assigned to a resource. To add a tag or an Amazon EC2 tag, expand **Tags** , then choose **Add tag**. Enter a key-value pair, and then choose **Add tag** again.
+This tutorial shows you how to use the AWS Batch console wizard to:
@@ -29,3 +27 @@ To create a compute environment for an Amazon EC2 orchestration, do the followin
-###### Important
-
-If you choose **Add tag** , you must enter a key-value pair and choose **Add tag** again or choose **Remove tag**.
+  * Create and configure an Amazon EC2 compute environment
@@ -33 +29 @@ If you choose **Add tag** , you must enter a key-value pair and choose **Add tag
-  7. (Optional) In the **Instance configuration** section for **Use Amazon EC2**Spot** instances**, turn on **Enable using**Spot** instances**.
+  * Create a job queue.
@@ -35 +31 @@ If you choose **Add tag** , you must enter a key-value pair and choose **Add tag
-  8. (**Spot** only) For **Maximum % on-demand price** , enter the maximum percentage of On-demand pricing that you want to pay for Spot resources.
+  * Create a job definition
@@ -37 +33 @@ If you choose **Add tag** , you must enter a key-value pair and choose **Add tag
-  9. (Optional) (Spot only) For **Spot fleet role** , choose an existing Amazon EC2 Spot Fleet IAM role to apply to your Spot compute environment. If you don't already have an existing Amazon EC2 Spot Fleet IAM role, you must create one first. For more information, see [Amazon EC2 spot fleet role](./spot_fleet_IAM_role.html).
+  * Create and submit a job to run
@@ -39 +35 @@ If you choose **Add tag** , you must enter a key-value pair and choose **Add tag
-###### Important
+  * View the output of the job in CloudWatch
@@ -41 +36,0 @@ If you choose **Add tag** , you must enter a key-value pair and choose **Add tag
-To tag your Spot Instances on creation, your Amazon EC2 Spot Fleet IAM role must use the newer **AmazonEC2SpotFleetTaggingRole** managed policy. The **AmazonEC2SpotFleetRole** managed policy doesn't have the required permissions to tag Spot Instances. For more information, see [Spot Instances not tagged on creation](./spot-instance-no-tag.html) and [Tag your resources](./tag-resources.html).
@@ -43 +37,0 @@ To tag your Spot Instances on creation, your Amazon EC2 Spot Fleet IAM role must
-  10. For **Minimum vCPUs** , choose the minimum number of EC2 vCPUs that your compute environment maintains, regardless of job queue demand.
@@ -45 +38,0 @@ To tag your Spot Instances on creation, your Amazon EC2 Spot Fleet IAM role must
-  11. For **Desired vCPUs** , choose the number of EC2 vCPUs that your compute environment launches with. As job queue demand increases, AWS Batch increases the desired number of vCPUs and add EC2 instances. The number of vCPUs can increase up to the maximum number of vCPUs. As demand decreases, AWS Batch decreases the desired number of vCPUs and remove instances. The number of decrease all the way to the minimum number of vCPUs.
@@ -47 +40 @@ To tag your Spot Instances on creation, your Amazon EC2 Spot Fleet IAM role must
-  12. For **Maximum vCPUs** , choose the maximum number of EC2 vCPUs that your compute environment can scale out to, regardless of job queue demand.
+**Time Required**
@@ -49 +41,0 @@ To tag your Spot Instances on creation, your Amazon EC2 Spot Fleet IAM role must
-  13. For **Allowed instance types** , choose the Amazon EC2 instance types that can be launched. You can specify instance families to launch any instance type within those families (for example, `c5`, `c5n`, or `p3`). Or, you can specify specific sizes within a family (such as `c5.8xlarge`). Metal instance types aren't in the instance families. For example, `c5` doesn't include `c5.metal`. You can also choose `optimal` to select instance types (from the C4, M4, and R4 instance families) that match the demand of your job queues.
@@ -51 +43 @@ To tag your Spot Instances on creation, your Amazon EC2 Spot Fleet IAM role must
-###### Note
+It should take about 10–15 minutes to complete this tutorial.
@@ -53 +45 @@ To tag your Spot Instances on creation, your Amazon EC2 Spot Fleet IAM role must
-When you create a compute environment, the instance types that you select for the compute environment must share the same architecture. For example, you can't mix x86 and ARM instances in the same compute environment.
+**Regional Restrictions**
@@ -55 +46,0 @@ When you create a compute environment, the instance types that you select for th
-###### Note
@@ -57 +48 @@ When you create a compute environment, the instance types that you select for th
-AWS Batch scales GPUs based on the required amount in your job queues. To use GPU scheduling, the compute environment must include instance types from the `p2`, `p3`, `p4`, `p5`, `g3`, `g3s`, `g4`, or `g5` family.
+There are no country or regional restrictions associated with using this solution.
@@ -59 +50 @@ AWS Batch scales GPUs based on the required amount in your job queues. To use GP
-###### Note
+**Resource Usage Costs**
@@ -61 +51,0 @@ AWS Batch scales GPUs based on the required amount in your job queues. To use GP
-Currently, `optimal` uses instance types from the C4, M4, and R4 instance families. In AWS Regions that don't have instance types from those instance families, instance types from the C5, M5, and R5 instance families are used.
@@ -63,11 +53 @@ Currently, `optimal` uses instance types from the C4, M4, and R4 instance famili
-  14. Expand **Additional configuration**.
-
-  15. (Optional) For **Placement group** , enter a placement group name to group resources in the compute environment.
-
-  16. (Optional) For **EC2 key pair** , choose a public and private key pair as security credentials when you connect to the instance. For more information about Amazon EC2 key pairs, see [Amazon EC2 key pairs and Linux instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html). 
-
-  17. For **Allocation strategy** , choose the allocation strategy to use when selecting instance types from the list of allowed instance types. **BEST_FIT_PROGRESSIVE** is usually the better choice for EC2 On-Demand compute environments, and **SPOT_CAPACITY_OPTIMIZED** for EC2 Spot compute environments. For more information, see [Instance type allocation strategies for AWS Batch](./allocation-strategies.html).
-
-  18. (Optional) For **EC2 configuration** , choose **Add EC2 configuration**. Choose **Image type** and **Image ID override** values to provide information for AWS Batch to select Amazon Machine Images (AMIs) for instances in the compute environment. If the **Image ID override** isn't specified for each **Image type** , AWS Batch selects a recent [Amazon ECS optimized AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html). If no **Image type** is specified, the default is a **Amazon Linux 2** for non-GPU, non-AWS Graviton instance. 
-
-###### Important
+There's no charge for creating an AWS account. However, by implementing this solution, you might incur some or all of the costs that are listed in the following table.
@@ -75 +55,3 @@ Currently, `optimal` uses instance types from the C4, M4, and R4 instance famili
-To use a custom AMI, choose the image type and then enter the custom AMI ID in the **Image ID override** box.
+Description | Cost (US dollars)  
+---|---  
+Amazon EC2 instance | You pay for each Amazon EC2 instance that is created. For more information about pricing, see [Amazon EC2 Pricing](https://aws.amazon.com/ec2/pricing/).  
@@ -77 +59 @@ To use a custom AMI, choose the image type and then enter the custom AMI ID in t
-[Amazon Linux 2](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#al2ami)
+## Prerequisites
@@ -78,0 +61 @@ To use a custom AMI, choose the image type and then enter the custom AMI ID in t
+Before you begin:
@@ -80 +63 @@ To use a custom AMI, choose the image type and then enter the custom AMI ID in t
-Default for all AWS Graviton-based instance families (for example, `C6g`, `M6g`, `R6g`, and `T4g`) and can be used for all non-GPU instance types.
+  * Create an AWS account if you don't have one.
@@ -82 +65 @@ Default for all AWS Graviton-based instance families (for example, `C6g`, `M6g`,
-[Amazon Linux 2 (GPU)](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#gpuami)
+  * Create the [ecsInstanceRole Instance role](./batch-check-ecsinstancerole.html).
@@ -85 +67,0 @@ Default for all AWS Graviton-based instance families (for example, `C6g`, `M6g`,
-Default for all GPU instance families (for example `P4` and `G4`) and can be used for all non AWS Graviton-based instance types.
@@ -87 +68,0 @@ Default for all GPU instance families (for example `P4` and `G4`) and can be use
-Amazon Linux
@@ -88,0 +70 @@ Amazon Linux
+## Step 1: Create a compute environment
@@ -90,9 +72 @@ Amazon Linux
-Can be used for non-GPU, non AWS Graviton instance families. The standard support for Amazon Linux AMI has ended. For more information, see [Amazon Linux AMI](https://aws.amazon.com/amazon-linux-ami/).
-
-###### Note
-
-The AMI that you choose for a compute environment must match the architecture of the instance types that you want to use for that compute environment. For example, if your compute environment uses A1 instance types, the compute resource AMI that you choose must support Arm instances. Amazon ECS vends both x86 and Arm versions of the Amazon ECS optimized Amazon Linux 2 AMI. For more information, see [Amazon ECS optimized Amazon Linux 2 AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#ecs-optimized-ami-linux-variants.html) in the _Amazon Elastic Container Service Developer Guide_.
-
-  19. (Optional) For **Launch template** , select an existing Amazon EC2 launch template to configure your compute resources. The default version of the template is automatically populated. For more information, see [Use Amazon EC2 launch templates with AWS Batch](./launch-templates.html).
-
-###### Note
+###### Important
@@ -100 +74 @@ The AMI that you choose for a compute environment must match the architecture of
-In a launch template, you can specify a custom AMI that you created.
+To get started as simply and quickly as possible, this tutorial includes steps with default settings. Before creating for production use, we recommend that you familiarize yourself with all settings and deploy with the settings that meet your requirements.
@@ -102 +76 @@ In a launch template, you can specify a custom AMI that you created.
-  20. (Optional) For **Launch template version** , enter `$Default`, `$Latest`, or a specific version number to use.
+To create a compute environment for an Amazon EC2 orchestration, do the following:
@@ -104 +78 @@ In a launch template, you can specify a custom AMI that you created.
-###### Important
+  1. Open the [AWS Batch console first-run wizard](https://console.aws.amazon.com/batch/home#wizard).
@@ -106 +80 @@ In a launch template, you can specify a custom AMI that you created.
-After the compute environment is created, the launch template version used isn't changed even if the `$Default` or `$Latest` version for the launch template is updated. To use a new launch template version, first create a new compute environment, add the new compute environment to the existing job queue. Then, remove the old compute environment from the job queue, and delete the old compute environment.
+  2. For **Configure job and orchestration type** , choose **Amazon Elastic Compute Cloud(Amazon EC2)**.
@@ -108 +82 @@ After the compute environment is created, the launch template version used isn't
-  21. In the **Network configuration** section:
+  3. Choose**Next**.
@@ -110 +84 @@ After the compute environment is created, the launch template version used isn't
-    1. For **Virtual Private Cloud (VPC) ID** , choose an Amazon VPC.
+  4. In the **Compute environment configuration** section for **Name** , specify a unique name for your compute environment. The name can be up to 128 characters in length. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_). 
@@ -112 +86 @@ After the compute environment is created, the launch template version used isn't
-    2. For **Subnets** , the subnets for your AWS account are listed. If you want to create a custom set of subnets, choose **Clear subnets** , and then choose the subnets that you want.
+  5. For **Instance role** , choose an existing instance role that has the required IAM permissions attached. This instance role allows the Amazon ECS container instances in your compute environment to make calls to the required AWS API operations. For more information, see [Amazon ECS instance role](./instance_IAM_role.html). 
@@ -114 +88 @@ After the compute environment is created, the launch template version used isn't
-###### Important
+The default name of the **Instance role** is `ecsInstanceRole`. 
@@ -116 +90 @@ After the compute environment is created, the launch template version used isn't
-Compute resources must communicate with the Amazon ECS VPC endpoint through a VPC endpoint or multiple public IP address. For more information, see [Amazon ECS interface VPC endpoints ([AWS PrivateLink](./create-a-vpc.html))](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/vpc-endpoints.html). If your instance doesn't have a VPC endpoint configured or a public IP address, you can use network address translation (NAT). For more information about NAT, see [NAT gateways](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) and [Create a virtual private cloud ](./create-public-private-vpc.html).
+  6. For **Instance configuration** you can leave the default settings.
@@ -118 +92 @@ Compute resources must communicate with the Amazon ECS VPC endpoint through a VP
-    3. For **Security groups** , choose the Amazon EC2 security groups that you want to associate with the instance. If you want to create a custom set of security groups, choose **Clear security groups**. Then, choose the security groups that you want.
+  7. For **Network configuration** use your default VPN for the AWS Region.
@@ -120 +94 @@ Compute resources must communicate with the Amazon ECS VPC endpoint through a VP
-  22. Choose **Next**.
+  8. Choose **Next**.
@@ -125 +99 @@ Compute resources must communicate with the Amazon ECS VPC endpoint through a VP
-## Create a job queue
+## Step 2: Create a job queue
@@ -131 +105 @@ To create a job queue for an Amazon EC2 orchestration, do the following:
-  1. In the **Job queue configuration** section for **Name** , specify a unique name for your compute environment. The name can be up to 128 characters in length. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
+  1. For **Job queue configuration** for **Name** , specify a unique name for your job queue. The name can be up to 128 characters in length. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_). 
@@ -133,5 +107 @@ To create a job queue for an Amazon EC2 orchestration, do the following:
-  2. For **Priority** , enter an integer between 0 and 100 for the job queue. 
-
-###### Important
-
-Higher integer values are assigned a higher priority by the AWS Batch Scheduler.
+  2. For all other configuration options you can leave the default value.
@@ -144 +114 @@ Higher integer values are assigned a higher priority by the AWS Batch Scheduler.
-## Create a job definition
+## Step 3: Create a job definition
@@ -150,17 +120 @@ To create the job definition:
-  1. In the **General configuration** section:
-
-    1. In the **General configuration** section for **Name** , specify a unique name for your compute environment. The name can be up to 128 characters in length. The name can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
-
-    2. (Optional) For **Execution timeout** , enter the amount of time (in seconds) that an unfinished job terminates after. 
-
-###### Important
-
-The minimum timeout is 60 seconds.
-
-    3. (Optional) A tag is a label that's assigned to a resource. To add a tag, expand **Tags** , then choose **Add tag**. Enter a key-value pair, and then choose **Add tag** again.
-
-###### Important
-
-If you choose **Add tag** , you must enter a key-value pair and choose **Add tag** again or choose **Remove tag**.
-
-    4. (Optional) Turn on **Propagate tags** to propagate tags to the Amazon Elastic Container Service task.
+  1. For **Create a job definition**
@@ -168 +122 @@ If you choose **Add tag** , you must enter a key-value pair and choose **Add tag
-  2. In the **Container configuration** section:
+    1. for **Name** , specify a unique name for your job queue. The name can be up to 128 characters in length. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
@@ -170 +124 @@ If you choose **Add tag** , you must enter a key-value pair and choose **Add tag
-    1. For **Image** , enter the name of the image that's used to launch the container. By default, all the images in the Docker Hub registry are available. You can also specify other repositories in _repository-url/image:tag_ format. The parameter can be up to 255 characters in length. The parameter can contain uppercase and lowercase letters, numbers, hyphens (-), underscores (_), colons (:), periods (.), forward slashes (/), and number signs (#). The parameter maps to `Image` in the [Create a container](https://docs.docker.com/engine/api/v1.38/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.docker.com/engine/api/v1.38/) and the `IMAGE` parameter of [**docker run**](https://docs.docker.com/engine/reference/commandline/run/).
+    2. For **Command -_optional_** you can change `hello world` to a custom message or leave it as is.
@@ -172 +126 @@ If you choose **Add tag** , you must enter a key-value pair and choose **Add tag
-###### Note
+  2. For all other configuration options you can leave the default value.
@@ -174,5 +128 @@ If you choose **Add tag** , you must enter a key-value pair and choose **Add tag