Fargate Profile
Manages an EKS Fargate Profile.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.eks.FargateProfile;
import com.pulumi.aws.eks.FargateProfileArgs;
import com.pulumi.aws.eks.inputs.FargateProfileSelectorArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new FargateProfile("example", FargateProfileArgs.builder()
.clusterName(aws_eks_cluster.example().name())
.podExecutionRoleArn(aws_iam_role.example().arn())
.subnetIds(aws_subnet.example().stream().map(element -> element.id()).collect(toList()))
.selectors(FargateProfileSelectorArgs.builder()
.namespace("example")
.build())
.build());
}
}
Example IAM Role for EKS Fargate Profile
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.iam.RolePolicyAttachment;
import com.pulumi.aws.iam.RolePolicyAttachmentArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Role("example", RoleArgs.builder()
.assumeRolePolicy(serializeJson(
jsonObject(
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Action", "sts:AssumeRole"),
jsonProperty("Effect", "Allow"),
jsonProperty("Principal", jsonObject(
jsonProperty("Service", "eks-fargate-pods.amazonaws.com")
))
))),
jsonProperty("Version", "2012-10-17")
)))
.build());
var example_AmazonEKSFargatePodExecutionRolePolicy = new RolePolicyAttachment("example-AmazonEKSFargatePodExecutionRolePolicy", RolePolicyAttachmentArgs.builder()
.policyArn("arn:aws:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy")
.role(example.name())
.build());
}
}
Import
EKS Fargate Profiles can be imported using the cluster_name
and fargate_profile_name
separated by a colon (:
), e.g.,
$ pulumi import aws:eks/fargateProfile:FargateProfile my_fargate_profile my_cluster:my_fargate_profile
Properties
Name of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (^[0-9A-Za-z][A-Za-z0-9\-_]+$
).
Name of the EKS Fargate Profile.
Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Fargate Profile.
Configuration block(s) for selecting Kubernetes Pods to execute with this EKS Fargate Profile. Detailed below.
Identifiers of private EC2 Subnets to associate with the EKS Fargate Profile. These subnets must have the following resource tag: kubernetes.io/cluster/CLUSTER_NAME
(where CLUSTER_NAME
is replaced with the name of the EKS Cluster). The following arguments are optional: