The Automation API is now available. No CLI. No human-in-the-loop. Just your code. Learn More

FargateProfile

Manages an EKS Fargate Profile.

Example Usage

using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.Eks.FargateProfile("example", new Aws.Eks.FargateProfileArgs
        {
            ClusterName = aws_eks_cluster.Example.Name,
            PodExecutionRoleArn = aws_iam_role.Example.Arn,
            SubnetIds = aws_subnet.Example.Select(__item => __item.Id).ToList(),
            Selectors = 
            {
                new Aws.Eks.Inputs.FargateProfileSelectorArgs
                {
                    Namespace = "example",
                },
            },
        });
    }

}

Coming soon!

import pulumi
import pulumi_aws as aws

example = aws.eks.FargateProfile("example",
    cluster_name=aws_eks_cluster["example"]["name"],
    pod_execution_role_arn=aws_iam_role["example"]["arn"],
    subnet_ids=[__item["id"] for __item in aws_subnet["example"]],
    selectors=[aws.eks.FargateProfileSelectorArgs(
        namespace="example",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.eks.FargateProfile("example", {
    clusterName: aws_eks_cluster.example.name,
    podExecutionRoleArn: aws_iam_role.example.arn,
    subnetIds: aws_subnet.example.map(__item => __item.id),
    selectors: [{
        namespace: "example",
    }],
});

Example IAM Role for EKS Fargate Profile

using System.Collections.Generic;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.Iam.Role("example", new Aws.Iam.RoleArgs
        {
            AssumeRolePolicy = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                { "Statement", new[]
                    {
                        new Dictionary<string, object?>
                        {
                            { "Action", "sts:AssumeRole" },
                            { "Effect", "Allow" },
                            { "Principal", new Dictionary<string, object?>
                            {
                                { "Service", "eks-fargate-pods.amazonaws.com" },
                            } },
                        },
                    }
                 },
                { "Version", "2012-10-17" },
            }),
        });
        var example_AmazonEKSFargatePodExecutionRolePolicy = new Aws.Iam.RolePolicyAttachment("example-AmazonEKSFargatePodExecutionRolePolicy", new Aws.Iam.RolePolicyAttachmentArgs
        {
            PolicyArn = "arn:aws:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy",
            Role = example.Name,
        });
    }

}
package main

import (
    "encoding/json"

    "github.com/pulumi/pulumi-aws/sdk/v3/go/aws/iam"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        tmpJSON0, err := json.Marshal(map[string]interface{}{
            "Statement": []map[string]interface{}{
                map[string]interface{}{
                    "Action": "sts:AssumeRole",
                    "Effect": "Allow",
                    "Principal": map[string]interface{}{
                        "Service": "eks-fargate-pods.amazonaws.com",
                    },
                },
            },
            "Version": "2012-10-17",
        })
        if err != nil {
            return err
        }
        json0 := string(tmpJSON0)
        example, err := iam.NewRole(ctx, "example", &iam.RoleArgs{
            AssumeRolePolicy: pulumi.String(json0),
        })
        if err != nil {
            return err
        }
        _, err = iam.NewRolePolicyAttachment(ctx, "example_AmazonEKSFargatePodExecutionRolePolicy", &iam.RolePolicyAttachmentArgs{
            PolicyArn: pulumi.String("arn:aws:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy"),
            Role:      example.Name,
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import json
import pulumi_aws as aws

example = aws.iam.Role("example", assume_role_policy=json.dumps({
    "Statement": [{
        "Action": "sts:AssumeRole",
        "Effect": "Allow",
        "Principal": {
            "Service": "eks-fargate-pods.amazonaws.com",
        },
    }],
    "Version": "2012-10-17",
}))
example__amazon_eks_fargate_pod_execution_role_policy = aws.iam.RolePolicyAttachment("example-AmazonEKSFargatePodExecutionRolePolicy",
    policy_arn="arn:aws:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy",
    role=example.name)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.iam.Role("example", {assumeRolePolicy: JSON.stringify({
    Statement: [{
        Action: "sts:AssumeRole",
        Effect: "Allow",
        Principal: {
            Service: "eks-fargate-pods.amazonaws.com",
        },
    }],
    Version: "2012-10-17",
})});
const example_AmazonEKSFargatePodExecutionRolePolicy = new aws.iam.RolePolicyAttachment("example-AmazonEKSFargatePodExecutionRolePolicy", {
    policyArn: "arn:aws:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy",
    role: example.name,
});

Create a FargateProfile Resource

def FargateProfile(resource_name: str, opts: Optional[ResourceOptions] = None, cluster_name: Optional[str] = None, fargate_profile_name: Optional[str] = None, pod_execution_role_arn: Optional[str] = None, selectors: Optional[Sequence[FargateProfileSelectorArgs]] = None, subnet_ids: Optional[Sequence[str]] = None, tags: Optional[Mapping[str, str]] = None)
name string
The unique name of the resource.
args FargateProfileArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args FargateProfileArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FargateProfileArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

FargateProfile Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The FargateProfile resource accepts the following input properties:

ClusterName string

Name of the EKS Cluster.

PodExecutionRoleArn string

Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Fargate Profile.

Selectors List<FargateProfileSelectorArgs>

Configuration block(s) for selecting Kubernetes Pods to execute with this EKS Fargate Profile. Detailed below.

FargateProfileName string

Name of the EKS Fargate Profile.

SubnetIds List<string>

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).

Tags Dictionary<string, string>

Key-value map of resource tags.

ClusterName string

Name of the EKS Cluster.

PodExecutionRoleArn string

Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Fargate Profile.

Selectors []FargateProfileSelector

Configuration block(s) for selecting Kubernetes Pods to execute with this EKS Fargate Profile. Detailed below.

FargateProfileName string

Name of the EKS Fargate Profile.

SubnetIds []string

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).

Tags map[string]string

Key-value map of resource tags.

clusterName string

Name of the EKS Cluster.

podExecutionRoleArn string

Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Fargate Profile.

selectors FargateProfileSelector[]

Configuration block(s) for selecting Kubernetes Pods to execute with this EKS Fargate Profile. Detailed below.

fargateProfileName string

Name of the EKS Fargate Profile.

subnetIds string[]

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).

tags {[key: string]: string}

Key-value map of resource tags.

cluster_name str

Name of the EKS Cluster.

pod_execution_role_arn str

Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Fargate Profile.

selectors Sequence[FargateProfileSelectorArgs]

Configuration block(s) for selecting Kubernetes Pods to execute with this EKS Fargate Profile. Detailed below.

fargate_profile_name str

Name of the EKS Fargate Profile.

subnet_ids Sequence[str]

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).

tags Mapping[str, str]

Key-value map of resource tags.

Outputs

All input properties are implicitly available as output properties. Additionally, the FargateProfile resource produces the following output properties:

Arn string

Amazon Resource Name (ARN) of the EKS Fargate Profile.

Id string
The provider-assigned unique ID for this managed resource.
Status string

Status of the EKS Fargate Profile.

Arn string

Amazon Resource Name (ARN) of the EKS Fargate Profile.

Id string
The provider-assigned unique ID for this managed resource.
Status string

Status of the EKS Fargate Profile.

arn string

Amazon Resource Name (ARN) of the EKS Fargate Profile.

id string
The provider-assigned unique ID for this managed resource.
status string

Status of the EKS Fargate Profile.

arn str

Amazon Resource Name (ARN) of the EKS Fargate Profile.

id str
The provider-assigned unique ID for this managed resource.
status str

Status of the EKS Fargate Profile.

Look up an Existing FargateProfile Resource

Get an existing FargateProfile resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: FargateProfileState, opts?: CustomResourceOptions): FargateProfile
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, arn: Optional[str] = None, cluster_name: Optional[str] = None, fargate_profile_name: Optional[str] = None, pod_execution_role_arn: Optional[str] = None, selectors: Optional[Sequence[FargateProfileSelectorArgs]] = None, status: Optional[str] = None, subnet_ids: Optional[Sequence[str]] = None, tags: Optional[Mapping[str, str]] = None) -> FargateProfile
func GetFargateProfile(ctx *Context, name string, id IDInput, state *FargateProfileState, opts ...ResourceOption) (*FargateProfile, error)
public static FargateProfile Get(string name, Input<string> id, FargateProfileState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Arn string

Amazon Resource Name (ARN) of the EKS Fargate Profile.

ClusterName string

Name of the EKS Cluster.

FargateProfileName string

Name of the EKS Fargate Profile.

PodExecutionRoleArn string

Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Fargate Profile.

Selectors List<FargateProfileSelectorArgs>

Configuration block(s) for selecting Kubernetes Pods to execute with this EKS Fargate Profile. Detailed below.

Status string

Status of the EKS Fargate Profile.

SubnetIds List<string>

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).

Tags Dictionary<string, string>

Key-value map of resource tags.

Arn string

Amazon Resource Name (ARN) of the EKS Fargate Profile.

ClusterName string

Name of the EKS Cluster.

FargateProfileName string

Name of the EKS Fargate Profile.

PodExecutionRoleArn string

Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Fargate Profile.

Selectors []FargateProfileSelector

Configuration block(s) for selecting Kubernetes Pods to execute with this EKS Fargate Profile. Detailed below.

Status string

Status of the EKS Fargate Profile.

SubnetIds []string

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).

Tags map[string]string

Key-value map of resource tags.

arn string

Amazon Resource Name (ARN) of the EKS Fargate Profile.

clusterName string

Name of the EKS Cluster.

fargateProfileName string

Name of the EKS Fargate Profile.

podExecutionRoleArn string

Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Fargate Profile.

selectors FargateProfileSelector[]

Configuration block(s) for selecting Kubernetes Pods to execute with this EKS Fargate Profile. Detailed below.

status string

Status of the EKS Fargate Profile.

subnetIds string[]

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).

tags {[key: string]: string}

Key-value map of resource tags.

arn str

Amazon Resource Name (ARN) of the EKS Fargate Profile.

cluster_name str

Name of the EKS Cluster.

fargate_profile_name str

Name of the EKS Fargate Profile.

pod_execution_role_arn str

Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Fargate Profile.

selectors Sequence[FargateProfileSelectorArgs]

Configuration block(s) for selecting Kubernetes Pods to execute with this EKS Fargate Profile. Detailed below.

status str

Status of the EKS Fargate Profile.

subnet_ids Sequence[str]

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).

tags Mapping[str, str]

Key-value map of resource tags.

Supporting Types

FargateProfileSelector

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Namespace string

Kubernetes namespace for selection.

Labels Dictionary<string, string>

Key-value map of Kubernetes labels for selection.

Namespace string

Kubernetes namespace for selection.

Labels map[string]string

Key-value map of Kubernetes labels for selection.

namespace string

Kubernetes namespace for selection.

labels {[key: string]: string}

Key-value map of Kubernetes labels for selection.

namespace str

Kubernetes namespace for selection.

labels Mapping[str, str]

Key-value map of Kubernetes labels for selection.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.