Class FargateProfile

All Implemented Interfaces:
IConstruct, IDependable, ITaggable,, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:46.600Z") @Stability(Stable) public class FargateProfile extends Construct implements ITaggable
Fargate profiles allows an administrator to declare which pods run on Fargate.

This declaration is done through the profile’s selectors. Each profile can have up to five selectors that contain a namespace and optional labels. You must define a namespace for every selector. The label field consists of multiple optional key-value pairs. Pods that match a selector (by matching a namespace for the selector and all of the labels specified in the selector) are scheduled on Fargate. If a namespace selector is defined without any labels, Amazon EKS will attempt to schedule all pods that run in that namespace onto Fargate using the profile. If a to-be-scheduled pod matches any of the selectors in the Fargate profile, then that pod is scheduled on Fargate.

If a pod matches multiple Fargate profiles, Amazon EKS picks one of the matches at random. In this case, you can specify which profile a pod should use by adding the following Kubernetes label to the pod specification: profile_name. However, the pod must still match a selector in that profile in order to be scheduled onto Fargate.


 Cluster cluster;
 FargateProfile.Builder.create(this, "MyProfile")
  • Constructor Details

    • FargateProfile

      protected FargateProfile( objRef)
    • FargateProfile

      protected FargateProfile( initializationMode)
    • FargateProfile

      @Stability(Stable) public FargateProfile(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull FargateProfileProps props)
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • getFargateProfileArn

      @Stability(Stable) @NotNull public String getFargateProfileArn()
      The full Amazon Resource Name (ARN) of the Fargate profile.
    • getFargateProfileName

      @Stability(Stable) @NotNull public String getFargateProfileName()
      The name of the Fargate profile.
    • getPodExecutionRole

      @Stability(Stable) @NotNull public IRole getPodExecutionRole()
      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.

    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Resource tags.
      Specified by:
      getTags in interface ITaggable