Access Amazon Batch using an interface endpoint - Amazon Batch
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Access Amazon Batch using an interface endpoint

You can use Amazon PrivateLink to create a private connection between your VPC and Amazon Batch. You can access Amazon Batch as if it were in your VPC, without the use of an internet gateway, NAT device, VPN connection, or Amazon Direct Connect connection. Instances in your VPC don't need public IP addresses to access Amazon Batch.

You establish this private connection by creating an interface endpoint, powered by Amazon PrivateLink. We create an endpoint network interface in each subnet that you enable for the interface endpoint. These are requester-managed network interfaces that serve as the entry point for traffic destined for Amazon Batch.

For more information, see Interface VPC endpoints in the Amazon PrivateLink Guide.

Considerations for Amazon Batch

Before you set up an interface endpoint for Amazon Batch, review Interface endpoint properties and limitations in the Amazon PrivateLink Guide.

Amazon Batch supports making calls to all of its API actions through the interface endpoint.

Before you set up interface VPC endpoints for Amazon Batch, be aware of the following considerations:

  • Jobs using Fargate resources launch type don't require the interface VPC endpoints for Amazon ECS, but you might need interface VPC endpoints for Amazon Batch, Amazon ECR, Secrets Manager, or Amazon CloudWatch Logs described in the following points.

    • To run jobs, you must create the interface VPC endpoints for Amazon ECS. For more information, see Interface VPC Endpoints (Amazon PrivateLink) in the Amazon Elastic Container Service Developer Guide.

    • To allow your jobs to pull private images from Amazon ECR, you must create the interface VPC endpoints for Amazon ECR. For more information, see Interface VPC Endpoints (Amazon PrivateLink) in the Amazon Elastic Container Registry User Guide.

    • To allow your jobs to pull sensitive data from Secrets Manager, you must create the interface VPC endpoints for Secrets Manager. For more information, see Using Secrets Manager with VPC Endpoints in the Amazon Secrets Manager User Guide.

    • If your VPC doesn't have an internet gateway and your jobs use the awslogs log driver to send log information to CloudWatch Logs, you must create an interface VPC endpoint for CloudWatch Logs. For more information, see Using CloudWatch Logs with Interface VPC Endpoints in the Amazon CloudWatch Logs User Guide.

  • Jobs using the EC2 resources require that the container instances that they're launched on to run version 1.25.1 or later of the Amazon ECS container agent. For more information, see Amazon ECS Linux container agent versions in the Amazon Elastic Container Service Developer Guide.

  • VPC endpoints currently don't support cross-Region requests. Ensure that you create your endpoint in the same Region where you plan to issue your API calls to Amazon Batch.

  • VPC endpoints only support Amazon-provided DNS through Amazon Route 53. If you want to use your own DNS, you can use conditional DNS forwarding. For more information, see DHCP Options Sets in the Amazon VPC User Guide.

  • The security group attached to the VPC endpoint must allow incoming connections on port 443 from the private subnet of the VPC.

  • Amazon Batch does not support VPC interface endpoints in the following Amazon Web Services Regions:

    • Asia Pacific (Osaka) (ap-northeast-3)

    • Asia Pacific (Jakarta) (ap-southeast-3)

Create an interface endpoint for Amazon Batch

You can create an interface endpoint for Amazon Batch using either the Amazon VPC console or the Amazon Command Line Interface (Amazon CLI). For more information, see Create an interface endpoint in the Amazon PrivateLink Guide.

Create an interface endpoint for Amazon Batch using the following service name:

com.amazonaws.region.batch

For example:

com.amazonaws.us-east-2.batch

In the aws-cn partition, the format is different:

cn.com.amazonaws.region.batch

For example:

cn.com.amazonaws.cn-northwest-1.batch

If you enable private DNS for the interface endpoint, you can make API requests to Amazon Batch using its default Regional DNS name. For example, batch.us-east-1.amazonaws.com.

For more information, see Access a service through an interface endpoint in the Amazon PrivateLink Guide.

Create an endpoint policy for your interface endpoint

An endpoint policy is an IAM resource that you can attach to an interface endpoint. The default endpoint policy allows full access to Amazon Batch through the interface endpoint. To control the access allowed to Amazon Batch from your VPC, attach a custom endpoint policy to the interface endpoint.

An endpoint policy specifies the following information:

  • The principals that can perform actions (Amazon Web Services accounts, users, and IAM roles).

  • The actions that can be performed.

  • The resources on which the actions can be performed.

For more information, see Control access to services using endpoint policies in the Amazon PrivateLink Guide.

Example: VPC endpoint policy for Amazon Batch actions

The following is an example of a custom endpoint policy. When you attach this policy to your interface endpoint, it grants access to the listed Amazon Batch actions for all principals on all resources.

{ "Statement": [ { "Principal": "*", "Effect": "Allow", "Action": [ "batch:SubmitJob", "batch:ListJobs", "batch:DescribeJobs" ], "Resource":"*" } ] }