github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/eks/nodeGroup.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package eks
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Manages an EKS Node Group, which can provision and optionally update an Auto Scaling Group of Kubernetes worker nodes compatible with EKS. Additional documentation about this functionality can be found in the [EKS User Guide](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html).
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/eks"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  // func main() {
    30  // pulumi.Run(func(ctx *pulumi.Context) error {
    31  // var splat0 []interface{}
    32  // for _, val0 := range exampleAwsSubnet {
    33  // splat0 = append(splat0, val0.Id)
    34  // }
    35  // _, err := eks.NewNodeGroup(ctx, "example", &eks.NodeGroupArgs{
    36  // ClusterName: pulumi.Any(exampleAwsEksCluster.Name),
    37  // NodeGroupName: pulumi.String("example"),
    38  // NodeRoleArn: pulumi.Any(exampleAwsIamRole.Arn),
    39  // SubnetIds: toPulumiArray(splat0),
    40  // ScalingConfig: &eks.NodeGroupScalingConfigArgs{
    41  // DesiredSize: pulumi.Int(1),
    42  // MaxSize: pulumi.Int(2),
    43  // MinSize: pulumi.Int(1),
    44  // },
    45  // UpdateConfig: &eks.NodeGroupUpdateConfigArgs{
    46  // MaxUnavailable: pulumi.Int(1),
    47  // },
    48  // }, pulumi.DependsOn([]pulumi.Resource{
    49  // example_AmazonEKSWorkerNodePolicy,
    50  // example_AmazonEKSCNIPolicy,
    51  // example_AmazonEC2ContainerRegistryReadOnly,
    52  // }))
    53  // if err != nil {
    54  // return err
    55  // }
    56  // return nil
    57  // })
    58  // }
    59  // func toPulumiArray(arr []) pulumi.Array {
    60  // var pulumiArr pulumi.Array
    61  // for _, v := range arr {
    62  // pulumiArr = append(pulumiArr, pulumi.(v))
    63  // }
    64  // return pulumiArr
    65  // }
    66  // ```
    67  // <!--End PulumiCodeChooser -->
    68  //
    69  // ### Ignoring Changes to Desired Size
    70  //
    71  // You can utilize [ignoreChanges](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) create an EKS Node Group with an initial size of running instances, then ignore any changes to that count caused externally (e.g. Application Autoscaling).
    72  //
    73  // <!--Start PulumiCodeChooser -->
    74  // ```go
    75  // package main
    76  //
    77  // import (
    78  //
    79  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/eks"
    80  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    81  //
    82  // )
    83  //
    84  //	func main() {
    85  //		pulumi.Run(func(ctx *pulumi.Context) error {
    86  //			_, err := eks.NewNodeGroup(ctx, "example", &eks.NodeGroupArgs{
    87  //				ScalingConfig: &eks.NodeGroupScalingConfigArgs{
    88  //					DesiredSize: pulumi.Int(2),
    89  //				},
    90  //			})
    91  //			if err != nil {
    92  //				return err
    93  //			}
    94  //			return nil
    95  //		})
    96  //	}
    97  //
    98  // ```
    99  // <!--End PulumiCodeChooser -->
   100  //
   101  // ### Example IAM Role for EKS Node Group
   102  //
   103  // <!--Start PulumiCodeChooser -->
   104  // ```go
   105  // package main
   106  //
   107  // import (
   108  //
   109  //	"encoding/json"
   110  //
   111  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
   112  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
   113  //
   114  // )
   115  //
   116  //	func main() {
   117  //		pulumi.Run(func(ctx *pulumi.Context) error {
   118  //			tmpJSON0, err := json.Marshal(map[string]interface{}{
   119  //				"Statement": []map[string]interface{}{
   120  //					map[string]interface{}{
   121  //						"Action": "sts:AssumeRole",
   122  //						"Effect": "Allow",
   123  //						"Principal": map[string]interface{}{
   124  //							"Service": "ec2.amazonaws.com",
   125  //						},
   126  //					},
   127  //				},
   128  //				"Version": "2012-10-17",
   129  //			})
   130  //			if err != nil {
   131  //				return err
   132  //			}
   133  //			json0 := string(tmpJSON0)
   134  //			example, err := iam.NewRole(ctx, "example", &iam.RoleArgs{
   135  //				Name:             pulumi.String("eks-node-group-example"),
   136  //				AssumeRolePolicy: pulumi.String(json0),
   137  //			})
   138  //			if err != nil {
   139  //				return err
   140  //			}
   141  //			_, err = iam.NewRolePolicyAttachment(ctx, "example-AmazonEKSWorkerNodePolicy", &iam.RolePolicyAttachmentArgs{
   142  //				PolicyArn: pulumi.String("arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"),
   143  //				Role:      example.Name,
   144  //			})
   145  //			if err != nil {
   146  //				return err
   147  //			}
   148  //			_, err = iam.NewRolePolicyAttachment(ctx, "example-AmazonEKS_CNI_Policy", &iam.RolePolicyAttachmentArgs{
   149  //				PolicyArn: pulumi.String("arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"),
   150  //				Role:      example.Name,
   151  //			})
   152  //			if err != nil {
   153  //				return err
   154  //			}
   155  //			_, err = iam.NewRolePolicyAttachment(ctx, "example-AmazonEC2ContainerRegistryReadOnly", &iam.RolePolicyAttachmentArgs{
   156  //				PolicyArn: pulumi.String("arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"),
   157  //				Role:      example.Name,
   158  //			})
   159  //			if err != nil {
   160  //				return err
   161  //			}
   162  //			return nil
   163  //		})
   164  //	}
   165  //
   166  // ```
   167  // <!--End PulumiCodeChooser -->
   168  //
   169  // ### Example Subnets for EKS Node Group
   170  //
   171  // <!--Start PulumiCodeChooser -->
   172  // ```go
   173  // package main
   174  //
   175  // import (
   176  //
   177  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
   178  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
   179  //	"github.com/pulumi/pulumi-std/sdk/go/std"
   180  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
   181  //
   182  // )
   183  //
   184  //	func main() {
   185  //		pulumi.Run(func(ctx *pulumi.Context) error {
   186  //			available, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{
   187  //				State: pulumi.StringRef("available"),
   188  //			}, nil)
   189  //			if err != nil {
   190  //				return err
   191  //			}
   192  //			invokeCidrsubnet, err := std.Cidrsubnet(ctx, &std.CidrsubnetArgs{
   193  //				Input:   exampleAwsVpc.CidrBlock,
   194  //				Newbits: 8,
   195  //				Netnum:  val0,
   196  //			}, nil)
   197  //			if err != nil {
   198  //				return err
   199  //			}
   200  //			var example []*ec2.Subnet
   201  //			for index := 0; index < 2; index++ {
   202  //				key0 := index
   203  //				val0 := index
   204  //				__res, err := ec2.NewSubnet(ctx, fmt.Sprintf("example-%v", key0), &ec2.SubnetArgs{
   205  //					AvailabilityZone: available.Names[val0],
   206  //					CidrBlock:        invokeCidrsubnet.Result,
   207  //					VpcId:            pulumi.Any(exampleAwsVpc.Id),
   208  //				})
   209  //				if err != nil {
   210  //					return err
   211  //				}
   212  //				example = append(example, __res)
   213  //			}
   214  //			return nil
   215  //		})
   216  //	}
   217  //
   218  // ```
   219  // <!--End PulumiCodeChooser -->
   220  //
   221  // ## Import
   222  //
   223  // Using `pulumi import`, import EKS Node Groups using the `cluster_name` and `node_group_name` separated by a colon (`:`). For example:
   224  //
   225  // ```sh
   226  // $ pulumi import aws:eks/nodeGroup:NodeGroup my_node_group my_cluster:my_node_group
   227  // ```
   228  type NodeGroup struct {
   229  	pulumi.CustomResourceState
   230  
   231  	// Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values. This provider will only perform drift detection if a configuration value is provided.
   232  	AmiType pulumi.StringOutput `pulumi:"amiType"`
   233  	// Amazon Resource Name (ARN) of the EKS Node Group.
   234  	Arn pulumi.StringOutput `pulumi:"arn"`
   235  	// Type of capacity associated with the EKS Node Group. Valid values: `ON_DEMAND`, `SPOT`. This provider will only perform drift detection if a configuration value is provided.
   236  	CapacityType pulumi.StringOutput `pulumi:"capacityType"`
   237  	// Name of the EKS Cluster.
   238  	ClusterName pulumi.StringOutput `pulumi:"clusterName"`
   239  	// Disk size in GiB for worker nodes. Defaults to `50` for Windows, `20` all other node groups. The provider will only perform drift detection if a configuration value is provided.
   240  	DiskSize pulumi.IntOutput `pulumi:"diskSize"`
   241  	// Force version update if existing pods are unable to be drained due to a pod disruption budget issue.
   242  	ForceUpdateVersion pulumi.BoolPtrOutput `pulumi:"forceUpdateVersion"`
   243  	// List of instance types associated with the EKS Node Group. Defaults to `["t3.medium"]`. The provider will only perform drift detection if a configuration value is provided.
   244  	InstanceTypes pulumi.StringArrayOutput `pulumi:"instanceTypes"`
   245  	// Key-value map of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed.
   246  	Labels pulumi.StringMapOutput `pulumi:"labels"`
   247  	// Configuration block with Launch Template settings. See `launchTemplate` below for details. Conflicts with `remoteAccess`.
   248  	LaunchTemplate NodeGroupLaunchTemplatePtrOutput `pulumi:"launchTemplate"`
   249  	// Name of the EKS Node Group. If omitted, the provider will assign a random, unique name. Conflicts with `nodeGroupNamePrefix`. The node group name can't be longer than 63 characters. It must start with a letter or digit, but can also include hyphens and underscores for the remaining characters.
   250  	NodeGroupName pulumi.StringOutput `pulumi:"nodeGroupName"`
   251  	// Creates a unique name beginning with the specified prefix. Conflicts with `nodeGroupName`.
   252  	NodeGroupNamePrefix pulumi.StringOutput `pulumi:"nodeGroupNamePrefix"`
   253  	// Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group.
   254  	NodeRoleArn pulumi.StringOutput `pulumi:"nodeRoleArn"`
   255  	// AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version.
   256  	ReleaseVersion pulumi.StringOutput `pulumi:"releaseVersion"`
   257  	// Configuration block with remote access settings. See `remoteAccess` below for details. Conflicts with `launchTemplate`.
   258  	RemoteAccess NodeGroupRemoteAccessPtrOutput `pulumi:"remoteAccess"`
   259  	// List of objects containing information about underlying resources.
   260  	Resources NodeGroupResourceArrayOutput `pulumi:"resources"`
   261  	// Configuration block with scaling settings. See `scalingConfig` below for details.
   262  	ScalingConfig NodeGroupScalingConfigOutput `pulumi:"scalingConfig"`
   263  	// Status of the EKS Node Group.
   264  	Status pulumi.StringOutput `pulumi:"status"`
   265  	// Identifiers of EC2 Subnets to associate with the EKS Node Group.
   266  	//
   267  	// The following arguments are optional:
   268  	SubnetIds pulumi.StringArrayOutput `pulumi:"subnetIds"`
   269  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   270  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   271  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   272  	//
   273  	// Deprecated: Please use `tags` instead.
   274  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   275  	// The Kubernetes taints to be applied to the nodes in the node group. Maximum of 50 taints per node group. See taint below for details.
   276  	Taints NodeGroupTaintArrayOutput `pulumi:"taints"`
   277  	// Configuration block with update settings. See `updateConfig` below for details.
   278  	UpdateConfig NodeGroupUpdateConfigOutput `pulumi:"updateConfig"`
   279  	// Kubernetes version. Defaults to EKS Cluster Kubernetes version. The provider will only perform drift detection if a configuration value is provided.
   280  	Version pulumi.StringOutput `pulumi:"version"`
   281  }
   282  
   283  // NewNodeGroup registers a new resource with the given unique name, arguments, and options.
   284  func NewNodeGroup(ctx *pulumi.Context,
   285  	name string, args *NodeGroupArgs, opts ...pulumi.ResourceOption) (*NodeGroup, error) {
   286  	if args == nil {
   287  		return nil, errors.New("missing one or more required arguments")
   288  	}
   289  
   290  	if args.ClusterName == nil {
   291  		return nil, errors.New("invalid value for required argument 'ClusterName'")
   292  	}
   293  	if args.NodeRoleArn == nil {
   294  		return nil, errors.New("invalid value for required argument 'NodeRoleArn'")
   295  	}
   296  	if args.ScalingConfig == nil {
   297  		return nil, errors.New("invalid value for required argument 'ScalingConfig'")
   298  	}
   299  	if args.SubnetIds == nil {
   300  		return nil, errors.New("invalid value for required argument 'SubnetIds'")
   301  	}
   302  	opts = internal.PkgResourceDefaultOpts(opts)
   303  	var resource NodeGroup
   304  	err := ctx.RegisterResource("aws:eks/nodeGroup:NodeGroup", name, args, &resource, opts...)
   305  	if err != nil {
   306  		return nil, err
   307  	}
   308  	return &resource, nil
   309  }
   310  
   311  // GetNodeGroup gets an existing NodeGroup resource's state with the given name, ID, and optional
   312  // state properties that are used to uniquely qualify the lookup (nil if not required).
   313  func GetNodeGroup(ctx *pulumi.Context,
   314  	name string, id pulumi.IDInput, state *NodeGroupState, opts ...pulumi.ResourceOption) (*NodeGroup, error) {
   315  	var resource NodeGroup
   316  	err := ctx.ReadResource("aws:eks/nodeGroup:NodeGroup", name, id, state, &resource, opts...)
   317  	if err != nil {
   318  		return nil, err
   319  	}
   320  	return &resource, nil
   321  }
   322  
   323  // Input properties used for looking up and filtering NodeGroup resources.
   324  type nodeGroupState struct {
   325  	// Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values. This provider will only perform drift detection if a configuration value is provided.
   326  	AmiType *string `pulumi:"amiType"`
   327  	// Amazon Resource Name (ARN) of the EKS Node Group.
   328  	Arn *string `pulumi:"arn"`
   329  	// Type of capacity associated with the EKS Node Group. Valid values: `ON_DEMAND`, `SPOT`. This provider will only perform drift detection if a configuration value is provided.
   330  	CapacityType *string `pulumi:"capacityType"`
   331  	// Name of the EKS Cluster.
   332  	ClusterName *string `pulumi:"clusterName"`
   333  	// Disk size in GiB for worker nodes. Defaults to `50` for Windows, `20` all other node groups. The provider will only perform drift detection if a configuration value is provided.
   334  	DiskSize *int `pulumi:"diskSize"`
   335  	// Force version update if existing pods are unable to be drained due to a pod disruption budget issue.
   336  	ForceUpdateVersion *bool `pulumi:"forceUpdateVersion"`
   337  	// List of instance types associated with the EKS Node Group. Defaults to `["t3.medium"]`. The provider will only perform drift detection if a configuration value is provided.
   338  	InstanceTypes []string `pulumi:"instanceTypes"`
   339  	// Key-value map of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed.
   340  	Labels map[string]string `pulumi:"labels"`
   341  	// Configuration block with Launch Template settings. See `launchTemplate` below for details. Conflicts with `remoteAccess`.
   342  	LaunchTemplate *NodeGroupLaunchTemplate `pulumi:"launchTemplate"`
   343  	// Name of the EKS Node Group. If omitted, the provider will assign a random, unique name. Conflicts with `nodeGroupNamePrefix`. The node group name can't be longer than 63 characters. It must start with a letter or digit, but can also include hyphens and underscores for the remaining characters.
   344  	NodeGroupName *string `pulumi:"nodeGroupName"`
   345  	// Creates a unique name beginning with the specified prefix. Conflicts with `nodeGroupName`.
   346  	NodeGroupNamePrefix *string `pulumi:"nodeGroupNamePrefix"`
   347  	// Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group.
   348  	NodeRoleArn *string `pulumi:"nodeRoleArn"`
   349  	// AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version.
   350  	ReleaseVersion *string `pulumi:"releaseVersion"`
   351  	// Configuration block with remote access settings. See `remoteAccess` below for details. Conflicts with `launchTemplate`.
   352  	RemoteAccess *NodeGroupRemoteAccess `pulumi:"remoteAccess"`
   353  	// List of objects containing information about underlying resources.
   354  	Resources []NodeGroupResource `pulumi:"resources"`
   355  	// Configuration block with scaling settings. See `scalingConfig` below for details.
   356  	ScalingConfig *NodeGroupScalingConfig `pulumi:"scalingConfig"`
   357  	// Status of the EKS Node Group.
   358  	Status *string `pulumi:"status"`
   359  	// Identifiers of EC2 Subnets to associate with the EKS Node Group.
   360  	//
   361  	// The following arguments are optional:
   362  	SubnetIds []string `pulumi:"subnetIds"`
   363  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   364  	Tags map[string]string `pulumi:"tags"`
   365  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   366  	//
   367  	// Deprecated: Please use `tags` instead.
   368  	TagsAll map[string]string `pulumi:"tagsAll"`
   369  	// The Kubernetes taints to be applied to the nodes in the node group. Maximum of 50 taints per node group. See taint below for details.
   370  	Taints []NodeGroupTaint `pulumi:"taints"`
   371  	// Configuration block with update settings. See `updateConfig` below for details.
   372  	UpdateConfig *NodeGroupUpdateConfig `pulumi:"updateConfig"`
   373  	// Kubernetes version. Defaults to EKS Cluster Kubernetes version. The provider will only perform drift detection if a configuration value is provided.
   374  	Version *string `pulumi:"version"`
   375  }
   376  
   377  type NodeGroupState struct {
   378  	// Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values. This provider will only perform drift detection if a configuration value is provided.
   379  	AmiType pulumi.StringPtrInput
   380  	// Amazon Resource Name (ARN) of the EKS Node Group.
   381  	Arn pulumi.StringPtrInput
   382  	// Type of capacity associated with the EKS Node Group. Valid values: `ON_DEMAND`, `SPOT`. This provider will only perform drift detection if a configuration value is provided.
   383  	CapacityType pulumi.StringPtrInput
   384  	// Name of the EKS Cluster.
   385  	ClusterName pulumi.StringPtrInput
   386  	// Disk size in GiB for worker nodes. Defaults to `50` for Windows, `20` all other node groups. The provider will only perform drift detection if a configuration value is provided.
   387  	DiskSize pulumi.IntPtrInput
   388  	// Force version update if existing pods are unable to be drained due to a pod disruption budget issue.
   389  	ForceUpdateVersion pulumi.BoolPtrInput
   390  	// List of instance types associated with the EKS Node Group. Defaults to `["t3.medium"]`. The provider will only perform drift detection if a configuration value is provided.
   391  	InstanceTypes pulumi.StringArrayInput
   392  	// Key-value map of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed.
   393  	Labels pulumi.StringMapInput
   394  	// Configuration block with Launch Template settings. See `launchTemplate` below for details. Conflicts with `remoteAccess`.
   395  	LaunchTemplate NodeGroupLaunchTemplatePtrInput
   396  	// Name of the EKS Node Group. If omitted, the provider will assign a random, unique name. Conflicts with `nodeGroupNamePrefix`. The node group name can't be longer than 63 characters. It must start with a letter or digit, but can also include hyphens and underscores for the remaining characters.
   397  	NodeGroupName pulumi.StringPtrInput
   398  	// Creates a unique name beginning with the specified prefix. Conflicts with `nodeGroupName`.
   399  	NodeGroupNamePrefix pulumi.StringPtrInput
   400  	// Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group.
   401  	NodeRoleArn pulumi.StringPtrInput
   402  	// AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version.
   403  	ReleaseVersion pulumi.StringPtrInput
   404  	// Configuration block with remote access settings. See `remoteAccess` below for details. Conflicts with `launchTemplate`.
   405  	RemoteAccess NodeGroupRemoteAccessPtrInput
   406  	// List of objects containing information about underlying resources.
   407  	Resources NodeGroupResourceArrayInput
   408  	// Configuration block with scaling settings. See `scalingConfig` below for details.
   409  	ScalingConfig NodeGroupScalingConfigPtrInput
   410  	// Status of the EKS Node Group.
   411  	Status pulumi.StringPtrInput
   412  	// Identifiers of EC2 Subnets to associate with the EKS Node Group.
   413  	//
   414  	// The following arguments are optional:
   415  	SubnetIds pulumi.StringArrayInput
   416  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   417  	Tags pulumi.StringMapInput
   418  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   419  	//
   420  	// Deprecated: Please use `tags` instead.
   421  	TagsAll pulumi.StringMapInput
   422  	// The Kubernetes taints to be applied to the nodes in the node group. Maximum of 50 taints per node group. See taint below for details.
   423  	Taints NodeGroupTaintArrayInput
   424  	// Configuration block with update settings. See `updateConfig` below for details.
   425  	UpdateConfig NodeGroupUpdateConfigPtrInput
   426  	// Kubernetes version. Defaults to EKS Cluster Kubernetes version. The provider will only perform drift detection if a configuration value is provided.
   427  	Version pulumi.StringPtrInput
   428  }
   429  
   430  func (NodeGroupState) ElementType() reflect.Type {
   431  	return reflect.TypeOf((*nodeGroupState)(nil)).Elem()
   432  }
   433  
   434  type nodeGroupArgs struct {
   435  	// Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values. This provider will only perform drift detection if a configuration value is provided.
   436  	AmiType *string `pulumi:"amiType"`
   437  	// Type of capacity associated with the EKS Node Group. Valid values: `ON_DEMAND`, `SPOT`. This provider will only perform drift detection if a configuration value is provided.
   438  	CapacityType *string `pulumi:"capacityType"`
   439  	// Name of the EKS Cluster.
   440  	ClusterName string `pulumi:"clusterName"`
   441  	// Disk size in GiB for worker nodes. Defaults to `50` for Windows, `20` all other node groups. The provider will only perform drift detection if a configuration value is provided.
   442  	DiskSize *int `pulumi:"diskSize"`
   443  	// Force version update if existing pods are unable to be drained due to a pod disruption budget issue.
   444  	ForceUpdateVersion *bool `pulumi:"forceUpdateVersion"`
   445  	// List of instance types associated with the EKS Node Group. Defaults to `["t3.medium"]`. The provider will only perform drift detection if a configuration value is provided.
   446  	InstanceTypes []string `pulumi:"instanceTypes"`
   447  	// Key-value map of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed.
   448  	Labels map[string]string `pulumi:"labels"`
   449  	// Configuration block with Launch Template settings. See `launchTemplate` below for details. Conflicts with `remoteAccess`.
   450  	LaunchTemplate *NodeGroupLaunchTemplate `pulumi:"launchTemplate"`
   451  	// Name of the EKS Node Group. If omitted, the provider will assign a random, unique name. Conflicts with `nodeGroupNamePrefix`. The node group name can't be longer than 63 characters. It must start with a letter or digit, but can also include hyphens and underscores for the remaining characters.
   452  	NodeGroupName *string `pulumi:"nodeGroupName"`
   453  	// Creates a unique name beginning with the specified prefix. Conflicts with `nodeGroupName`.
   454  	NodeGroupNamePrefix *string `pulumi:"nodeGroupNamePrefix"`
   455  	// Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group.
   456  	NodeRoleArn string `pulumi:"nodeRoleArn"`
   457  	// AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version.
   458  	ReleaseVersion *string `pulumi:"releaseVersion"`
   459  	// Configuration block with remote access settings. See `remoteAccess` below for details. Conflicts with `launchTemplate`.
   460  	RemoteAccess *NodeGroupRemoteAccess `pulumi:"remoteAccess"`
   461  	// Configuration block with scaling settings. See `scalingConfig` below for details.
   462  	ScalingConfig NodeGroupScalingConfig `pulumi:"scalingConfig"`
   463  	// Identifiers of EC2 Subnets to associate with the EKS Node Group.
   464  	//
   465  	// The following arguments are optional:
   466  	SubnetIds []string `pulumi:"subnetIds"`
   467  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   468  	Tags map[string]string `pulumi:"tags"`
   469  	// The Kubernetes taints to be applied to the nodes in the node group. Maximum of 50 taints per node group. See taint below for details.
   470  	Taints []NodeGroupTaint `pulumi:"taints"`
   471  	// Configuration block with update settings. See `updateConfig` below for details.
   472  	UpdateConfig *NodeGroupUpdateConfig `pulumi:"updateConfig"`
   473  	// Kubernetes version. Defaults to EKS Cluster Kubernetes version. The provider will only perform drift detection if a configuration value is provided.
   474  	Version *string `pulumi:"version"`
   475  }
   476  
   477  // The set of arguments for constructing a NodeGroup resource.
   478  type NodeGroupArgs struct {
   479  	// Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values. This provider will only perform drift detection if a configuration value is provided.
   480  	AmiType pulumi.StringPtrInput
   481  	// Type of capacity associated with the EKS Node Group. Valid values: `ON_DEMAND`, `SPOT`. This provider will only perform drift detection if a configuration value is provided.
   482  	CapacityType pulumi.StringPtrInput
   483  	// Name of the EKS Cluster.
   484  	ClusterName pulumi.StringInput
   485  	// Disk size in GiB for worker nodes. Defaults to `50` for Windows, `20` all other node groups. The provider will only perform drift detection if a configuration value is provided.
   486  	DiskSize pulumi.IntPtrInput
   487  	// Force version update if existing pods are unable to be drained due to a pod disruption budget issue.
   488  	ForceUpdateVersion pulumi.BoolPtrInput
   489  	// List of instance types associated with the EKS Node Group. Defaults to `["t3.medium"]`. The provider will only perform drift detection if a configuration value is provided.
   490  	InstanceTypes pulumi.StringArrayInput
   491  	// Key-value map of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed.
   492  	Labels pulumi.StringMapInput
   493  	// Configuration block with Launch Template settings. See `launchTemplate` below for details. Conflicts with `remoteAccess`.
   494  	LaunchTemplate NodeGroupLaunchTemplatePtrInput
   495  	// Name of the EKS Node Group. If omitted, the provider will assign a random, unique name. Conflicts with `nodeGroupNamePrefix`. The node group name can't be longer than 63 characters. It must start with a letter or digit, but can also include hyphens and underscores for the remaining characters.
   496  	NodeGroupName pulumi.StringPtrInput
   497  	// Creates a unique name beginning with the specified prefix. Conflicts with `nodeGroupName`.
   498  	NodeGroupNamePrefix pulumi.StringPtrInput
   499  	// Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group.
   500  	NodeRoleArn pulumi.StringInput
   501  	// AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version.
   502  	ReleaseVersion pulumi.StringPtrInput
   503  	// Configuration block with remote access settings. See `remoteAccess` below for details. Conflicts with `launchTemplate`.
   504  	RemoteAccess NodeGroupRemoteAccessPtrInput
   505  	// Configuration block with scaling settings. See `scalingConfig` below for details.
   506  	ScalingConfig NodeGroupScalingConfigInput
   507  	// Identifiers of EC2 Subnets to associate with the EKS Node Group.
   508  	//
   509  	// The following arguments are optional:
   510  	SubnetIds pulumi.StringArrayInput
   511  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   512  	Tags pulumi.StringMapInput
   513  	// The Kubernetes taints to be applied to the nodes in the node group. Maximum of 50 taints per node group. See taint below for details.
   514  	Taints NodeGroupTaintArrayInput
   515  	// Configuration block with update settings. See `updateConfig` below for details.
   516  	UpdateConfig NodeGroupUpdateConfigPtrInput
   517  	// Kubernetes version. Defaults to EKS Cluster Kubernetes version. The provider will only perform drift detection if a configuration value is provided.
   518  	Version pulumi.StringPtrInput
   519  }
   520  
   521  func (NodeGroupArgs) ElementType() reflect.Type {
   522  	return reflect.TypeOf((*nodeGroupArgs)(nil)).Elem()
   523  }
   524  
   525  type NodeGroupInput interface {
   526  	pulumi.Input
   527  
   528  	ToNodeGroupOutput() NodeGroupOutput
   529  	ToNodeGroupOutputWithContext(ctx context.Context) NodeGroupOutput
   530  }
   531  
   532  func (*NodeGroup) ElementType() reflect.Type {
   533  	return reflect.TypeOf((**NodeGroup)(nil)).Elem()
   534  }
   535  
   536  func (i *NodeGroup) ToNodeGroupOutput() NodeGroupOutput {
   537  	return i.ToNodeGroupOutputWithContext(context.Background())
   538  }
   539  
   540  func (i *NodeGroup) ToNodeGroupOutputWithContext(ctx context.Context) NodeGroupOutput {
   541  	return pulumi.ToOutputWithContext(ctx, i).(NodeGroupOutput)
   542  }
   543  
   544  // NodeGroupArrayInput is an input type that accepts NodeGroupArray and NodeGroupArrayOutput values.
   545  // You can construct a concrete instance of `NodeGroupArrayInput` via:
   546  //
   547  //	NodeGroupArray{ NodeGroupArgs{...} }
   548  type NodeGroupArrayInput interface {
   549  	pulumi.Input
   550  
   551  	ToNodeGroupArrayOutput() NodeGroupArrayOutput
   552  	ToNodeGroupArrayOutputWithContext(context.Context) NodeGroupArrayOutput
   553  }
   554  
   555  type NodeGroupArray []NodeGroupInput
   556  
   557  func (NodeGroupArray) ElementType() reflect.Type {
   558  	return reflect.TypeOf((*[]*NodeGroup)(nil)).Elem()
   559  }
   560  
   561  func (i NodeGroupArray) ToNodeGroupArrayOutput() NodeGroupArrayOutput {
   562  	return i.ToNodeGroupArrayOutputWithContext(context.Background())
   563  }
   564  
   565  func (i NodeGroupArray) ToNodeGroupArrayOutputWithContext(ctx context.Context) NodeGroupArrayOutput {
   566  	return pulumi.ToOutputWithContext(ctx, i).(NodeGroupArrayOutput)
   567  }
   568  
   569  // NodeGroupMapInput is an input type that accepts NodeGroupMap and NodeGroupMapOutput values.
   570  // You can construct a concrete instance of `NodeGroupMapInput` via:
   571  //
   572  //	NodeGroupMap{ "key": NodeGroupArgs{...} }
   573  type NodeGroupMapInput interface {
   574  	pulumi.Input
   575  
   576  	ToNodeGroupMapOutput() NodeGroupMapOutput
   577  	ToNodeGroupMapOutputWithContext(context.Context) NodeGroupMapOutput
   578  }
   579  
   580  type NodeGroupMap map[string]NodeGroupInput
   581  
   582  func (NodeGroupMap) ElementType() reflect.Type {
   583  	return reflect.TypeOf((*map[string]*NodeGroup)(nil)).Elem()
   584  }
   585  
   586  func (i NodeGroupMap) ToNodeGroupMapOutput() NodeGroupMapOutput {
   587  	return i.ToNodeGroupMapOutputWithContext(context.Background())
   588  }
   589  
   590  func (i NodeGroupMap) ToNodeGroupMapOutputWithContext(ctx context.Context) NodeGroupMapOutput {
   591  	return pulumi.ToOutputWithContext(ctx, i).(NodeGroupMapOutput)
   592  }
   593  
   594  type NodeGroupOutput struct{ *pulumi.OutputState }
   595  
   596  func (NodeGroupOutput) ElementType() reflect.Type {
   597  	return reflect.TypeOf((**NodeGroup)(nil)).Elem()
   598  }
   599  
   600  func (o NodeGroupOutput) ToNodeGroupOutput() NodeGroupOutput {
   601  	return o
   602  }
   603  
   604  func (o NodeGroupOutput) ToNodeGroupOutputWithContext(ctx context.Context) NodeGroupOutput {
   605  	return o
   606  }
   607  
   608  // Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values. This provider will only perform drift detection if a configuration value is provided.
   609  func (o NodeGroupOutput) AmiType() pulumi.StringOutput {
   610  	return o.ApplyT(func(v *NodeGroup) pulumi.StringOutput { return v.AmiType }).(pulumi.StringOutput)
   611  }
   612  
   613  // Amazon Resource Name (ARN) of the EKS Node Group.
   614  func (o NodeGroupOutput) Arn() pulumi.StringOutput {
   615  	return o.ApplyT(func(v *NodeGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   616  }
   617  
   618  // Type of capacity associated with the EKS Node Group. Valid values: `ON_DEMAND`, `SPOT`. This provider will only perform drift detection if a configuration value is provided.
   619  func (o NodeGroupOutput) CapacityType() pulumi.StringOutput {
   620  	return o.ApplyT(func(v *NodeGroup) pulumi.StringOutput { return v.CapacityType }).(pulumi.StringOutput)
   621  }
   622  
   623  // Name of the EKS Cluster.
   624  func (o NodeGroupOutput) ClusterName() pulumi.StringOutput {
   625  	return o.ApplyT(func(v *NodeGroup) pulumi.StringOutput { return v.ClusterName }).(pulumi.StringOutput)
   626  }
   627  
   628  // Disk size in GiB for worker nodes. Defaults to `50` for Windows, `20` all other node groups. The provider will only perform drift detection if a configuration value is provided.
   629  func (o NodeGroupOutput) DiskSize() pulumi.IntOutput {
   630  	return o.ApplyT(func(v *NodeGroup) pulumi.IntOutput { return v.DiskSize }).(pulumi.IntOutput)
   631  }
   632  
   633  // Force version update if existing pods are unable to be drained due to a pod disruption budget issue.
   634  func (o NodeGroupOutput) ForceUpdateVersion() pulumi.BoolPtrOutput {
   635  	return o.ApplyT(func(v *NodeGroup) pulumi.BoolPtrOutput { return v.ForceUpdateVersion }).(pulumi.BoolPtrOutput)
   636  }
   637  
   638  // List of instance types associated with the EKS Node Group. Defaults to `["t3.medium"]`. The provider will only perform drift detection if a configuration value is provided.
   639  func (o NodeGroupOutput) InstanceTypes() pulumi.StringArrayOutput {
   640  	return o.ApplyT(func(v *NodeGroup) pulumi.StringArrayOutput { return v.InstanceTypes }).(pulumi.StringArrayOutput)
   641  }
   642  
   643  // Key-value map of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed.
   644  func (o NodeGroupOutput) Labels() pulumi.StringMapOutput {
   645  	return o.ApplyT(func(v *NodeGroup) pulumi.StringMapOutput { return v.Labels }).(pulumi.StringMapOutput)
   646  }
   647  
   648  // Configuration block with Launch Template settings. See `launchTemplate` below for details. Conflicts with `remoteAccess`.
   649  func (o NodeGroupOutput) LaunchTemplate() NodeGroupLaunchTemplatePtrOutput {
   650  	return o.ApplyT(func(v *NodeGroup) NodeGroupLaunchTemplatePtrOutput { return v.LaunchTemplate }).(NodeGroupLaunchTemplatePtrOutput)
   651  }
   652  
   653  // Name of the EKS Node Group. If omitted, the provider will assign a random, unique name. Conflicts with `nodeGroupNamePrefix`. The node group name can't be longer than 63 characters. It must start with a letter or digit, but can also include hyphens and underscores for the remaining characters.
   654  func (o NodeGroupOutput) NodeGroupName() pulumi.StringOutput {
   655  	return o.ApplyT(func(v *NodeGroup) pulumi.StringOutput { return v.NodeGroupName }).(pulumi.StringOutput)
   656  }
   657  
   658  // Creates a unique name beginning with the specified prefix. Conflicts with `nodeGroupName`.
   659  func (o NodeGroupOutput) NodeGroupNamePrefix() pulumi.StringOutput {
   660  	return o.ApplyT(func(v *NodeGroup) pulumi.StringOutput { return v.NodeGroupNamePrefix }).(pulumi.StringOutput)
   661  }
   662  
   663  // Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group.
   664  func (o NodeGroupOutput) NodeRoleArn() pulumi.StringOutput {
   665  	return o.ApplyT(func(v *NodeGroup) pulumi.StringOutput { return v.NodeRoleArn }).(pulumi.StringOutput)
   666  }
   667  
   668  // AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version.
   669  func (o NodeGroupOutput) ReleaseVersion() pulumi.StringOutput {
   670  	return o.ApplyT(func(v *NodeGroup) pulumi.StringOutput { return v.ReleaseVersion }).(pulumi.StringOutput)
   671  }
   672  
   673  // Configuration block with remote access settings. See `remoteAccess` below for details. Conflicts with `launchTemplate`.
   674  func (o NodeGroupOutput) RemoteAccess() NodeGroupRemoteAccessPtrOutput {
   675  	return o.ApplyT(func(v *NodeGroup) NodeGroupRemoteAccessPtrOutput { return v.RemoteAccess }).(NodeGroupRemoteAccessPtrOutput)
   676  }
   677  
   678  // List of objects containing information about underlying resources.
   679  func (o NodeGroupOutput) Resources() NodeGroupResourceArrayOutput {
   680  	return o.ApplyT(func(v *NodeGroup) NodeGroupResourceArrayOutput { return v.Resources }).(NodeGroupResourceArrayOutput)
   681  }
   682  
   683  // Configuration block with scaling settings. See `scalingConfig` below for details.
   684  func (o NodeGroupOutput) ScalingConfig() NodeGroupScalingConfigOutput {
   685  	return o.ApplyT(func(v *NodeGroup) NodeGroupScalingConfigOutput { return v.ScalingConfig }).(NodeGroupScalingConfigOutput)
   686  }
   687  
   688  // Status of the EKS Node Group.
   689  func (o NodeGroupOutput) Status() pulumi.StringOutput {
   690  	return o.ApplyT(func(v *NodeGroup) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   691  }
   692  
   693  // Identifiers of EC2 Subnets to associate with the EKS Node Group.
   694  //
   695  // The following arguments are optional:
   696  func (o NodeGroupOutput) SubnetIds() pulumi.StringArrayOutput {
   697  	return o.ApplyT(func(v *NodeGroup) pulumi.StringArrayOutput { return v.SubnetIds }).(pulumi.StringArrayOutput)
   698  }
   699  
   700  // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   701  func (o NodeGroupOutput) Tags() pulumi.StringMapOutput {
   702  	return o.ApplyT(func(v *NodeGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   703  }
   704  
   705  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   706  //
   707  // Deprecated: Please use `tags` instead.
   708  func (o NodeGroupOutput) TagsAll() pulumi.StringMapOutput {
   709  	return o.ApplyT(func(v *NodeGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   710  }
   711  
   712  // The Kubernetes taints to be applied to the nodes in the node group. Maximum of 50 taints per node group. See taint below for details.
   713  func (o NodeGroupOutput) Taints() NodeGroupTaintArrayOutput {
   714  	return o.ApplyT(func(v *NodeGroup) NodeGroupTaintArrayOutput { return v.Taints }).(NodeGroupTaintArrayOutput)
   715  }
   716  
   717  // Configuration block with update settings. See `updateConfig` below for details.
   718  func (o NodeGroupOutput) UpdateConfig() NodeGroupUpdateConfigOutput {
   719  	return o.ApplyT(func(v *NodeGroup) NodeGroupUpdateConfigOutput { return v.UpdateConfig }).(NodeGroupUpdateConfigOutput)
   720  }
   721  
   722  // Kubernetes version. Defaults to EKS Cluster Kubernetes version. The provider will only perform drift detection if a configuration value is provided.
   723  func (o NodeGroupOutput) Version() pulumi.StringOutput {
   724  	return o.ApplyT(func(v *NodeGroup) pulumi.StringOutput { return v.Version }).(pulumi.StringOutput)
   725  }
   726  
   727  type NodeGroupArrayOutput struct{ *pulumi.OutputState }
   728  
   729  func (NodeGroupArrayOutput) ElementType() reflect.Type {
   730  	return reflect.TypeOf((*[]*NodeGroup)(nil)).Elem()
   731  }
   732  
   733  func (o NodeGroupArrayOutput) ToNodeGroupArrayOutput() NodeGroupArrayOutput {
   734  	return o
   735  }
   736  
   737  func (o NodeGroupArrayOutput) ToNodeGroupArrayOutputWithContext(ctx context.Context) NodeGroupArrayOutput {
   738  	return o
   739  }
   740  
   741  func (o NodeGroupArrayOutput) Index(i pulumi.IntInput) NodeGroupOutput {
   742  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *NodeGroup {
   743  		return vs[0].([]*NodeGroup)[vs[1].(int)]
   744  	}).(NodeGroupOutput)
   745  }
   746  
   747  type NodeGroupMapOutput struct{ *pulumi.OutputState }
   748  
   749  func (NodeGroupMapOutput) ElementType() reflect.Type {
   750  	return reflect.TypeOf((*map[string]*NodeGroup)(nil)).Elem()
   751  }
   752  
   753  func (o NodeGroupMapOutput) ToNodeGroupMapOutput() NodeGroupMapOutput {
   754  	return o
   755  }
   756  
   757  func (o NodeGroupMapOutput) ToNodeGroupMapOutputWithContext(ctx context.Context) NodeGroupMapOutput {
   758  	return o
   759  }
   760  
   761  func (o NodeGroupMapOutput) MapIndex(k pulumi.StringInput) NodeGroupOutput {
   762  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *NodeGroup {
   763  		return vs[0].(map[string]*NodeGroup)[vs[1].(string)]
   764  	}).(NodeGroupOutput)
   765  }
   766  
   767  func init() {
   768  	pulumi.RegisterInputType(reflect.TypeOf((*NodeGroupInput)(nil)).Elem(), &NodeGroup{})
   769  	pulumi.RegisterInputType(reflect.TypeOf((*NodeGroupArrayInput)(nil)).Elem(), NodeGroupArray{})
   770  	pulumi.RegisterInputType(reflect.TypeOf((*NodeGroupMapInput)(nil)).Elem(), NodeGroupMap{})
   771  	pulumi.RegisterOutputType(NodeGroupOutput{})
   772  	pulumi.RegisterOutputType(NodeGroupArrayOutput{})
   773  	pulumi.RegisterOutputType(NodeGroupMapOutput{})
   774  }