CreateFargateProfile - Amazon EKS
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).


Creates an Amazon Fargate profile for your Amazon EKS cluster. You must have at least one Fargate profile in a cluster to be able to run pods on Fargate.

The Fargate profile allows an administrator to declare which pods run on Fargate and specify which pods run on which Fargate profile. This declaration is done through the profile’s selectors. Each profile can have up to five selectors that contain a namespace and labels. A namespace is required for every selector. The label field consists of multiple optional key-value pairs. Pods that match the selectors are scheduled on Fargate. If a to-be-scheduled pod matches any of the selectors in the Fargate profile, then that pod is run on Fargate.

When you create a Fargate profile, you must specify a pod execution role to use with the pods that are scheduled with the profile. This role is added to the cluster's Kubernetes Role Based Access Control (RBAC) for authorization so that the kubelet that is running on the Fargate infrastructure can register with your Amazon EKS cluster so that it can appear in your cluster as a node. The pod execution role also provides IAM permissions to the Fargate infrastructure to allow read access to Amazon ECR image repositories. For more information, see Pod Execution Role in the Amazon EKS User Guide.

Fargate profiles are immutable. However, you can create a new updated profile to replace an existing profile and then delete the original after the updated profile has finished creating.

If any Fargate profiles in a cluster are in the DELETING status, you must wait for that Fargate profile to finish deleting before you can create any other profiles in that cluster.

For more information, see Amazon Fargate Profile in the Amazon EKS User Guide.

Request Syntax

POST /clusters/name/fargate-profiles HTTP/1.1 Content-type: application/json { "clientRequestToken": "string", "fargateProfileName": "string", "podExecutionRoleArn": "string", "selectors": [ { "labels": { "string" : "string" }, "namespace": "string" } ], "subnets": [ "string" ], "tags": { "string" : "string" } }

URI Request Parameters

The request uses the following URI parameters.


The name of the Amazon EKS cluster to apply the Fargate profile to.

Required: Yes

Request Body

The request accepts the following data in JSON format.


Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Type: String

Required: No


The name of the Fargate profile.

Type: String

Required: Yes


The Amazon Resource Name (ARN) of the pod execution role to use for pods that match the selectors in the Fargate profile. The pod execution role allows Fargate infrastructure to register with your cluster as a node, and it provides read access to Amazon ECR image repositories. For more information, see Pod Execution Role in the Amazon EKS User Guide.

Type: String

Required: Yes


The selectors to match for pods to use this Fargate profile. Each selector must have an associated namespace. Optionally, you can also specify labels for a namespace. You may specify up to five selectors in a Fargate profile.

Type: Array of FargateProfileSelector objects

Required: No


The IDs of subnets to launch your pods into. At this time, pods running on Fargate are not assigned public IP addresses, so only private subnets (with no direct route to an Internet Gateway) are accepted for this parameter.

Type: Array of strings

Required: No


The metadata to apply to the Fargate profile to assist with categorization and organization. Each tag consists of a key and an optional value. You define both. Fargate profile tags do not propagate to any other resources associated with the Fargate profile, such as the pods that are scheduled with it.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Maximum length of 256.

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "fargateProfile": { "clusterName": "string", "createdAt": number, "fargateProfileArn": "string", "fargateProfileName": "string", "podExecutionRoleArn": "string", "selectors": [ { "labels": { "string" : "string" }, "namespace": "string" } ], "status": "string", "subnets": [ "string" ], "tags": { "string" : "string" } } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


The full description of your new Fargate profile.

Type: FargateProfile object


For information about the errors that are common to all actions, see Common Errors.


These errors are usually caused by a client action. Actions can include using an action or resource on behalf of an IAM principal that doesn't have permissions to use the action or resource or specifying an identifier that is not valid.

HTTP Status Code: 400


The specified parameter is invalid. Review the available parameters for the API request.

HTTP Status Code: 400


The request is invalid given the state of the cluster. Check the state of the cluster and the associated operations.

HTTP Status Code: 400


You have encountered a service limit on the specified resource.

HTTP Status Code: 400


These errors are usually caused by a server-side issue.

HTTP Status Code: 500


At least one of your specified cluster subnets is in an Availability Zone that does not support Amazon EKS. The exception output specifies the supported Availability Zones for your account, from which you can choose subnets for your cluster.

HTTP Status Code: 400


In the following example or examples, the Authorization header contents (AUTHPARAMS) must be replaced with an Amazon Signature Version 4 signature. For more information about creating these signatures, see Signature Version 4 Signing Process in the Amazon EKS General Reference.

You need to learn how to sign HTTP requests only if you intend to manually create them. When you use the Amazon Command Line Interface (Amazon CLI) or one of the Amazon SDKs to make requests to Amazon, these tools automatically sign the requests for you with the access key that you specify when you configure the tools. When you use these tools, you don't need to learn how to sign requests yourself.


The following example creates a Fargate profile called default-with-infrastructure-label in the fargate cluster. Pods that are launched in the default namespace with the Kubernetes label "infrastructure": "fargate" will be run on Fargate.

Sample Request

POST /clusters/fargate/fargate-profiles HTTP/1.1 Host: Accept-Encoding: identity User-Agent: aws-cli/1.16.284 Python/3.7.5 Darwin/18.7.0 botocore/1.13.20 X-Amz-Date: 20191120T202529Z Authorization: AUTHPARAMS Content-Length: 355 { "fargateProfileName": "default-with-infrastructure-label", "podExecutionRoleArn": "arn:aws:iam::012345678910:role/AmazonEKSPodExecutionRole", "subnets": [ "subnet-xxxxxxxxxxxxxxxxx", "subnet-yyyyyyyyyyyyyyyyy" ], "selectors": [ { "namespace": "default", "labels": { "infrastructure": "fargate" } } ], "clientRequestToken": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" }

Sample Response

HTTP/1.1 200 OK Date: Wed, 20 Nov 2019 20:37:30 GMT Content-Type: application/json Content-Length: 610 x-amzn-RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx x-amz-apigw-id: DeaRjFWPvHcFcXw= X-Amzn-Trace-Id: Root=1-xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx Connection: keep-alive { "fargateProfile": { "fargateProfileName": "compute-label", "fargateProfileArn": "arn:aws:eks:us-west-2:012345678910:fargateprofile/fargate/compute-label/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clusterName": "fargate", "createdAt": 1574206849.791, "podExecutionRoleArn": "arn:aws:iam::012345678910:role/AmazonEKSPodExecutionRole", "subnets": [ "subnet-xxxxxxxxxxxxxxxxx", "subnet-yyyyyyyyyyyyyyyyy" ], "selectors": [ { "namespace": "kube-system", "labels": { "compute": "fargate" } } ], "status": "CREATING", "tags": {} } }

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: