Class Cluster
Manages an EKS Cluster.
Example Usage
Example IAM Role for EKS Cluster
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Iam.Role("example", new Aws.Iam.RoleArgs
{
AssumeRolePolicy = @"{
""Version"": ""2012-10-17"",
""Statement"": [
{
""Effect"": ""Allow"",
""Principal"": {
""Service"": ""eks.amazonaws.com""
},
""Action"": ""sts:AssumeRole""
}
]
}
",
});
var example_AmazonEKSClusterPolicy = new Aws.Iam.RolePolicyAttachment("example-AmazonEKSClusterPolicy", new Aws.Iam.RolePolicyAttachmentArgs
{
PolicyArn = "arn:aws:iam::aws:policy/AmazonEKSClusterPolicy",
Role = example.Name,
});
var example_AmazonEKSServicePolicy = new Aws.Iam.RolePolicyAttachment("example-AmazonEKSServicePolicy", new Aws.Iam.RolePolicyAttachmentArgs
{
PolicyArn = "arn:aws:iam::aws:policy/AmazonEKSServicePolicy",
Role = example.Name,
});
}
}
Enabling Control Plane Logging
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var clusterName = config.Get("clusterName") ?? "example";
var exampleCluster = new Aws.Eks.Cluster("exampleCluster", new Aws.Eks.ClusterArgs
{
EnabledClusterLogTypes =
{
"api",
"audit",
},
});
var exampleLogGroup = new Aws.CloudWatch.LogGroup("exampleLogGroup", new Aws.CloudWatch.LogGroupArgs
{
RetentionInDays = 7,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Eks
Assembly: Pulumi.Aws.dll
Syntax
public class Cluster : CustomResource
Constructors
View SourceCluster(String, ClusterArgs, CustomResourceOptions)
Create a Cluster resource with the given unique name, arguments, and options.
Declaration
public Cluster(string name, ClusterArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ClusterArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceArn
The Amazon Resource Name (ARN) of the cluster.
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CertificateAuthority
Nested attribute containing certificate-authority-data for your cluster.
Declaration
public Output<ClusterCertificateAuthority> CertificateAuthority { get; }
Property Value
| Type | Description |
|---|---|
| Output<ClusterCertificateAuthority> |
CreatedAt
Declaration
public Output<string> CreatedAt { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
EnabledClusterLogTypes
A list of the desired control plane logging to enable. For more information, see Amazon EKS Control Plane Logging
Declaration
public Output<ImmutableArray<string>> EnabledClusterLogTypes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
EncryptionConfig
Configuration block with encryption configuration for the cluster. Only available on Kubernetes 1.13 and above clusters created after March 6, 2020. Detailed below.
Declaration
public Output<ClusterEncryptionConfig> EncryptionConfig { get; }
Property Value
| Type | Description |
|---|---|
| Output<ClusterEncryptionConfig> |
Endpoint
The endpoint for your Kubernetes API server.
Declaration
public Output<string> Endpoint { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Identities
Nested attribute containing identity provider information for your cluster. Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019.
Declaration
public Output<ImmutableArray<ClusterIdentity>> Identities { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<ClusterIdentity>> |
Name
Name of the cluster.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PlatformVersion
The platform version for the cluster.
Declaration
public Output<string> PlatformVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RoleArn
The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. Ensure the resource configuration includes explicit dependencies on the IAM Role permissions by adding dependsOn if using the aws.iam.RolePolicy resource or aws.iam.RolePolicyAttachment resource, otherwise EKS cannot delete EKS managed EC2 infrastructure such as Security Groups on EKS Cluster deletion.
Declaration
public Output<string> RoleArn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Status
The status of the EKS cluster. One of CREATING, ACTIVE, DELETING, FAILED.
Declaration
public Output<string> Status { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
Key-value map of resource tags.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
Version
Desired Kubernetes master version. If you do not specify a value, the latest available version at resource creation is used and no upgrades will occur except those automatically triggered by EKS. The value must be configured and increased to upgrade the version when desired. Downgrades are not supported by EKS.
Declaration
public Output<string> Version { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VpcConfig
Nested argument for the VPC associated with your cluster. Amazon EKS VPC resources have specific requirements to work properly with Kubernetes. For more information, see Cluster VPC Considerations and Cluster Security Group Considerations in the Amazon EKS User Guide. Configuration detailed below.
Declaration
public Output<ClusterVpcConfig> VpcConfig { get; }
Property Value
| Type | Description |
|---|---|
| Output<ClusterVpcConfig> |
Methods
View SourceGet(String, Input<String>, ClusterState, CustomResourceOptions)
Get an existing Cluster resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Cluster Get(string name, Input<string> id, ClusterState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ClusterState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Cluster |