From 90bb23a68ef503bd5f1e75d7183ea51241e657e2 Mon Sep 17 00:00:00 2001 From: Florian Stadler Date: Fri, 13 Sep 2024 19:40:56 +0200 Subject: [PATCH] Add configuration parameter for nodeadm configuration to node groups (#1340) This change adds a new input property called `nodeadmExtraConfig` to the node group components. This property will allow injecting additional nodeadm sections into the user data. This can be virtually anything. Some data, a shell script, or additional nodeadm [`NodeConfig`](https://awslabs.github.io/amazon-eks-ami/nodeadm/). The nodeadm user data is a MIME multipart/mixed document. And every section has string based `content` and a MIME multipart `contentType`. Right now there's no straight forward way to generate types for the nodeadm `NodeConfig` because it's not schematized. Work for enhancing this is tracked here: https://github.com/pulumi/pulumi-eks/issues/1341. --- examples/examples_nodejs_test.go | 2 +- examples/examples_py_test.go | 4 +- examples/tests/managed-ng-os-py/__main__.py | 21 +++ examples/tests/managed-ng-os/index.ts | 19 ++ examples/tests/managed-ng-os/userdata.ts | 8 +- .../eks/__snapshots__/userdata.test.ts.snap | 99 ++++++++++ nodejs/eks/nodegroup.ts | 126 +++++++++++-- nodejs/eks/userdata.test.ts | 95 +++++++++- nodejs/eks/userdata.ts | 31 ++- provider/cmd/pulumi-gen-eks/main.go | 56 ++++++ provider/cmd/pulumi-resource-eks/schema.json | 46 +++++ .../Inputs/ClusterNodeGroupOptionsArgs.cs | 22 +++ sdk/dotnet/Inputs/NodeadmOptionsArgs.cs | 37 ++++ sdk/dotnet/ManagedNodeGroup.cs | 22 +++ sdk/dotnet/NodeGroup.cs | 22 +++ sdk/dotnet/NodeGroupV2.cs | 22 +++ sdk/dotnet/Outputs/ClusterNodeGroupOptions.cs | 17 ++ sdk/dotnet/Outputs/NodeadmOptions.cs | 40 ++++ sdk/go/eks/managedNodeGroup.go | 24 +++ sdk/go/eks/nodeGroup.go | 24 +++ sdk/go/eks/nodeGroupV2.go | 24 +++ sdk/go/eks/pulumiTypes.go | 178 ++++++++++++++++++ .../com/pulumi/eks/ManagedNodeGroupArgs.java | 98 ++++++++++ .../java/com/pulumi/eks/NodeGroupArgs.java | 98 ++++++++++ .../java/com/pulumi/eks/NodeGroupV2Args.java | 98 ++++++++++ .../inputs/ClusterNodeGroupOptionsArgs.java | 98 ++++++++++ .../pulumi/eks/inputs/NodeadmOptionsArgs.java | 126 +++++++++++++ .../eks/outputs/ClusterNodeGroupOptions.java | 44 +++++ .../pulumi/eks/outputs/NodeadmOptions.java | 74 ++++++++ sdk/python/pulumi_eks/_inputs.py | 77 ++++++++ sdk/python/pulumi_eks/managed_node_group.py | 50 +++++ sdk/python/pulumi_eks/node_group.py | 50 +++++ sdk/python/pulumi_eks/node_group_v2.py | 50 +++++ sdk/python/pulumi_eks/outputs.py | 89 +++++++++ 34 files changed, 1859 insertions(+), 32 deletions(-) create mode 100644 sdk/dotnet/Inputs/NodeadmOptionsArgs.cs create mode 100644 sdk/dotnet/Outputs/NodeadmOptions.cs create mode 100644 sdk/java/src/main/java/com/pulumi/eks/inputs/NodeadmOptionsArgs.java create mode 100644 sdk/java/src/main/java/com/pulumi/eks/outputs/NodeadmOptions.java diff --git a/examples/examples_nodejs_test.go b/examples/examples_nodejs_test.go index ee22d88e7..fc4a4e0d4 100644 --- a/examples/examples_nodejs_test.go +++ b/examples/examples_nodejs_test.go @@ -882,7 +882,7 @@ func TestAccManagedNodeGroupOS(t *testing.T) { info.Outputs["kubeconfig"], ) - assert.NoError(t, utils.ValidateNodePodCapacity(t, info.Outputs["kubeconfig"], 5, 100, "increased-pod-capacity")) + assert.NoError(t, utils.ValidateNodePodCapacity(t, info.Outputs["kubeconfig"], 6, 100, "increased-pod-capacity")) assert.NoError(t, utils.ValidateNodeStorage(t, info.Outputs["kubeconfig"], 4, 100*1_000_000_000, "increased-storage-capacity")) assert.NoError(t, utils.ValidateNodes(t, info.Outputs["kubeconfig"], func(nodes *corev1.NodeList) { diff --git a/examples/examples_py_test.go b/examples/examples_py_test.go index f9c87a713..065e1c355 100644 --- a/examples/examples_py_test.go +++ b/examples/examples_py_test.go @@ -159,8 +159,8 @@ func TestAccManagedNodeGroupOSPy(t *testing.T) { info.Outputs["kubeconfig"], ) - // expect 3 nodes with increased pod capacity of 100 - assert.NoError(t, utils.ValidateNodePodCapacity(t, info.Outputs["kubeconfig"], 3, 100, "increased-pod-capacity")) + // expect 4 nodes with increased pod capacity of 100 + assert.NoError(t, utils.ValidateNodePodCapacity(t, info.Outputs["kubeconfig"], 4, 100, "increased-pod-capacity")) }, }) diff --git a/examples/tests/managed-ng-os-py/__main__.py b/examples/tests/managed-ng-os-py/__main__.py index dade408b6..52c8febff 100644 --- a/examples/tests/managed-ng-os-py/__main__.py +++ b/examples/tests/managed-ng-os-py/__main__.py @@ -71,6 +71,27 @@ labels={ "increased-pod-capacity": "true" }, kubelet_extra_args="--max-pods=100") +nodeadm_extra_config = """--- +apiVersion: node.eks.aws/v1alpha1 +kind: NodeConfig +spec: + kubelet: + flags: + - '--max-pods=100 --node-labels=increased-pod-capacity=true' +""" +mng_al2023_arm_nodeadm = eks.ManagedNodeGroup(f'{project_name}-al2023-arm-nodeadm', + cluster=cluster, + node_role=role, + instance_types=["t4g.medium"], + scaling_config=scaling_config, + operating_system=eks.OperatingSystem.AL2023, + nodeadm_extra_options=[ + eks.NodeadmOptionsArgs( + content_type="application/node.eks.aws", + content=nodeadm_extra_config + ) + ]) + mng_bottlerocket = eks.ManagedNodeGroup(f'{project_name}-bottlerocket', cluster=cluster, node_role=role, diff --git a/examples/tests/managed-ng-os/index.ts b/examples/tests/managed-ng-os/index.ts index a82be4e4d..f6fc5659a 100644 --- a/examples/tests/managed-ng-os/index.ts +++ b/examples/tests/managed-ng-os/index.ts @@ -1,3 +1,4 @@ + import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; import * as awsx from "@pulumi/awsx"; @@ -187,3 +188,21 @@ const managedNodeGroupAL2023CustomUserData = eks.createManagedNodeGroup("al-2023 userData: customUserData, amiId, }); + +const managedNodeGroupAL2023NodeadmExtraOptions = eks.createManagedNodeGroup("al-2023-mng-extra-options", { + ...scalingConfig, + operatingSystem: eks.OperatingSystem.AL2023, + cluster: cluster, + instanceTypes: ["t3.medium"], + nodeRole: role, + nodeadmExtraOptions: [ + { + contentType: "application/node.eks.aws", + content: userdata.customFlags(`--max-pods=${increasedPodCapacity} --node-labels=increased-pod-capacity=true`), + }, + { + contentType: `text/x-shellscript; charset="us-ascii"`, + content: `#!/bin/bash\necho "Hello Pulumi!"`, + }, + ] +}); diff --git a/examples/tests/managed-ng-os/userdata.ts b/examples/tests/managed-ng-os/userdata.ts index 7c478a1c8..c3adfa338 100644 --- a/examples/tests/managed-ng-os/userdata.ts +++ b/examples/tests/managed-ng-os/userdata.ts @@ -28,7 +28,11 @@ spec: --BOUNDARY Content-Type: application/node.eks.aws ---- +${customFlags(kubeletFlags)}`.apply((ud) => Buffer.from(ud, "utf-8").toString("base64")); +} + +export function customFlags(kubeletFlags: string): string { + return `--- apiVersion: node.eks.aws/v1alpha1 kind: NodeConfig spec: @@ -37,5 +41,5 @@ spec: - '${kubeletFlags}' --BOUNDARY-- -`.apply((ud) => Buffer.from(ud, "utf-8").toString("base64")); +`; } diff --git a/nodejs/eks/__snapshots__/userdata.test.ts.snap b/nodejs/eks/__snapshots__/userdata.test.ts.snap index df2a5d3b4..a8f522dcb 100644 --- a/nodejs/eks/__snapshots__/userdata.test.ts.snap +++ b/nodejs/eks/__snapshots__/userdata.test.ts.snap @@ -82,6 +82,105 @@ exports[`createUserData linux should return the correct user data for a basic No " `; +exports[`createUserData nodeadm should allow adding extra nodeadm options for a ManagedNodeGroup 1`] = ` +"MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="BOUNDARY" + +--BOUNDARY +Content-Type: application/node.eks.aws + +--- +apiVersion: node.eks.aws/v1alpha1 +kind: NodeConfig +spec: + cluster: + name: example-managed-nodegroups-eksCluster-b27184c + apiServerEndpoint: https://CE21F68965F7FB2C00423B4483130C27.gr7.us-west-2.eks.amazonaws.com + certificateAuthority: >- + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJQWNzUG82b0t1S293RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TkRBMk1ETXhPVEl3TWpoYUZ3MHpOREEyTURFeE9USTFNamhhTUJVeApFekFSQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLCkFvSUJBUURqU0VRWFFkcjhmcDNOc2JYRG5RZTY1VGVGb1RkTUFiSVhzVjJua0t4V3dzdTM3dUJJSDBDSHV4b2gKYU9ZY1IzNmd5OVA2K0ZZSndhc3pyRGMvL0M1dGtsV0JLaGpySkRKbk5mcU0vUVBqOXRoK3dHWE4xeW5zR2VKbQpPVTZ4ek8yd290Uk1aYlBHTmx2UnlQQWtHMFZrM3Z0dEVINU8rcGl1NU44MkFnY3hWOGpWN3M0RHA3Qnd1L0xVCjFPRXRaN0RoVy9vWllPdTltRVJkK29CMkg4OS9ERDhZclBrejlvVlZCOEQycXp2UlRGUEhiR1VwaHNKK1VkZmcKNndhdjQySlRHS1RJRjc1OHRtbWZpL2lyaEJGMUlDcHI4bDJLVG9jNElKMWdVM0loS1lDOStHYlB2Y2VRK2ZwNgpTMlBTZStzVElGS2thY3JtRnNWM0hETEFvenJ6QWdNQkFBR2pXVEJYTUE0R0ExVWREd0VCL3dRRUF3SUNwREFQCkJnTlZIUk1CQWY4RUJUQURBUUgvTUIwR0ExVWREZ1FXQkJSZWpnZC84THN3eHpDTVpGQWRsUUdvM1lYdnp6QVYKQmdOVkhSRUVEakFNZ2dwcmRXSmxjbTVsZEdWek1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRRGE4TU5VQnNvbQpWYmx2dzRaaTYxaUxFZEVKTkxkMG5TNnIxQTVidjZLZHFjd0VNN0VDVldyTlB3TFVWYklaOTEzeEMxNnN1M2szCnZkTWllWEhkSDNPZTdkTzZ3RXNxbzdyTDdYc0FUblRlZEQ4OFRyVU13TjFVcEY1VHRjMUlRaHVaM1pnUnJmVUUKV09RZnFrcU8waVljNUl0ZUZvV1Q1ZHlseHd0eWpwMDhCZmFNVGZvc2cvYW1BUnhvRnptVGV6dkRSTnlEVllwdwovVWRFR0FmT0lBY3ZJNy9oNmhTay8wMkFTOGRXSm0xZWlMZ3p0czhCUGZJME1KaFFjdjlhL1dZc3I4aDREaTFpCmNsNlhnb0hWZ3VzZ1UwQVQ3SHdqelQ4WFN0N0xzb08rMFlTUTZOck9wZTlwL283N0FwaGFEQ3hIZHhJZlF1LysKRGttNUJhR05VaWFxCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K + cidr: 10.100.0.0/16 + +--BOUNDARY +Content-Type: application/node.eks.aws + +--- +apiVersion: node.eks.aws/v1alpha1 +kind: NodeConfig +spec: + kubelet: + flags: + - '--max-pods=500' + +--BOUNDARY +Content-Type: text/x-shellscript; charset="us-ascii" + +#!/bin/bash +echo "Hello, World!" +--BOUNDARY-- +" +`; + +exports[`createUserData nodeadm should allow adding extra nodeadm options for a NodeGroup 1`] = ` +"MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="BOUNDARY" + +--BOUNDARY +Content-Type: application/node.eks.aws + +--- +apiVersion: node.eks.aws/v1alpha1 +kind: NodeConfig +spec: + cluster: + name: example-managed-nodegroups-eksCluster-b27184c + apiServerEndpoint: https://CE21F68965F7FB2C00423B4483130C27.gr7.us-west-2.eks.amazonaws.com + certificateAuthority: >- + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJQWNzUG82b0t1S293RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TkRBMk1ETXhPVEl3TWpoYUZ3MHpOREEyTURFeE9USTFNamhhTUJVeApFekFSQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLCkFvSUJBUURqU0VRWFFkcjhmcDNOc2JYRG5RZTY1VGVGb1RkTUFiSVhzVjJua0t4V3dzdTM3dUJJSDBDSHV4b2gKYU9ZY1IzNmd5OVA2K0ZZSndhc3pyRGMvL0M1dGtsV0JLaGpySkRKbk5mcU0vUVBqOXRoK3dHWE4xeW5zR2VKbQpPVTZ4ek8yd290Uk1aYlBHTmx2UnlQQWtHMFZrM3Z0dEVINU8rcGl1NU44MkFnY3hWOGpWN3M0RHA3Qnd1L0xVCjFPRXRaN0RoVy9vWllPdTltRVJkK29CMkg4OS9ERDhZclBrejlvVlZCOEQycXp2UlRGUEhiR1VwaHNKK1VkZmcKNndhdjQySlRHS1RJRjc1OHRtbWZpL2lyaEJGMUlDcHI4bDJLVG9jNElKMWdVM0loS1lDOStHYlB2Y2VRK2ZwNgpTMlBTZStzVElGS2thY3JtRnNWM0hETEFvenJ6QWdNQkFBR2pXVEJYTUE0R0ExVWREd0VCL3dRRUF3SUNwREFQCkJnTlZIUk1CQWY4RUJUQURBUUgvTUIwR0ExVWREZ1FXQkJSZWpnZC84THN3eHpDTVpGQWRsUUdvM1lYdnp6QVYKQmdOVkhSRUVEakFNZ2dwcmRXSmxjbTVsZEdWek1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRRGE4TU5VQnNvbQpWYmx2dzRaaTYxaUxFZEVKTkxkMG5TNnIxQTVidjZLZHFjd0VNN0VDVldyTlB3TFVWYklaOTEzeEMxNnN1M2szCnZkTWllWEhkSDNPZTdkTzZ3RXNxbzdyTDdYc0FUblRlZEQ4OFRyVU13TjFVcEY1VHRjMUlRaHVaM1pnUnJmVUUKV09RZnFrcU8waVljNUl0ZUZvV1Q1ZHlseHd0eWpwMDhCZmFNVGZvc2cvYW1BUnhvRnptVGV6dkRSTnlEVllwdwovVWRFR0FmT0lBY3ZJNy9oNmhTay8wMkFTOGRXSm0xZWlMZ3p0czhCUGZJME1KaFFjdjlhL1dZc3I4aDREaTFpCmNsNlhnb0hWZ3VzZ1UwQVQ3SHdqelQ4WFN0N0xzb08rMFlTUTZOck9wZTlwL283N0FwaGFEQ3hIZHhJZlF1LysKRGttNUJhR05VaWFxCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K + cidr: 10.100.0.0/16 + +--BOUNDARY +Content-Type: text/x-shellscript; charset="us-ascii" + +#!/bin/bash +echo "Hello, World!" +--BOUNDARY +Content-Type: text/x-shellscript; charset="us-ascii" + +#!/bin/bash + +/opt/aws/bin/cfn-signal --exit-code $? --stack example-cluster-1-98075617 --resource NodeGroup --region us-west-2 + +--BOUNDARY-- +" +`; + +exports[`createUserData nodeadm should allow adding extra nodeadm options for a NodeGroupV2 1`] = ` +"MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="BOUNDARY" + +--BOUNDARY +Content-Type: application/node.eks.aws + +--- +apiVersion: node.eks.aws/v1alpha1 +kind: NodeConfig +spec: + cluster: + name: example-managed-nodegroups-eksCluster-b27184c + apiServerEndpoint: https://CE21F68965F7FB2C00423B4483130C27.gr7.us-west-2.eks.amazonaws.com + certificateAuthority: >- + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJQWNzUG82b0t1S293RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TkRBMk1ETXhPVEl3TWpoYUZ3MHpOREEyTURFeE9USTFNamhhTUJVeApFekFSQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLCkFvSUJBUURqU0VRWFFkcjhmcDNOc2JYRG5RZTY1VGVGb1RkTUFiSVhzVjJua0t4V3dzdTM3dUJJSDBDSHV4b2gKYU9ZY1IzNmd5OVA2K0ZZSndhc3pyRGMvL0M1dGtsV0JLaGpySkRKbk5mcU0vUVBqOXRoK3dHWE4xeW5zR2VKbQpPVTZ4ek8yd290Uk1aYlBHTmx2UnlQQWtHMFZrM3Z0dEVINU8rcGl1NU44MkFnY3hWOGpWN3M0RHA3Qnd1L0xVCjFPRXRaN0RoVy9vWllPdTltRVJkK29CMkg4OS9ERDhZclBrejlvVlZCOEQycXp2UlRGUEhiR1VwaHNKK1VkZmcKNndhdjQySlRHS1RJRjc1OHRtbWZpL2lyaEJGMUlDcHI4bDJLVG9jNElKMWdVM0loS1lDOStHYlB2Y2VRK2ZwNgpTMlBTZStzVElGS2thY3JtRnNWM0hETEFvenJ6QWdNQkFBR2pXVEJYTUE0R0ExVWREd0VCL3dRRUF3SUNwREFQCkJnTlZIUk1CQWY4RUJUQURBUUgvTUIwR0ExVWREZ1FXQkJSZWpnZC84THN3eHpDTVpGQWRsUUdvM1lYdnp6QVYKQmdOVkhSRUVEakFNZ2dwcmRXSmxjbTVsZEdWek1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRRGE4TU5VQnNvbQpWYmx2dzRaaTYxaUxFZEVKTkxkMG5TNnIxQTVidjZLZHFjd0VNN0VDVldyTlB3TFVWYklaOTEzeEMxNnN1M2szCnZkTWllWEhkSDNPZTdkTzZ3RXNxbzdyTDdYc0FUblRlZEQ4OFRyVU13TjFVcEY1VHRjMUlRaHVaM1pnUnJmVUUKV09RZnFrcU8waVljNUl0ZUZvV1Q1ZHlseHd0eWpwMDhCZmFNVGZvc2cvYW1BUnhvRnptVGV6dkRSTnlEVllwdwovVWRFR0FmT0lBY3ZJNy9oNmhTay8wMkFTOGRXSm0xZWlMZ3p0czhCUGZJME1KaFFjdjlhL1dZc3I4aDREaTFpCmNsNlhnb0hWZ3VzZ1UwQVQ3SHdqelQ4WFN0N0xzb08rMFlTUTZOck9wZTlwL283N0FwaGFEQ3hIZHhJZlF1LysKRGttNUJhR05VaWFxCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K + cidr: 10.100.0.0/16 + +--BOUNDARY +Content-Type: text/x-shellscript; charset="us-ascii" + +#!/bin/bash +echo "Hello, World!" +--BOUNDARY-- +" +`; + exports[`createUserData nodeadm should return the correct user data for a basic ManagedNodeGroup 1`] = ` "MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="BOUNDARY" diff --git a/nodejs/eks/nodegroup.ts b/nodejs/eks/nodegroup.ts index c8e02da79..a2d5147f4 100644 --- a/nodejs/eks/nodegroup.ts +++ b/nodejs/eks/nodegroup.ts @@ -33,6 +33,7 @@ import { createNodeGroupSecurityGroup } from "./securitygroup"; import { InputTags } from "./utils"; import { createUserData, + customUserDataArgs, ManagedNodeUserDataArgs, requiresCustomUserData, SelfManagedV1NodeUserDataArgs, @@ -54,6 +55,16 @@ export interface Taint { effect: "NoSchedule" | "NoExecute" | "PreferNoSchedule"; } +/** + * MIME document parts for nodeadm configuration. This can be shell scripts, nodeadm configuration or any other user data compatible script. + * + * See for more details: https://awslabs.github.io/amazon-eks-ami/nodeadm/. + */ +export type NodeadmOptions = { + content: pulumi.Input; + contentType: pulumi.Input; +}; + /** * NodeGroupArgs represents the common configuration settings for NodeGroups. */ @@ -318,6 +329,25 @@ export interface NodeGroupBaseOptions { * For an overview of the available settings, see https://bottlerocket.dev/en/os/1.20.x/api/settings/. */ bottlerocketSettings?: pulumi.Input; + + /** + * Extra nodeadm configuration sections to be added to the nodeadm user data. + * This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. + * When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. + * You can overwrite base settings or provide additional settings this way. + * + * The base settings are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - [Amazon EKS AMI - Nodeadm](https://awslabs.github.io/amazon-eks-ami/nodeadm/). + * - [Amazon EKS AMI - Nodeadm Configuration](https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/). + */ + nodeadmExtraOptions?: pulumi.Input[]>; } /** @@ -741,6 +771,12 @@ function createNodeGroupInternal( serviceCidr, }; + const nodeadmExtraOptions = pulumi + .output(args.nodeadmExtraOptions) + .apply((nodeadmExtraOptions) => { + return nodeadmExtraOptions ? pulumi.all(nodeadmExtraOptions) : undefined; + }); + const userdata = pulumi .all([ awsRegion, @@ -750,6 +786,7 @@ function createNodeGroupInternal( args.nodeUserDataOverride, os, args.bottlerocketSettings, + nodeadmExtraOptions, ]) .apply( ([ @@ -760,6 +797,7 @@ function createNodeGroupInternal( userDataOverride, os, bottlerocketSettings, + nodeadmExtraOptions, ]) => { const userDataArgs: SelfManagedV1NodeUserDataArgs = { nodeGroupType: "self-managed-v1", @@ -772,6 +810,7 @@ function createNodeGroupInternal( extraUserData, stackName, bottlerocketSettings, + nodeadmExtraOptions, }; return createUserData(os, clusterMetadata, userDataArgs, parent); @@ -1190,6 +1229,12 @@ function createNodeGroupV2Internal( serviceCidr, }; + const nodeadmExtraOptions = pulumi + .output(args.nodeadmExtraOptions) + .apply((nodeadmExtraOptions) => { + return nodeadmExtraOptions ? pulumi.all(nodeadmExtraOptions) : undefined; + }); + const userdata = pulumi .all([ clusterMetadata, @@ -1198,6 +1243,7 @@ function createNodeGroupV2Internal( args.nodeUserDataOverride, os, args.bottlerocketSettings, + nodeadmExtraOptions, ]) .apply( ([ @@ -1207,6 +1253,7 @@ function createNodeGroupV2Internal( userDataOverride, os, bottlerocketSettings, + nodeadmExtraOptions, ]) => { const userDataArgs: SelfManagedV2NodeUserDataArgs = { nodeGroupType: "self-managed-v2", @@ -1218,6 +1265,7 @@ function createNodeGroupV2Internal( extraUserData, stackName, bottlerocketSettings, + nodeadmExtraOptions, }; return createUserData(os, clusterMetadata, userDataArgs, parent); @@ -1719,6 +1767,25 @@ export type ManagedNodeGroupOptions = Omit< * See for more details: https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html. */ amiId?: pulumi.Input; + + /** + * Extra nodeadm configuration sections to be added to the nodeadm user data. + * This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. + * When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. + * You can overwrite base settings or provide additional settings this way. + * + * The base settings are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - [Amazon EKS AMI - Nodeadm](https://awslabs.github.io/amazon-eks-ami/nodeadm/). + * - [Amazon EKS AMI - Nodeadm Configuration](https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/). + */ + nodeadmExtraOptions?: pulumi.Input[]>; }; /** @@ -1914,25 +1981,30 @@ function createManagedNodeGroupInternal( delete (nodeGroupArgs).cluster; } - // Create a custom launch template for the managed node group if the user specifies either kubeletExtraArgs or bootstrapExtraArgs. - // If the user sepcifies a custom LaunchTemplate, we throw an error and suggest that the user include this in the launch template that they are providing. + // Create a custom launch template for the managed node group if the user specifies any of the advanced options. + // If the user specifies a custom LaunchTemplate, we throw an error and suggest that the user should include those in the launch template that they are providing. // If neither of these are provided, we can use the default launch template for managed node groups. if (args.launchTemplate && requiresCustomLaunchTemplate(args)) { throw new pulumi.ResourceError( - "If you provide a custom launch template, you cannot provide kubeletExtraArgs, bootstrapExtraArgs, enableIMDSv2, userData or amiId. Please include these in the launch template that you are providing.", + `If you provide a custom launch template, you cannot provide any of ${customLaunchTemplateArgs.join( + ", ", + )}. Please include these in the launch template that you are providing.`, parent, ); } - const customUserDataArgs = { + const userDataArgs = { kubeletExtraArgs: args.kubeletExtraArgs, bootstrapExtraArgs: args.bootstrapExtraArgs, bottlerocketSettings: args.bottlerocketSettings, + nodeadmExtraOptions: args.nodeadmExtraOptions, }; - if (requiresCustomUserData(customUserDataArgs) && args.userData) { + if (requiresCustomUserData(userDataArgs) && args.userData) { throw new pulumi.ResourceError( - "If you provide a custom userData, you cannot provide kubeletExtraArgs, bootstrapExtraArgs or bottlerocketSettings. Please include these in the userData that you are providing.", + `If you provide custom userData, you cannot provide any of ${customUserDataArgs.join( + ", ", + )}. Please include these in the userData that you are providing.`, parent, ); } @@ -1950,7 +2022,7 @@ function createManagedNodeGroupInternal( // amiType, releaseVersion and version cannot be set if an AMI ID is set in a custom launch template. // The AMI ID is set in the launch template if custom user data is required. // See https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html#mng-ami-id-conditions - if (requiresCustomUserData(customUserDataArgs) || args.userData) { + if (requiresCustomUserData(userDataArgs) || args.userData) { delete nodeGroupArgs.version; delete nodeGroupArgs.releaseVersion; delete nodeGroupArgs.amiType; @@ -1996,17 +2068,15 @@ function createManagedNodeGroupInternal( return nodeGroup; } +const customLaunchTemplateArgs: (keyof Omit)[] = [ + ...customUserDataArgs, + "enableIMDSv2", + "userData", + "amiId", +]; + function requiresCustomLaunchTemplate(args: Omit): boolean { - return ( - requiresCustomUserData({ - kubeletExtraArgs: args.kubeletExtraArgs, - bootstrapExtraArgs: args.bootstrapExtraArgs, - bottlerocketSettings: args.bottlerocketSettings, - }) || - args.enableIMDSv2 !== undefined || - args.userData !== undefined || - args.amiId !== undefined - ); + return customLaunchTemplateArgs.some((key) => args[key] !== undefined); } /** @@ -2052,7 +2122,15 @@ function createMNGCustomLaunchTemplate( kubeletExtraArgs: args.kubeletExtraArgs, bootstrapExtraArgs: args.bootstrapExtraArgs, bottlerocketSettings: args.bottlerocketSettings, + nodeadmExtraOptions: args.nodeadmExtraOptions, }; + + const nodeadmExtraOptions = pulumi + .output(args.nodeadmExtraOptions) + .apply((nodeadmExtraOptions) => { + return nodeadmExtraOptions ? pulumi.all(nodeadmExtraOptions) : undefined; + }); + let userData: pulumi.Output | undefined; if (requiresCustomUserData(customUserDataArgs) || args.userData) { userData = pulumi @@ -2063,9 +2141,18 @@ function createMNGCustomLaunchTemplate( taints, args.bottlerocketSettings, args.userData, + nodeadmExtraOptions, ]) .apply( - ([clusterMetadata, os, labels, taints, bottlerocketSettings, userDataOverride]) => { + ([ + clusterMetadata, + os, + labels, + taints, + bottlerocketSettings, + userDataOverride, + nodeadmExtraOptions, + ]) => { const userDataArgs: ManagedNodeUserDataArgs = { nodeGroupType: "managed", kubeletExtraArgs: args.kubeletExtraArgs, @@ -2073,7 +2160,8 @@ function createMNGCustomLaunchTemplate( labels, taints, bottlerocketSettings, - userDataOverride: userDataOverride, + userDataOverride, + nodeadmExtraOptions, }; const userData = createUserData(os, clusterMetadata, userDataArgs, parent); diff --git a/nodejs/eks/userdata.test.ts b/nodejs/eks/userdata.test.ts index 798d4d228..ea6005a58 100644 --- a/nodejs/eks/userdata.test.ts +++ b/nodejs/eks/userdata.test.ts @@ -24,7 +24,6 @@ import { SelfManagedV2NodeUserDataArgs, UserDataArgs, } from "./userdata"; -import { cloudformation } from "@pulumi/aws"; describe("requiresCustomUserData", () => { it("should return true if all args are defined", () => { @@ -38,6 +37,12 @@ describe("requiresCustomUserData", () => { }, }, }), + nodeadmExtraOptions: [ + { + contentType: `text/x-shellscript; charset="us-ascii"`, + content: `#!/bin/bash\necho "Hello, World!"`, + }, + ], }; const result = requiresCustomUserData(args); expect(result).toBe(true); @@ -48,6 +53,7 @@ describe("requiresCustomUserData", () => { bootstrapExtraArgs: undefined, kubeletExtraArgs: undefined, bottlerocketSettings: undefined, + nodeadmExtraOptions: undefined, }; const result = requiresCustomUserData(args); expect(result).toBe(false); @@ -58,6 +64,7 @@ describe("requiresCustomUserData", () => { bootstrapExtraArgs: "--arg1 value1", kubeletExtraArgs: undefined, bottlerocketSettings: undefined, + nodeadmExtraOptions: undefined, }; const result = requiresCustomUserData(args); expect(result).toBe(true); @@ -231,6 +238,92 @@ describe("createUserData", () => { "The 'bootstrapExtraArgs' argument is not supported for nodeadm based user data.", ); }); + + it("should allow adding extra nodeadm options for a NodeGroup", () => { + const userDataArgs: SelfManagedV1NodeUserDataArgs = { + nodeGroupType: "self-managed-v1", + awsRegion: "us-west-2", + stackName: "example-cluster-1-98075617", + extraUserData: undefined, + nodeadmExtraOptions: [ + { + contentType: `text/x-shellscript; charset="us-ascii"`, + content: `#!/bin/bash\necho "Hello, World!"`, + }, + ], + } as SelfManagedV1NodeUserDataArgs; + const userData = createUserData( + OperatingSystem.AL2023, + { + name: "example-managed-nodegroups-eksCluster-b27184c", + apiServerEndpoint: + "https://CE21F68965F7FB2C00423B4483130C27.gr7.us-west-2.eks.amazonaws.com", + certificateAuthority: + "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJQWNzUG82b0t1S293RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TkRBMk1ETXhPVEl3TWpoYUZ3MHpOREEyTURFeE9USTFNamhhTUJVeApFekFSQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLCkFvSUJBUURqU0VRWFFkcjhmcDNOc2JYRG5RZTY1VGVGb1RkTUFiSVhzVjJua0t4V3dzdTM3dUJJSDBDSHV4b2gKYU9ZY1IzNmd5OVA2K0ZZSndhc3pyRGMvL0M1dGtsV0JLaGpySkRKbk5mcU0vUVBqOXRoK3dHWE4xeW5zR2VKbQpPVTZ4ek8yd290Uk1aYlBHTmx2UnlQQWtHMFZrM3Z0dEVINU8rcGl1NU44MkFnY3hWOGpWN3M0RHA3Qnd1L0xVCjFPRXRaN0RoVy9vWllPdTltRVJkK29CMkg4OS9ERDhZclBrejlvVlZCOEQycXp2UlRGUEhiR1VwaHNKK1VkZmcKNndhdjQySlRHS1RJRjc1OHRtbWZpL2lyaEJGMUlDcHI4bDJLVG9jNElKMWdVM0loS1lDOStHYlB2Y2VRK2ZwNgpTMlBTZStzVElGS2thY3JtRnNWM0hETEFvenJ6QWdNQkFBR2pXVEJYTUE0R0ExVWREd0VCL3dRRUF3SUNwREFQCkJnTlZIUk1CQWY4RUJUQURBUUgvTUIwR0ExVWREZ1FXQkJSZWpnZC84THN3eHpDTVpGQWRsUUdvM1lYdnp6QVYKQmdOVkhSRUVEakFNZ2dwcmRXSmxjbTVsZEdWek1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRRGE4TU5VQnNvbQpWYmx2dzRaaTYxaUxFZEVKTkxkMG5TNnIxQTVidjZLZHFjd0VNN0VDVldyTlB3TFVWYklaOTEzeEMxNnN1M2szCnZkTWllWEhkSDNPZTdkTzZ3RXNxbzdyTDdYc0FUblRlZEQ4OFRyVU13TjFVcEY1VHRjMUlRaHVaM1pnUnJmVUUKV09RZnFrcU8waVljNUl0ZUZvV1Q1ZHlseHd0eWpwMDhCZmFNVGZvc2cvYW1BUnhvRnptVGV6dkRSTnlEVllwdwovVWRFR0FmT0lBY3ZJNy9oNmhTay8wMkFTOGRXSm0xZWlMZ3p0czhCUGZJME1KaFFjdjlhL1dZc3I4aDREaTFpCmNsNlhnb0hWZ3VzZ1UwQVQ3SHdqelQ4WFN0N0xzb08rMFlTUTZOck9wZTlwL283N0FwaGFEQ3hIZHhJZlF1LysKRGttNUJhR05VaWFxCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K", + serviceCidr: "10.100.0.0/16", + }, + userDataArgs, + undefined, + ); + + expect(userData).toMatchSnapshot(); + }); + + it("should allow adding extra nodeadm options for a NodeGroupV2", () => { + const userDataArgs: SelfManagedV2NodeUserDataArgs = { + nodeGroupType: "self-managed-v2", + stackName: "example", + nodeadmExtraOptions: [ + { + contentType: `text/x-shellscript; charset="us-ascii"`, + content: `#!/bin/bash\necho "Hello, World!"`, + }, + ], + } as unknown as SelfManagedV2NodeUserDataArgs; + const userData = createUserData( + OperatingSystem.AL2023, + { + name: "example-managed-nodegroups-eksCluster-b27184c", + apiServerEndpoint: + "https://CE21F68965F7FB2C00423B4483130C27.gr7.us-west-2.eks.amazonaws.com", + certificateAuthority: + "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJQWNzUG82b0t1S293RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TkRBMk1ETXhPVEl3TWpoYUZ3MHpOREEyTURFeE9USTFNamhhTUJVeApFekFSQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLCkFvSUJBUURqU0VRWFFkcjhmcDNOc2JYRG5RZTY1VGVGb1RkTUFiSVhzVjJua0t4V3dzdTM3dUJJSDBDSHV4b2gKYU9ZY1IzNmd5OVA2K0ZZSndhc3pyRGMvL0M1dGtsV0JLaGpySkRKbk5mcU0vUVBqOXRoK3dHWE4xeW5zR2VKbQpPVTZ4ek8yd290Uk1aYlBHTmx2UnlQQWtHMFZrM3Z0dEVINU8rcGl1NU44MkFnY3hWOGpWN3M0RHA3Qnd1L0xVCjFPRXRaN0RoVy9vWllPdTltRVJkK29CMkg4OS9ERDhZclBrejlvVlZCOEQycXp2UlRGUEhiR1VwaHNKK1VkZmcKNndhdjQySlRHS1RJRjc1OHRtbWZpL2lyaEJGMUlDcHI4bDJLVG9jNElKMWdVM0loS1lDOStHYlB2Y2VRK2ZwNgpTMlBTZStzVElGS2thY3JtRnNWM0hETEFvenJ6QWdNQkFBR2pXVEJYTUE0R0ExVWREd0VCL3dRRUF3SUNwREFQCkJnTlZIUk1CQWY4RUJUQURBUUgvTUIwR0ExVWREZ1FXQkJSZWpnZC84THN3eHpDTVpGQWRsUUdvM1lYdnp6QVYKQmdOVkhSRUVEakFNZ2dwcmRXSmxjbTVsZEdWek1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRRGE4TU5VQnNvbQpWYmx2dzRaaTYxaUxFZEVKTkxkMG5TNnIxQTVidjZLZHFjd0VNN0VDVldyTlB3TFVWYklaOTEzeEMxNnN1M2szCnZkTWllWEhkSDNPZTdkTzZ3RXNxbzdyTDdYc0FUblRlZEQ4OFRyVU13TjFVcEY1VHRjMUlRaHVaM1pnUnJmVUUKV09RZnFrcU8waVljNUl0ZUZvV1Q1ZHlseHd0eWpwMDhCZmFNVGZvc2cvYW1BUnhvRnptVGV6dkRSTnlEVllwdwovVWRFR0FmT0lBY3ZJNy9oNmhTay8wMkFTOGRXSm0xZWlMZ3p0czhCUGZJME1KaFFjdjlhL1dZc3I4aDREaTFpCmNsNlhnb0hWZ3VzZ1UwQVQ3SHdqelQ4WFN0N0xzb08rMFlTUTZOck9wZTlwL283N0FwaGFEQ3hIZHhJZlF1LysKRGttNUJhR05VaWFxCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K", + serviceCidr: "10.100.0.0/16", + }, + userDataArgs, + undefined, + ); + + expect(userData).toMatchSnapshot(); + }); + + it("should allow adding extra nodeadm options for a ManagedNodeGroup", () => { + const userDataArgs: ManagedNodeUserDataArgs = { + nodeGroupType: "managed", + kubeletExtraArgs: "--max-pods=500", + nodeadmExtraOptions: [ + { + contentType: `text/x-shellscript; charset="us-ascii"`, + content: `#!/bin/bash\necho "Hello, World!"`, + }, + ], + } as ManagedNodeUserDataArgs; + const userData = createUserData( + OperatingSystem.AL2023, + { + name: "example-managed-nodegroups-eksCluster-b27184c", + apiServerEndpoint: + "https://CE21F68965F7FB2C00423B4483130C27.gr7.us-west-2.eks.amazonaws.com", + certificateAuthority: + "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJQWNzUG82b0t1S293RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TkRBMk1ETXhPVEl3TWpoYUZ3MHpOREEyTURFeE9USTFNamhhTUJVeApFekFSQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLCkFvSUJBUURqU0VRWFFkcjhmcDNOc2JYRG5RZTY1VGVGb1RkTUFiSVhzVjJua0t4V3dzdTM3dUJJSDBDSHV4b2gKYU9ZY1IzNmd5OVA2K0ZZSndhc3pyRGMvL0M1dGtsV0JLaGpySkRKbk5mcU0vUVBqOXRoK3dHWE4xeW5zR2VKbQpPVTZ4ek8yd290Uk1aYlBHTmx2UnlQQWtHMFZrM3Z0dEVINU8rcGl1NU44MkFnY3hWOGpWN3M0RHA3Qnd1L0xVCjFPRXRaN0RoVy9vWllPdTltRVJkK29CMkg4OS9ERDhZclBrejlvVlZCOEQycXp2UlRGUEhiR1VwaHNKK1VkZmcKNndhdjQySlRHS1RJRjc1OHRtbWZpL2lyaEJGMUlDcHI4bDJLVG9jNElKMWdVM0loS1lDOStHYlB2Y2VRK2ZwNgpTMlBTZStzVElGS2thY3JtRnNWM0hETEFvenJ6QWdNQkFBR2pXVEJYTUE0R0ExVWREd0VCL3dRRUF3SUNwREFQCkJnTlZIUk1CQWY4RUJUQURBUUgvTUIwR0ExVWREZ1FXQkJSZWpnZC84THN3eHpDTVpGQWRsUUdvM1lYdnp6QVYKQmdOVkhSRUVEakFNZ2dwcmRXSmxjbTVsZEdWek1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRRGE4TU5VQnNvbQpWYmx2dzRaaTYxaUxFZEVKTkxkMG5TNnIxQTVidjZLZHFjd0VNN0VDVldyTlB3TFVWYklaOTEzeEMxNnN1M2szCnZkTWllWEhkSDNPZTdkTzZ3RXNxbzdyTDdYc0FUblRlZEQ4OFRyVU13TjFVcEY1VHRjMUlRaHVaM1pnUnJmVUUKV09RZnFrcU8waVljNUl0ZUZvV1Q1ZHlseHd0eWpwMDhCZmFNVGZvc2cvYW1BUnhvRnptVGV6dkRSTnlEVllwdwovVWRFR0FmT0lBY3ZJNy9oNmhTay8wMkFTOGRXSm0xZWlMZ3p0czhCUGZJME1KaFFjdjlhL1dZc3I4aDREaTFpCmNsNlhnb0hWZ3VzZ1UwQVQ3SHdqelQ4WFN0N0xzb08rMFlTUTZOck9wZTlwL283N0FwaGFEQ3hIZHhJZlF1LysKRGttNUJhR05VaWFxCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K", + serviceCidr: "10.100.0.0/16", + }, + userDataArgs, + undefined, + ); + + expect(userData).toMatchSnapshot(); + }); }); describe("bottlerocket", () => { diff --git a/nodejs/eks/userdata.ts b/nodejs/eks/userdata.ts index ff9e97549..ba2943840 100644 --- a/nodejs/eks/userdata.ts +++ b/nodejs/eks/userdata.ts @@ -15,7 +15,7 @@ import * as pulumi from "@pulumi/pulumi"; import { OperatingSystem } from "./ami"; -import { Taint } from "./nodegroup"; +import { NodeadmOptions, Taint } from "./nodegroup"; import * as jsyaml from "js-yaml"; import * as toml from "@iarna/toml"; import * as ipaddr from "ipaddr.js"; @@ -60,6 +60,12 @@ interface BaseUserDataArgs { */ userDataOverride: string | undefined; bottlerocketSettings: object | undefined; + nodeadmExtraOptions: + | { + content: string; + contentType: string; + }[] + | undefined; } // common arguments of self-managed node groups @@ -77,6 +83,7 @@ interface BaseSelfManagedNodeUserDataArgs extends BaseUserDataArgs { type CustomUserDataArgs = Pick & { bottlerocketSettings: pulumi.Input | undefined; + nodeadmExtraOptions: pulumi.Input[]> | undefined; }; export interface ManagedNodeUserDataArgs extends BaseUserDataArgs { @@ -119,15 +126,18 @@ export function isSelfManagedNodeUserDataArgs( return args.nodeGroupType === "self-managed-v1" || args.nodeGroupType === "self-managed-v2"; } +export const customUserDataArgs: (keyof CustomUserDataArgs)[] = [ + "bootstrapExtraArgs", + "kubeletExtraArgs", + "bottlerocketSettings", + "nodeadmExtraOptions", +]; + /** - * If the user specifies either kubeletExtraArgs or bootstrapExtraArgs, we need to create a base64 encoded user data script. + If the user specifies any of the customUserDataArgs, we need to create a base64 encoded user data script. */ export function requiresCustomUserData(args: CustomUserDataArgs): boolean { - return ( - args.kubeletExtraArgs !== undefined || - args.bootstrapExtraArgs !== undefined || - args.bottlerocketSettings !== undefined - ); + return customUserDataArgs.some((key) => args[key] !== undefined); } /** @@ -300,6 +310,13 @@ function createNodeadmUserData( }); } + // add extra nodeadm options if provided + if (args.nodeadmExtraOptions) { + for (const option of args.nodeadmExtraOptions) { + parts.push(option); + } + } + // TODO[pulumi/pulumi-eks#1195] expose extra nodeadm config options in the schema if (isSelfManagedNodeUserDataArgs(args) && args.extraUserData && args.extraUserData !== "") { parts.push({ diff --git a/provider/cmd/pulumi-gen-eks/main.go b/provider/cmd/pulumi-gen-eks/main.go index d5468b933..b9f67d93c 100644 --- a/provider/cmd/pulumi-gen-eks/main.go +++ b/provider/cmd/pulumi-gen-eks/main.go @@ -925,6 +925,25 @@ func generateSchema() schema.PackageSpec { "Note: `amiId` is mutually exclusive with `gpu` and `amiType`.\n\n" + "See for more details: https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html.", }, + "nodeadmExtraOptions": { + TypeSpec: schema.TypeSpec{ + Type: "array", + Items: &schema.TypeSpec{Ref: "#/types/eks:index:NodeadmOptions"}, + }, + Description: "Extra nodeadm configuration sections to be added to the nodeadm user data. " + + "This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. " + + "When configuring additional nodeadm NodeConfig sections, they'll be merged with the base " + + "settings the provider sets. You can overwrite base settings or provide additional settings this way.\n" + + "The base settings the provider sets are:\n" + + " - cluster.name\n" + + " - cluster.apiServerEndpoint\n" + + " - cluster.certificateAuthority\n" + + " - cluster.cidr\n\n" + + "Note: This is only applicable when using AL2023.\n" + + "See for more details:\n" + + " - https://awslabs.github.io/amazon-eks-ami/nodeadm/\n" + + " - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/", + }, }, RequiredInputs: []string{"cluster"}, }, @@ -1757,6 +1776,24 @@ func generateSchema() schema.PackageSpec { }, }, }, + "eks:index:NodeadmOptions": { + ObjectTypeSpec: schema.ObjectTypeSpec{ + Type: "object", + Description: "MIME document parts for nodeadm configuration. This can be shell scripts, nodeadm configuration or any other user data compatible script.\n\n" + + "See for more details: https://awslabs.github.io/amazon-eks-ami/nodeadm/.", + Properties: map[string]schema.PropertySpec{ + "content": { + TypeSpec: schema.TypeSpec{Type: "string"}, + Description: "The ARN of the access policy to associate with the principal", + }, + "contentType": { + TypeSpec: schema.TypeSpec{Type: "string"}, + Description: "The MIME type of the content. Examples are `text/x-shellscript; charset=\"us-ascii\"` for shell scripts, and `application/node.eks.aws` nodeadm configuration.", + }, + }, + Required: []string{"content", "contentType"}, + }, + }, }, Language: map[string]schema.RawMessage{ @@ -2059,6 +2096,25 @@ func nodeGroupProperties(cluster, v2 bool) map[string]schema.PropertySpec { " - settings.kubernetes.cluster-dns-ip\n\n" + "For an overview of the available settings, see https://bottlerocket.dev/en/os/1.20.x/api/settings/.", }, + "nodeadmExtraOptions": { + TypeSpec: schema.TypeSpec{ + Type: "array", + Items: &schema.TypeSpec{Ref: "#/types/eks:index:NodeadmOptions"}, + }, + Description: "Extra nodeadm configuration sections to be added to the nodeadm user data. " + + "This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. " + + "When configuring additional nodeadm NodeConfig sections, they'll be merged with the base " + + "settings the provider sets. You can overwrite base settings or provide additional settings this way.\n" + + "The base settings the provider sets are:\n" + + " - cluster.name\n" + + " - cluster.apiServerEndpoint\n" + + " - cluster.certificateAuthority\n" + + " - cluster.cidr\n\n" + + "Note: This is only applicable when using AL2023.\n" + + "See for more details:\n" + + " - https://awslabs.github.io/amazon-eks-ami/nodeadm/\n" + + " - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/", + }, } if cluster { diff --git a/provider/cmd/pulumi-resource-eks/schema.json b/provider/cmd/pulumi-resource-eks/schema.json index 04028fd26..744d58549 100644 --- a/provider/cmd/pulumi-resource-eks/schema.json +++ b/provider/cmd/pulumi-resource-eks/schema.json @@ -350,6 +350,13 @@ "type": "string", "description": "User specified code to run on node startup. This code is expected to handle the full AWS EKS bootstrapping code and signal node readiness to the managing CloudFormation stack. This code must be a complete and executable user data script in bash (Linux) or powershell (Windows).\n\nSee for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html" }, + "nodeadmExtraOptions": { + "type": "array", + "items": { + "$ref": "#/types/eks:index:NodeadmOptions" + }, + "description": "Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way.\nThe base settings the provider sets are:\n - cluster.name\n - cluster.apiServerEndpoint\n - cluster.certificateAuthority\n - cluster.cidr\n\nNote: This is only applicable when using AL2023.\nSee for more details:\n - https://awslabs.github.io/amazon-eks-ami/nodeadm/\n - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/" + }, "operatingSystem": { "$ref": "#/types/eks:index:OperatingSystem", "description": "The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration.\nValid values are `AL2`, `AL2023` and `Bottlerocket`.\n\nDefaults to `AL2`." @@ -583,6 +590,24 @@ "autoScalingGroupName" ] }, + "eks:index:NodeadmOptions": { + "description": "MIME document parts for nodeadm configuration. This can be shell scripts, nodeadm configuration or any other user data compatible script.\n\nSee for more details: https://awslabs.github.io/amazon-eks-ami/nodeadm/.", + "properties": { + "content": { + "type": "string", + "description": "The ARN of the access policy to associate with the principal" + }, + "contentType": { + "type": "string", + "description": "The MIME type of the content. Examples are `text/x-shellscript; charset=\"us-ascii\"` for shell scripts, and `application/node.eks.aws` nodeadm configuration." + } + }, + "type": "object", + "required": [ + "content", + "contentType" + ] + }, "eks:index:OperatingSystem": { "description": "The type of EKS optimized Operating System to use for node groups.\n\nSee for more details:\nhttps://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-amis.html", "type": "string", @@ -1357,6 +1382,13 @@ "type": "string", "description": "Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group.\n\nNote, `nodeRoleArn` and `nodeRole` are mutually exclusive, and a single option must be used." }, + "nodeadmExtraOptions": { + "type": "array", + "items": { + "$ref": "#/types/eks:index:NodeadmOptions" + }, + "description": "Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way.\nThe base settings the provider sets are:\n - cluster.name\n - cluster.apiServerEndpoint\n - cluster.certificateAuthority\n - cluster.cidr\n\nNote: This is only applicable when using AL2023.\nSee for more details:\n - https://awslabs.github.io/amazon-eks-ami/nodeadm/\n - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/" + }, "operatingSystem": { "$ref": "#/types/eks:index:OperatingSystem", "description": "The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration.\nValid values are `AL2`, `AL2023` and `Bottlerocket`.\n\nDefaults to `AL2`." @@ -1596,6 +1628,13 @@ "type": "string", "description": "User specified code to run on node startup. This code is expected to handle the full AWS EKS bootstrapping code and signal node readiness to the managing CloudFormation stack. This code must be a complete and executable user data script in bash (Linux) or powershell (Windows).\n\nSee for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html" }, + "nodeadmExtraOptions": { + "type": "array", + "items": { + "$ref": "#/types/eks:index:NodeadmOptions" + }, + "description": "Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way.\nThe base settings the provider sets are:\n - cluster.name\n - cluster.apiServerEndpoint\n - cluster.certificateAuthority\n - cluster.cidr\n\nNote: This is only applicable when using AL2023.\nSee for more details:\n - https://awslabs.github.io/amazon-eks-ami/nodeadm/\n - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/" + }, "operatingSystem": { "$ref": "#/types/eks:index:OperatingSystem", "description": "The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration.\nValid values are `AL2`, `AL2023` and `Bottlerocket`.\n\nDefaults to `AL2`." @@ -1862,6 +1901,13 @@ "type": "string", "description": "User specified code to run on node startup. This code is expected to handle the full AWS EKS bootstrapping code and signal node readiness to the managing CloudFormation stack. This code must be a complete and executable user data script in bash (Linux) or powershell (Windows).\n\nSee for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html" }, + "nodeadmExtraOptions": { + "type": "array", + "items": { + "$ref": "#/types/eks:index:NodeadmOptions" + }, + "description": "Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way.\nThe base settings the provider sets are:\n - cluster.name\n - cluster.apiServerEndpoint\n - cluster.certificateAuthority\n - cluster.cidr\n\nNote: This is only applicable when using AL2023.\nSee for more details:\n - https://awslabs.github.io/amazon-eks-ami/nodeadm/\n - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/" + }, "operatingSystem": { "$ref": "#/types/eks:index:OperatingSystem", "description": "The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration.\nValid values are `AL2`, `AL2023` and `Bottlerocket`.\n\nDefaults to `AL2`." diff --git a/sdk/dotnet/Inputs/ClusterNodeGroupOptionsArgs.cs b/sdk/dotnet/Inputs/ClusterNodeGroupOptionsArgs.cs index 18f81985f..f8aa6ee75 100644 --- a/sdk/dotnet/Inputs/ClusterNodeGroupOptionsArgs.cs +++ b/sdk/dotnet/Inputs/ClusterNodeGroupOptionsArgs.cs @@ -292,6 +292,28 @@ public InputList NodeSubnetIds [Input("nodeUserDataOverride")] public Input? NodeUserDataOverride { get; set; } + [Input("nodeadmExtraOptions")] + private InputList? _nodeadmExtraOptions; + + /// + /// Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + /// The base settings the provider sets are: + /// - cluster.name + /// - cluster.apiServerEndpoint + /// - cluster.certificateAuthority + /// - cluster.cidr + /// + /// Note: This is only applicable when using AL2023. + /// See for more details: + /// - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + /// - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + /// + public InputList NodeadmExtraOptions + { + get => _nodeadmExtraOptions ?? (_nodeadmExtraOptions = new InputList()); + set => _nodeadmExtraOptions = value; + } + /// /// The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. /// Valid values are `AL2`, `AL2023` and `Bottlerocket`. diff --git a/sdk/dotnet/Inputs/NodeadmOptionsArgs.cs b/sdk/dotnet/Inputs/NodeadmOptionsArgs.cs new file mode 100644 index 000000000..bd2fc2df3 --- /dev/null +++ b/sdk/dotnet/Inputs/NodeadmOptionsArgs.cs @@ -0,0 +1,37 @@ +// *** WARNING: this file was generated by pulumi-gen-eks. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Eks.Inputs +{ + + /// + /// MIME document parts for nodeadm configuration. This can be shell scripts, nodeadm configuration or any other user data compatible script. + /// + /// See for more details: https://awslabs.github.io/amazon-eks-ami/nodeadm/. + /// + public sealed class NodeadmOptionsArgs : global::Pulumi.ResourceArgs + { + /// + /// The ARN of the access policy to associate with the principal + /// + [Input("content", required: true)] + public Input Content { get; set; } = null!; + + /// + /// The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + /// + [Input("contentType", required: true)] + public Input ContentType { get; set; } = null!; + + public NodeadmOptionsArgs() + { + } + public static new NodeadmOptionsArgs Empty => new NodeadmOptionsArgs(); + } +} diff --git a/sdk/dotnet/ManagedNodeGroup.cs b/sdk/dotnet/ManagedNodeGroup.cs index 0fdd5373a..5962c064c 100644 --- a/sdk/dotnet/ManagedNodeGroup.cs +++ b/sdk/dotnet/ManagedNodeGroup.cs @@ -218,6 +218,28 @@ public InputMap Labels [Input("nodeRoleArn")] public Input? NodeRoleArn { get; set; } + [Input("nodeadmExtraOptions")] + private InputList? _nodeadmExtraOptions; + + /// + /// Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + /// The base settings the provider sets are: + /// - cluster.name + /// - cluster.apiServerEndpoint + /// - cluster.certificateAuthority + /// - cluster.cidr + /// + /// Note: This is only applicable when using AL2023. + /// See for more details: + /// - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + /// - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + /// + public InputList NodeadmExtraOptions + { + get => _nodeadmExtraOptions ?? (_nodeadmExtraOptions = new InputList()); + set => _nodeadmExtraOptions = value; + } + /// /// The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. /// Valid values are `AL2`, `AL2023` and `Bottlerocket`. diff --git a/sdk/dotnet/NodeGroup.cs b/sdk/dotnet/NodeGroup.cs index 868b62571..e89cc4f40 100644 --- a/sdk/dotnet/NodeGroup.cs +++ b/sdk/dotnet/NodeGroup.cs @@ -350,6 +350,28 @@ public InputList NodeSubnetIds [Input("nodeUserDataOverride")] public Input? NodeUserDataOverride { get; set; } + [Input("nodeadmExtraOptions")] + private InputList? _nodeadmExtraOptions; + + /// + /// Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + /// The base settings the provider sets are: + /// - cluster.name + /// - cluster.apiServerEndpoint + /// - cluster.certificateAuthority + /// - cluster.cidr + /// + /// Note: This is only applicable when using AL2023. + /// See for more details: + /// - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + /// - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + /// + public InputList NodeadmExtraOptions + { + get => _nodeadmExtraOptions ?? (_nodeadmExtraOptions = new InputList()); + set => _nodeadmExtraOptions = value; + } + /// /// The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. /// Valid values are `AL2`, `AL2023` and `Bottlerocket`. diff --git a/sdk/dotnet/NodeGroupV2.cs b/sdk/dotnet/NodeGroupV2.cs index 7e1f7513f..632953fc2 100644 --- a/sdk/dotnet/NodeGroupV2.cs +++ b/sdk/dotnet/NodeGroupV2.cs @@ -362,6 +362,28 @@ public InputList NodeSubnetIds [Input("nodeUserDataOverride")] public Input? NodeUserDataOverride { get; set; } + [Input("nodeadmExtraOptions")] + private InputList? _nodeadmExtraOptions; + + /// + /// Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + /// The base settings the provider sets are: + /// - cluster.name + /// - cluster.apiServerEndpoint + /// - cluster.certificateAuthority + /// - cluster.cidr + /// + /// Note: This is only applicable when using AL2023. + /// See for more details: + /// - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + /// - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + /// + public InputList NodeadmExtraOptions + { + get => _nodeadmExtraOptions ?? (_nodeadmExtraOptions = new InputList()); + set => _nodeadmExtraOptions = value; + } + /// /// The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. /// Valid values are `AL2`, `AL2023` and `Bottlerocket`. diff --git a/sdk/dotnet/Outputs/ClusterNodeGroupOptions.cs b/sdk/dotnet/Outputs/ClusterNodeGroupOptions.cs index dbacf34a8..0571b33fd 100644 --- a/sdk/dotnet/Outputs/ClusterNodeGroupOptions.cs +++ b/sdk/dotnet/Outputs/ClusterNodeGroupOptions.cs @@ -196,6 +196,20 @@ public sealed class ClusterNodeGroupOptions /// public readonly string? NodeUserDataOverride; /// + /// Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + /// The base settings the provider sets are: + /// - cluster.name + /// - cluster.apiServerEndpoint + /// - cluster.certificateAuthority + /// - cluster.cidr + /// + /// Note: This is only applicable when using AL2023. + /// See for more details: + /// - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + /// - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + /// + public readonly ImmutableArray NodeadmExtraOptions; + /// /// The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. /// Valid values are `AL2`, `AL2023` and `Bottlerocket`. /// @@ -279,6 +293,8 @@ private ClusterNodeGroupOptions( string? nodeUserDataOverride, + ImmutableArray nodeadmExtraOptions, + Pulumi.Eks.OperatingSystem? operatingSystem, string? spotPrice, @@ -318,6 +334,7 @@ private ClusterNodeGroupOptions( NodeSubnetIds = nodeSubnetIds; NodeUserData = nodeUserData; NodeUserDataOverride = nodeUserDataOverride; + NodeadmExtraOptions = nodeadmExtraOptions; OperatingSystem = operatingSystem; SpotPrice = spotPrice; Taints = taints; diff --git a/sdk/dotnet/Outputs/NodeadmOptions.cs b/sdk/dotnet/Outputs/NodeadmOptions.cs new file mode 100644 index 000000000..3b01ec15e --- /dev/null +++ b/sdk/dotnet/Outputs/NodeadmOptions.cs @@ -0,0 +1,40 @@ +// *** WARNING: this file was generated by pulumi-gen-eks. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Eks.Outputs +{ + + /// + /// MIME document parts for nodeadm configuration. This can be shell scripts, nodeadm configuration or any other user data compatible script. + /// + /// See for more details: https://awslabs.github.io/amazon-eks-ami/nodeadm/. + /// + [OutputType] + public sealed class NodeadmOptions + { + /// + /// The ARN of the access policy to associate with the principal + /// + public readonly string Content; + /// + /// The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + /// + public readonly string ContentType; + + [OutputConstructor] + private NodeadmOptions( + string content, + + string contentType) + { + Content = content; + ContentType = contentType; + } + } +} diff --git a/sdk/go/eks/managedNodeGroup.go b/sdk/go/eks/managedNodeGroup.go index 9604b9ea7..8ef8c54c0 100644 --- a/sdk/go/eks/managedNodeGroup.go +++ b/sdk/go/eks/managedNodeGroup.go @@ -117,6 +117,18 @@ type managedNodeGroupArgs struct { // // Note, `nodeRoleArn` and `nodeRole` are mutually exclusive, and a single option must be used. NodeRoleArn *string `pulumi:"nodeRoleArn"` + // Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + // The base settings the provider sets are: + // - cluster.name + // - cluster.apiServerEndpoint + // - cluster.certificateAuthority + // - cluster.cidr + // + // Note: This is only applicable when using AL2023. + // See for more details: + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + NodeadmExtraOptions []NodeadmOptions `pulumi:"nodeadmExtraOptions"` // The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. // Valid values are `AL2`, `AL2023` and `Bottlerocket`. // @@ -227,6 +239,18 @@ type ManagedNodeGroupArgs struct { // // Note, `nodeRoleArn` and `nodeRole` are mutually exclusive, and a single option must be used. NodeRoleArn pulumi.StringPtrInput + // Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + // The base settings the provider sets are: + // - cluster.name + // - cluster.apiServerEndpoint + // - cluster.certificateAuthority + // - cluster.cidr + // + // Note: This is only applicable when using AL2023. + // See for more details: + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + NodeadmExtraOptions NodeadmOptionsArrayInput // The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. // Valid values are `AL2`, `AL2023` and `Bottlerocket`. // diff --git a/sdk/go/eks/nodeGroup.go b/sdk/go/eks/nodeGroup.go index 9d3e45613..9195b91bc 100644 --- a/sdk/go/eks/nodeGroup.go +++ b/sdk/go/eks/nodeGroup.go @@ -168,6 +168,18 @@ type nodeGroupArgs struct { // // See for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html NodeUserDataOverride *string `pulumi:"nodeUserDataOverride"` + // Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + // The base settings the provider sets are: + // - cluster.name + // - cluster.apiServerEndpoint + // - cluster.certificateAuthority + // - cluster.cidr + // + // Note: This is only applicable when using AL2023. + // See for more details: + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + NodeadmExtraOptions []NodeadmOptions `pulumi:"nodeadmExtraOptions"` // The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. // Valid values are `AL2`, `AL2023` and `Bottlerocket`. // @@ -302,6 +314,18 @@ type NodeGroupArgs struct { // // See for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html NodeUserDataOverride pulumi.StringPtrInput + // Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + // The base settings the provider sets are: + // - cluster.name + // - cluster.apiServerEndpoint + // - cluster.certificateAuthority + // - cluster.cidr + // + // Note: This is only applicable when using AL2023. + // See for more details: + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + NodeadmExtraOptions NodeadmOptionsArrayInput // The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. // Valid values are `AL2`, `AL2023` and `Bottlerocket`. // diff --git a/sdk/go/eks/nodeGroupV2.go b/sdk/go/eks/nodeGroupV2.go index 633042fb4..889449da6 100644 --- a/sdk/go/eks/nodeGroupV2.go +++ b/sdk/go/eks/nodeGroupV2.go @@ -170,6 +170,18 @@ type nodeGroupV2Args struct { // // See for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html NodeUserDataOverride *string `pulumi:"nodeUserDataOverride"` + // Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + // The base settings the provider sets are: + // - cluster.name + // - cluster.apiServerEndpoint + // - cluster.certificateAuthority + // - cluster.cidr + // + // Note: This is only applicable when using AL2023. + // See for more details: + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + NodeadmExtraOptions []NodeadmOptions `pulumi:"nodeadmExtraOptions"` // The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. // Valid values are `AL2`, `AL2023` and `Bottlerocket`. // @@ -308,6 +320,18 @@ type NodeGroupV2Args struct { // // See for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html NodeUserDataOverride pulumi.StringPtrInput + // Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + // The base settings the provider sets are: + // - cluster.name + // - cluster.apiServerEndpoint + // - cluster.certificateAuthority + // - cluster.cidr + // + // Note: This is only applicable when using AL2023. + // See for more details: + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + NodeadmExtraOptions NodeadmOptionsArrayInput // The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. // Valid values are `AL2`, `AL2023` and `Bottlerocket`. // diff --git a/sdk/go/eks/pulumiTypes.go b/sdk/go/eks/pulumiTypes.go index b67a4d5df..735761fd1 100644 --- a/sdk/go/eks/pulumiTypes.go +++ b/sdk/go/eks/pulumiTypes.go @@ -416,6 +416,18 @@ type ClusterNodeGroupOptions struct { // // See for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html NodeUserDataOverride *string `pulumi:"nodeUserDataOverride"` + // Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + // The base settings the provider sets are: + // - cluster.name + // - cluster.apiServerEndpoint + // - cluster.certificateAuthority + // - cluster.cidr + // + // Note: This is only applicable when using AL2023. + // See for more details: + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + NodeadmExtraOptions []NodeadmOptions `pulumi:"nodeadmExtraOptions"` // The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. // Valid values are `AL2`, `AL2023` and `Bottlerocket`. // @@ -559,6 +571,18 @@ type ClusterNodeGroupOptionsArgs struct { // // See for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html NodeUserDataOverride pulumi.StringPtrInput `pulumi:"nodeUserDataOverride"` + // Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + // The base settings the provider sets are: + // - cluster.name + // - cluster.apiServerEndpoint + // - cluster.certificateAuthority + // - cluster.cidr + // + // Note: This is only applicable when using AL2023. + // See for more details: + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + // - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + NodeadmExtraOptions NodeadmOptionsArrayInput `pulumi:"nodeadmExtraOptions"` // The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. // Valid values are `AL2`, `AL2023` and `Bottlerocket`. // @@ -860,6 +884,21 @@ func (o ClusterNodeGroupOptionsOutput) NodeUserDataOverride() pulumi.StringPtrOu return o.ApplyT(func(v ClusterNodeGroupOptions) *string { return v.NodeUserDataOverride }).(pulumi.StringPtrOutput) } +// Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. +// The base settings the provider sets are: +// - cluster.name +// - cluster.apiServerEndpoint +// - cluster.certificateAuthority +// - cluster.cidr +// +// Note: This is only applicable when using AL2023. +// See for more details: +// - https://awslabs.github.io/amazon-eks-ami/nodeadm/ +// - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ +func (o ClusterNodeGroupOptionsOutput) NodeadmExtraOptions() NodeadmOptionsArrayOutput { + return o.ApplyT(func(v ClusterNodeGroupOptions) []NodeadmOptions { return v.NodeadmExtraOptions }).(NodeadmOptionsArrayOutput) +} + // The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. // Valid values are `AL2`, `AL2023` and `Bottlerocket`. // @@ -1272,6 +1311,26 @@ func (o ClusterNodeGroupOptionsPtrOutput) NodeUserDataOverride() pulumi.StringPt }).(pulumi.StringPtrOutput) } +// Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. +// The base settings the provider sets are: +// - cluster.name +// - cluster.apiServerEndpoint +// - cluster.certificateAuthority +// - cluster.cidr +// +// Note: This is only applicable when using AL2023. +// See for more details: +// - https://awslabs.github.io/amazon-eks-ami/nodeadm/ +// - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ +func (o ClusterNodeGroupOptionsPtrOutput) NodeadmExtraOptions() NodeadmOptionsArrayOutput { + return o.ApplyT(func(v *ClusterNodeGroupOptions) []NodeadmOptions { + if v == nil { + return nil + } + return v.NodeadmExtraOptions + }).(NodeadmOptionsArrayOutput) +} + // The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. // Valid values are `AL2`, `AL2023` and `Bottlerocket`. // @@ -2204,6 +2263,121 @@ func (o NodeGroupDataPtrOutput) NodeSecurityGroup() ec2.SecurityGroupOutput { }).(ec2.SecurityGroupOutput) } +// MIME document parts for nodeadm configuration. This can be shell scripts, nodeadm configuration or any other user data compatible script. +// +// See for more details: https://awslabs.github.io/amazon-eks-ami/nodeadm/. +type NodeadmOptions struct { + // The ARN of the access policy to associate with the principal + Content string `pulumi:"content"` + // The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + ContentType string `pulumi:"contentType"` +} + +// NodeadmOptionsInput is an input type that accepts NodeadmOptionsArgs and NodeadmOptionsOutput values. +// You can construct a concrete instance of `NodeadmOptionsInput` via: +// +// NodeadmOptionsArgs{...} +type NodeadmOptionsInput interface { + pulumi.Input + + ToNodeadmOptionsOutput() NodeadmOptionsOutput + ToNodeadmOptionsOutputWithContext(context.Context) NodeadmOptionsOutput +} + +// MIME document parts for nodeadm configuration. This can be shell scripts, nodeadm configuration or any other user data compatible script. +// +// See for more details: https://awslabs.github.io/amazon-eks-ami/nodeadm/. +type NodeadmOptionsArgs struct { + // The ARN of the access policy to associate with the principal + Content pulumi.StringInput `pulumi:"content"` + // The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + ContentType pulumi.StringInput `pulumi:"contentType"` +} + +func (NodeadmOptionsArgs) ElementType() reflect.Type { + return reflect.TypeOf((*NodeadmOptions)(nil)).Elem() +} + +func (i NodeadmOptionsArgs) ToNodeadmOptionsOutput() NodeadmOptionsOutput { + return i.ToNodeadmOptionsOutputWithContext(context.Background()) +} + +func (i NodeadmOptionsArgs) ToNodeadmOptionsOutputWithContext(ctx context.Context) NodeadmOptionsOutput { + return pulumi.ToOutputWithContext(ctx, i).(NodeadmOptionsOutput) +} + +// NodeadmOptionsArrayInput is an input type that accepts NodeadmOptionsArray and NodeadmOptionsArrayOutput values. +// You can construct a concrete instance of `NodeadmOptionsArrayInput` via: +// +// NodeadmOptionsArray{ NodeadmOptionsArgs{...} } +type NodeadmOptionsArrayInput interface { + pulumi.Input + + ToNodeadmOptionsArrayOutput() NodeadmOptionsArrayOutput + ToNodeadmOptionsArrayOutputWithContext(context.Context) NodeadmOptionsArrayOutput +} + +type NodeadmOptionsArray []NodeadmOptionsInput + +func (NodeadmOptionsArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]NodeadmOptions)(nil)).Elem() +} + +func (i NodeadmOptionsArray) ToNodeadmOptionsArrayOutput() NodeadmOptionsArrayOutput { + return i.ToNodeadmOptionsArrayOutputWithContext(context.Background()) +} + +func (i NodeadmOptionsArray) ToNodeadmOptionsArrayOutputWithContext(ctx context.Context) NodeadmOptionsArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(NodeadmOptionsArrayOutput) +} + +// MIME document parts for nodeadm configuration. This can be shell scripts, nodeadm configuration or any other user data compatible script. +// +// See for more details: https://awslabs.github.io/amazon-eks-ami/nodeadm/. +type NodeadmOptionsOutput struct{ *pulumi.OutputState } + +func (NodeadmOptionsOutput) ElementType() reflect.Type { + return reflect.TypeOf((*NodeadmOptions)(nil)).Elem() +} + +func (o NodeadmOptionsOutput) ToNodeadmOptionsOutput() NodeadmOptionsOutput { + return o +} + +func (o NodeadmOptionsOutput) ToNodeadmOptionsOutputWithContext(ctx context.Context) NodeadmOptionsOutput { + return o +} + +// The ARN of the access policy to associate with the principal +func (o NodeadmOptionsOutput) Content() pulumi.StringOutput { + return o.ApplyT(func(v NodeadmOptions) string { return v.Content }).(pulumi.StringOutput) +} + +// The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. +func (o NodeadmOptionsOutput) ContentType() pulumi.StringOutput { + return o.ApplyT(func(v NodeadmOptions) string { return v.ContentType }).(pulumi.StringOutput) +} + +type NodeadmOptionsArrayOutput struct{ *pulumi.OutputState } + +func (NodeadmOptionsArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]NodeadmOptions)(nil)).Elem() +} + +func (o NodeadmOptionsArrayOutput) ToNodeadmOptionsArrayOutput() NodeadmOptionsArrayOutput { + return o +} + +func (o NodeadmOptionsArrayOutput) ToNodeadmOptionsArrayOutputWithContext(ctx context.Context) NodeadmOptionsArrayOutput { + return o +} + +func (o NodeadmOptionsArrayOutput) Index(i pulumi.IntInput) NodeadmOptionsOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) NodeadmOptions { + return vs[0].([]NodeadmOptions)[vs[1].(int)] + }).(NodeadmOptionsOutput) +} + // Describes a mapping from an AWS IAM role to a Kubernetes user and groups. type RoleMapping struct { // A list of groups within Kubernetes to which the role is mapped. @@ -3416,6 +3590,8 @@ func init() { pulumi.RegisterInputType(reflect.TypeOf((*FargateProfilePtrInput)(nil)).Elem(), FargateProfileArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*KubeconfigOptionsInput)(nil)).Elem(), KubeconfigOptionsArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*KubeconfigOptionsPtrInput)(nil)).Elem(), KubeconfigOptionsArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*NodeadmOptionsInput)(nil)).Elem(), NodeadmOptionsArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*NodeadmOptionsArrayInput)(nil)).Elem(), NodeadmOptionsArray{}) pulumi.RegisterInputType(reflect.TypeOf((*RoleMappingInput)(nil)).Elem(), RoleMappingArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*RoleMappingArrayInput)(nil)).Elem(), RoleMappingArray{}) pulumi.RegisterInputType(reflect.TypeOf((*StorageClassInput)(nil)).Elem(), StorageClassArgs{}) @@ -3441,6 +3617,8 @@ func init() { pulumi.RegisterOutputType(KubeconfigOptionsPtrOutput{}) pulumi.RegisterOutputType(NodeGroupDataOutput{}) pulumi.RegisterOutputType(NodeGroupDataPtrOutput{}) + pulumi.RegisterOutputType(NodeadmOptionsOutput{}) + pulumi.RegisterOutputType(NodeadmOptionsArrayOutput{}) pulumi.RegisterOutputType(RoleMappingOutput{}) pulumi.RegisterOutputType(RoleMappingArrayOutput{}) pulumi.RegisterOutputType(StorageClassOutput{}) diff --git a/sdk/java/src/main/java/com/pulumi/eks/ManagedNodeGroupArgs.java b/sdk/java/src/main/java/com/pulumi/eks/ManagedNodeGroupArgs.java index 1f876f307..5b19359c7 100644 --- a/sdk/java/src/main/java/com/pulumi/eks/ManagedNodeGroupArgs.java +++ b/sdk/java/src/main/java/com/pulumi/eks/ManagedNodeGroupArgs.java @@ -14,6 +14,7 @@ import com.pulumi.eks.Cluster; import com.pulumi.eks.enums.OperatingSystem; import com.pulumi.eks.inputs.CoreDataArgs; +import com.pulumi.eks.inputs.NodeadmOptionsArgs; import java.lang.Boolean; import java.lang.Integer; import java.lang.Object; @@ -382,6 +383,41 @@ public Optional> nodeRoleArn() { return Optional.ofNullable(this.nodeRoleArn); } + /** + * Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + */ + @Import(name="nodeadmExtraOptions") + private @Nullable Output> nodeadmExtraOptions; + + /** + * @return Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + */ + public Optional>> nodeadmExtraOptions() { + return Optional.ofNullable(this.nodeadmExtraOptions); + } + /** * The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. * Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -565,6 +601,7 @@ private ManagedNodeGroupArgs(ManagedNodeGroupArgs $) { this.nodeGroupNamePrefix = $.nodeGroupNamePrefix; this.nodeRole = $.nodeRole; this.nodeRoleArn = $.nodeRoleArn; + this.nodeadmExtraOptions = $.nodeadmExtraOptions; this.operatingSystem = $.operatingSystem; this.releaseVersion = $.releaseVersion; this.remoteAccess = $.remoteAccess; @@ -1055,6 +1092,67 @@ public Builder nodeRoleArn(String nodeRoleArn) { return nodeRoleArn(Output.of(nodeRoleArn)); } + /** + * @param nodeadmExtraOptions Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + * @return builder + * + */ + public Builder nodeadmExtraOptions(@Nullable Output> nodeadmExtraOptions) { + $.nodeadmExtraOptions = nodeadmExtraOptions; + return this; + } + + /** + * @param nodeadmExtraOptions Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + * @return builder + * + */ + public Builder nodeadmExtraOptions(List nodeadmExtraOptions) { + return nodeadmExtraOptions(Output.of(nodeadmExtraOptions)); + } + + /** + * @param nodeadmExtraOptions Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + * @return builder + * + */ + public Builder nodeadmExtraOptions(NodeadmOptionsArgs... nodeadmExtraOptions) { + return nodeadmExtraOptions(List.of(nodeadmExtraOptions)); + } + /** * @param operatingSystem The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. * Valid values are `AL2`, `AL2023` and `Bottlerocket`. diff --git a/sdk/java/src/main/java/com/pulumi/eks/NodeGroupArgs.java b/sdk/java/src/main/java/com/pulumi/eks/NodeGroupArgs.java index 21d0ff8af..72a4c71c5 100644 --- a/sdk/java/src/main/java/com/pulumi/eks/NodeGroupArgs.java +++ b/sdk/java/src/main/java/com/pulumi/eks/NodeGroupArgs.java @@ -12,6 +12,7 @@ import com.pulumi.eks.Cluster; import com.pulumi.eks.enums.OperatingSystem; import com.pulumi.eks.inputs.CoreDataArgs; +import com.pulumi.eks.inputs.NodeadmOptionsArgs; import com.pulumi.eks.inputs.TaintArgs; import java.lang.Boolean; import java.lang.Integer; @@ -618,6 +619,41 @@ public Optional> nodeUserDataOverride() { return Optional.ofNullable(this.nodeUserDataOverride); } + /** + * Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + */ + @Import(name="nodeadmExtraOptions") + private @Nullable Output> nodeadmExtraOptions; + + /** + * @return Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + */ + public Optional>> nodeadmExtraOptions() { + return Optional.ofNullable(this.nodeadmExtraOptions); + } + /** * The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. * Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -719,6 +755,7 @@ private NodeGroupArgs(NodeGroupArgs $) { this.nodeSubnetIds = $.nodeSubnetIds; this.nodeUserData = $.nodeUserData; this.nodeUserDataOverride = $.nodeUserDataOverride; + this.nodeadmExtraOptions = $.nodeadmExtraOptions; this.operatingSystem = $.operatingSystem; this.spotPrice = $.spotPrice; this.taints = $.taints; @@ -1519,6 +1556,67 @@ public Builder nodeUserDataOverride(String nodeUserDataOverride) { return nodeUserDataOverride(Output.of(nodeUserDataOverride)); } + /** + * @param nodeadmExtraOptions Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + * @return builder + * + */ + public Builder nodeadmExtraOptions(@Nullable Output> nodeadmExtraOptions) { + $.nodeadmExtraOptions = nodeadmExtraOptions; + return this; + } + + /** + * @param nodeadmExtraOptions Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + * @return builder + * + */ + public Builder nodeadmExtraOptions(List nodeadmExtraOptions) { + return nodeadmExtraOptions(Output.of(nodeadmExtraOptions)); + } + + /** + * @param nodeadmExtraOptions Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + * @return builder + * + */ + public Builder nodeadmExtraOptions(NodeadmOptionsArgs... nodeadmExtraOptions) { + return nodeadmExtraOptions(List.of(nodeadmExtraOptions)); + } + /** * @param operatingSystem The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. * Valid values are `AL2`, `AL2023` and `Bottlerocket`. diff --git a/sdk/java/src/main/java/com/pulumi/eks/NodeGroupV2Args.java b/sdk/java/src/main/java/com/pulumi/eks/NodeGroupV2Args.java index f354f6892..90b85ec79 100644 --- a/sdk/java/src/main/java/com/pulumi/eks/NodeGroupV2Args.java +++ b/sdk/java/src/main/java/com/pulumi/eks/NodeGroupV2Args.java @@ -13,6 +13,7 @@ import com.pulumi.eks.Cluster; import com.pulumi.eks.enums.OperatingSystem; import com.pulumi.eks.inputs.CoreDataArgs; +import com.pulumi.eks.inputs.NodeadmOptionsArgs; import com.pulumi.eks.inputs.TaintArgs; import java.lang.Boolean; import java.lang.Integer; @@ -649,6 +650,41 @@ public Optional> nodeUserDataOverride() { return Optional.ofNullable(this.nodeUserDataOverride); } + /** + * Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + */ + @Import(name="nodeadmExtraOptions") + private @Nullable Output> nodeadmExtraOptions; + + /** + * @return Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + */ + public Optional>> nodeadmExtraOptions() { + return Optional.ofNullable(this.nodeadmExtraOptions); + } + /** * The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. * Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -752,6 +788,7 @@ private NodeGroupV2Args(NodeGroupV2Args $) { this.nodeSubnetIds = $.nodeSubnetIds; this.nodeUserData = $.nodeUserData; this.nodeUserDataOverride = $.nodeUserDataOverride; + this.nodeadmExtraOptions = $.nodeadmExtraOptions; this.operatingSystem = $.operatingSystem; this.spotPrice = $.spotPrice; this.taints = $.taints; @@ -1604,6 +1641,67 @@ public Builder nodeUserDataOverride(String nodeUserDataOverride) { return nodeUserDataOverride(Output.of(nodeUserDataOverride)); } + /** + * @param nodeadmExtraOptions Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + * @return builder + * + */ + public Builder nodeadmExtraOptions(@Nullable Output> nodeadmExtraOptions) { + $.nodeadmExtraOptions = nodeadmExtraOptions; + return this; + } + + /** + * @param nodeadmExtraOptions Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + * @return builder + * + */ + public Builder nodeadmExtraOptions(List nodeadmExtraOptions) { + return nodeadmExtraOptions(Output.of(nodeadmExtraOptions)); + } + + /** + * @param nodeadmExtraOptions Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + * @return builder + * + */ + public Builder nodeadmExtraOptions(NodeadmOptionsArgs... nodeadmExtraOptions) { + return nodeadmExtraOptions(List.of(nodeadmExtraOptions)); + } + /** * @param operatingSystem The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. * Valid values are `AL2`, `AL2023` and `Bottlerocket`. diff --git a/sdk/java/src/main/java/com/pulumi/eks/inputs/ClusterNodeGroupOptionsArgs.java b/sdk/java/src/main/java/com/pulumi/eks/inputs/ClusterNodeGroupOptionsArgs.java index b912ea1de..b3e9ee8ed 100644 --- a/sdk/java/src/main/java/com/pulumi/eks/inputs/ClusterNodeGroupOptionsArgs.java +++ b/sdk/java/src/main/java/com/pulumi/eks/inputs/ClusterNodeGroupOptionsArgs.java @@ -9,6 +9,7 @@ import com.pulumi.core.Output; import com.pulumi.core.annotations.Import; import com.pulumi.eks.enums.OperatingSystem; +import com.pulumi.eks.inputs.NodeadmOptionsArgs; import com.pulumi.eks.inputs.TaintArgs; import java.lang.Boolean; import java.lang.Integer; @@ -604,6 +605,41 @@ public Optional> nodeUserDataOverride() { return Optional.ofNullable(this.nodeUserDataOverride); } + /** + * Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + */ + @Import(name="nodeadmExtraOptions") + private @Nullable Output> nodeadmExtraOptions; + + /** + * @return Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + */ + public Optional>> nodeadmExtraOptions() { + return Optional.ofNullable(this.nodeadmExtraOptions); + } + /** * The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. * Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -704,6 +740,7 @@ private ClusterNodeGroupOptionsArgs(ClusterNodeGroupOptionsArgs $) { this.nodeSubnetIds = $.nodeSubnetIds; this.nodeUserData = $.nodeUserData; this.nodeUserDataOverride = $.nodeUserDataOverride; + this.nodeadmExtraOptions = $.nodeadmExtraOptions; this.operatingSystem = $.operatingSystem; this.spotPrice = $.spotPrice; this.taints = $.taints; @@ -1463,6 +1500,67 @@ public Builder nodeUserDataOverride(String nodeUserDataOverride) { return nodeUserDataOverride(Output.of(nodeUserDataOverride)); } + /** + * @param nodeadmExtraOptions Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + * @return builder + * + */ + public Builder nodeadmExtraOptions(@Nullable Output> nodeadmExtraOptions) { + $.nodeadmExtraOptions = nodeadmExtraOptions; + return this; + } + + /** + * @param nodeadmExtraOptions Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + * @return builder + * + */ + public Builder nodeadmExtraOptions(List nodeadmExtraOptions) { + return nodeadmExtraOptions(Output.of(nodeadmExtraOptions)); + } + + /** + * @param nodeadmExtraOptions Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + * @return builder + * + */ + public Builder nodeadmExtraOptions(NodeadmOptionsArgs... nodeadmExtraOptions) { + return nodeadmExtraOptions(List.of(nodeadmExtraOptions)); + } + /** * @param operatingSystem The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. * Valid values are `AL2`, `AL2023` and `Bottlerocket`. diff --git a/sdk/java/src/main/java/com/pulumi/eks/inputs/NodeadmOptionsArgs.java b/sdk/java/src/main/java/com/pulumi/eks/inputs/NodeadmOptionsArgs.java new file mode 100644 index 000000000..b9ade58ac --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/eks/inputs/NodeadmOptionsArgs.java @@ -0,0 +1,126 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.eks.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Objects; + + +/** + * MIME document parts for nodeadm configuration. This can be shell scripts, nodeadm configuration or any other user data compatible script. + * + * See for more details: https://awslabs.github.io/amazon-eks-ami/nodeadm/. + * + */ +public final class NodeadmOptionsArgs extends com.pulumi.resources.ResourceArgs { + + public static final NodeadmOptionsArgs Empty = new NodeadmOptionsArgs(); + + /** + * The ARN of the access policy to associate with the principal + * + */ + @Import(name="content", required=true) + private Output content; + + /** + * @return The ARN of the access policy to associate with the principal + * + */ + public Output content() { + return this.content; + } + + /** + * The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + * + */ + @Import(name="contentType", required=true) + private Output contentType; + + /** + * @return The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + * + */ + public Output contentType() { + return this.contentType; + } + + private NodeadmOptionsArgs() {} + + private NodeadmOptionsArgs(NodeadmOptionsArgs $) { + this.content = $.content; + this.contentType = $.contentType; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(NodeadmOptionsArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private NodeadmOptionsArgs $; + + public Builder() { + $ = new NodeadmOptionsArgs(); + } + + public Builder(NodeadmOptionsArgs defaults) { + $ = new NodeadmOptionsArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param content The ARN of the access policy to associate with the principal + * + * @return builder + * + */ + public Builder content(Output content) { + $.content = content; + return this; + } + + /** + * @param content The ARN of the access policy to associate with the principal + * + * @return builder + * + */ + public Builder content(String content) { + return content(Output.of(content)); + } + + /** + * @param contentType The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + * + * @return builder + * + */ + public Builder contentType(Output contentType) { + $.contentType = contentType; + return this; + } + + /** + * @param contentType The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + * + * @return builder + * + */ + public Builder contentType(String contentType) { + return contentType(Output.of(contentType)); + } + + public NodeadmOptionsArgs build() { + $.content = Objects.requireNonNull($.content, "expected parameter 'content' to be non-null"); + $.contentType = Objects.requireNonNull($.contentType, "expected parameter 'contentType' to be non-null"); + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/eks/outputs/ClusterNodeGroupOptions.java b/sdk/java/src/main/java/com/pulumi/eks/outputs/ClusterNodeGroupOptions.java index 96ce23fd3..e9c0b977c 100644 --- a/sdk/java/src/main/java/com/pulumi/eks/outputs/ClusterNodeGroupOptions.java +++ b/sdk/java/src/main/java/com/pulumi/eks/outputs/ClusterNodeGroupOptions.java @@ -8,6 +8,7 @@ import com.pulumi.aws.iam.InstanceProfile; import com.pulumi.core.annotations.CustomType; import com.pulumi.eks.enums.OperatingSystem; +import com.pulumi.eks.outputs.NodeadmOptions; import com.pulumi.eks.outputs.Taint; import java.lang.Boolean; import java.lang.Integer; @@ -231,6 +232,21 @@ public final class ClusterNodeGroupOptions { * */ private @Nullable String nodeUserDataOverride; + /** + * @return Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + */ + private @Nullable List nodeadmExtraOptions; /** * @return The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. * Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -528,6 +544,23 @@ public Optional nodeUserData() { public Optional nodeUserDataOverride() { return Optional.ofNullable(this.nodeUserDataOverride); } + /** + * @return Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + * The base settings the provider sets are: + * - cluster.name + * - cluster.apiServerEndpoint + * - cluster.certificateAuthority + * - cluster.cidr + * + * Note: This is only applicable when using AL2023. + * See for more details: + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + * - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + * + */ + public List nodeadmExtraOptions() { + return this.nodeadmExtraOptions == null ? List.of() : this.nodeadmExtraOptions; + } /** * @return The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. * Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -600,6 +633,7 @@ public static final class Builder { private @Nullable List nodeSubnetIds; private @Nullable String nodeUserData; private @Nullable String nodeUserDataOverride; + private @Nullable List nodeadmExtraOptions; private @Nullable OperatingSystem operatingSystem; private @Nullable String spotPrice; private @Nullable Map taints; @@ -638,6 +672,7 @@ public Builder(ClusterNodeGroupOptions defaults) { this.nodeSubnetIds = defaults.nodeSubnetIds; this.nodeUserData = defaults.nodeUserData; this.nodeUserDataOverride = defaults.nodeUserDataOverride; + this.nodeadmExtraOptions = defaults.nodeadmExtraOptions; this.operatingSystem = defaults.operatingSystem; this.spotPrice = defaults.spotPrice; this.taints = defaults.taints; @@ -806,6 +841,14 @@ public Builder nodeUserDataOverride(@Nullable String nodeUserDataOverride) { return this; } @CustomType.Setter + public Builder nodeadmExtraOptions(@Nullable List nodeadmExtraOptions) { + this.nodeadmExtraOptions = nodeadmExtraOptions; + return this; + } + public Builder nodeadmExtraOptions(NodeadmOptions... nodeadmExtraOptions) { + return nodeadmExtraOptions(List.of(nodeadmExtraOptions)); + } + @CustomType.Setter public Builder operatingSystem(@Nullable OperatingSystem operatingSystem) { this.operatingSystem = operatingSystem; return this; @@ -858,6 +901,7 @@ public ClusterNodeGroupOptions build() { _resultValue.nodeSubnetIds = nodeSubnetIds; _resultValue.nodeUserData = nodeUserData; _resultValue.nodeUserDataOverride = nodeUserDataOverride; + _resultValue.nodeadmExtraOptions = nodeadmExtraOptions; _resultValue.operatingSystem = operatingSystem; _resultValue.spotPrice = spotPrice; _resultValue.taints = taints; diff --git a/sdk/java/src/main/java/com/pulumi/eks/outputs/NodeadmOptions.java b/sdk/java/src/main/java/com/pulumi/eks/outputs/NodeadmOptions.java new file mode 100644 index 000000000..13a75d120 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/eks/outputs/NodeadmOptions.java @@ -0,0 +1,74 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.eks.outputs; + +import com.pulumi.core.annotations.CustomType; +import java.lang.String; +import java.util.Objects; + +@CustomType +public final class NodeadmOptions { + /** + * @return The ARN of the access policy to associate with the principal + * + */ + private String content; + /** + * @return The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + * + */ + private String contentType; + + private NodeadmOptions() {} + /** + * @return The ARN of the access policy to associate with the principal + * + */ + public String content() { + return this.content; + } + /** + * @return The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + * + */ + public String contentType() { + return this.contentType; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(NodeadmOptions defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String content; + private String contentType; + public Builder() {} + public Builder(NodeadmOptions defaults) { + Objects.requireNonNull(defaults); + this.content = defaults.content; + this.contentType = defaults.contentType; + } + + @CustomType.Setter + public Builder content(String content) { + this.content = Objects.requireNonNull(content); + return this; + } + @CustomType.Setter + public Builder contentType(String contentType) { + this.contentType = Objects.requireNonNull(contentType); + return this; + } + public NodeadmOptions build() { + final var _resultValue = new NodeadmOptions(); + _resultValue.content = content; + _resultValue.contentType = contentType; + return _resultValue; + } + } +} diff --git a/sdk/python/pulumi_eks/_inputs.py b/sdk/python/pulumi_eks/_inputs.py index 56940fd17..57a0d5239 100644 --- a/sdk/python/pulumi_eks/_inputs.py +++ b/sdk/python/pulumi_eks/_inputs.py @@ -21,6 +21,7 @@ 'CreationRoleProviderArgs', 'FargateProfileArgs', 'KubeconfigOptionsArgs', + 'NodeadmOptionsArgs', 'RoleMappingArgs', 'StorageClassArgs', 'TaintArgs', @@ -211,6 +212,7 @@ def __init__(__self__, *, node_subnet_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, node_user_data: Optional[pulumi.Input[str]] = None, node_user_data_override: Optional[pulumi.Input[str]] = None, + nodeadm_extra_options: Optional[pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]]] = None, operating_system: Optional[pulumi.Input['OperatingSystem']] = None, spot_price: Optional[pulumi.Input[str]] = None, taints: Optional[Mapping[str, 'TaintArgs']] = None, @@ -303,6 +305,17 @@ def __init__(__self__, *, :param pulumi.Input[str] node_user_data_override: User specified code to run on node startup. This code is expected to handle the full AWS EKS bootstrapping code and signal node readiness to the managing CloudFormation stack. This code must be a complete and executable user data script in bash (Linux) or powershell (Windows). See for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html + :param pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]] nodeadm_extra_options: Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ :param pulumi.Input['OperatingSystem'] operating_system: The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -373,6 +386,8 @@ def __init__(__self__, *, pulumi.set(__self__, "node_user_data", node_user_data) if node_user_data_override is not None: pulumi.set(__self__, "node_user_data_override", node_user_data_override) + if nodeadm_extra_options is not None: + pulumi.set(__self__, "nodeadm_extra_options", nodeadm_extra_options) if operating_system is not None: pulumi.set(__self__, "operating_system", operating_system) if spot_price is not None: @@ -809,6 +824,28 @@ def node_user_data_override(self) -> Optional[pulumi.Input[str]]: def node_user_data_override(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "node_user_data_override", value) + @property + @pulumi.getter(name="nodeadmExtraOptions") + def nodeadm_extra_options(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]]]: + """ + Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + """ + return pulumi.get(self, "nodeadm_extra_options") + + @nodeadm_extra_options.setter + def nodeadm_extra_options(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]]]): + pulumi.set(self, "nodeadm_extra_options", value) + @property @pulumi.getter(name="operatingSystem") def operating_system(self) -> Optional[pulumi.Input['OperatingSystem']]: @@ -1335,6 +1372,46 @@ def role_arn(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "role_arn", value) +@pulumi.input_type +class NodeadmOptionsArgs: + def __init__(__self__, *, + content: pulumi.Input[str], + content_type: pulumi.Input[str]): + """ + MIME document parts for nodeadm configuration. This can be shell scripts, nodeadm configuration or any other user data compatible script. + + See for more details: https://awslabs.github.io/amazon-eks-ami/nodeadm/. + :param pulumi.Input[str] content: The ARN of the access policy to associate with the principal + :param pulumi.Input[str] content_type: The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + """ + pulumi.set(__self__, "content", content) + pulumi.set(__self__, "content_type", content_type) + + @property + @pulumi.getter + def content(self) -> pulumi.Input[str]: + """ + The ARN of the access policy to associate with the principal + """ + return pulumi.get(self, "content") + + @content.setter + def content(self, value: pulumi.Input[str]): + pulumi.set(self, "content", value) + + @property + @pulumi.getter(name="contentType") + def content_type(self) -> pulumi.Input[str]: + """ + The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + """ + return pulumi.get(self, "content_type") + + @content_type.setter + def content_type(self, value: pulumi.Input[str]): + pulumi.set(self, "content_type", value) + + @pulumi.input_type class RoleMappingArgs: def __init__(__self__, *, diff --git a/sdk/python/pulumi_eks/managed_node_group.py b/sdk/python/pulumi_eks/managed_node_group.py index c8b3208da..66836639a 100644 --- a/sdk/python/pulumi_eks/managed_node_group.py +++ b/sdk/python/pulumi_eks/managed_node_group.py @@ -39,6 +39,7 @@ def __init__(__self__, *, node_group_name_prefix: Optional[pulumi.Input[str]] = None, node_role: Optional[pulumi.Input['pulumi_aws.iam.Role']] = None, node_role_arn: Optional[pulumi.Input[str]] = None, + nodeadm_extra_options: Optional[pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]]] = None, operating_system: Optional[pulumi.Input['OperatingSystem']] = None, release_version: Optional[pulumi.Input[str]] = None, remote_access: Optional[pulumi.Input['pulumi_aws.eks.NodeGroupRemoteAccessArgs']] = None, @@ -103,6 +104,17 @@ def __init__(__self__, *, :param pulumi.Input[str] node_role_arn: Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group. Note, `nodeRoleArn` and `nodeRole` are mutually exclusive, and a single option must be used. + :param pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]] nodeadm_extra_options: Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ :param pulumi.Input['OperatingSystem'] operating_system: The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -166,6 +178,8 @@ def __init__(__self__, *, pulumi.set(__self__, "node_role", node_role) if node_role_arn is not None: pulumi.set(__self__, "node_role_arn", node_role_arn) + if nodeadm_extra_options is not None: + pulumi.set(__self__, "nodeadm_extra_options", nodeadm_extra_options) if operating_system is not None: pulumi.set(__self__, "operating_system", operating_system) if release_version is not None: @@ -447,6 +461,28 @@ def node_role_arn(self) -> Optional[pulumi.Input[str]]: def node_role_arn(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "node_role_arn", value) + @property + @pulumi.getter(name="nodeadmExtraOptions") + def nodeadm_extra_options(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]]]: + """ + Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + """ + return pulumi.get(self, "nodeadm_extra_options") + + @nodeadm_extra_options.setter + def nodeadm_extra_options(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]]]): + pulumi.set(self, "nodeadm_extra_options", value) + @property @pulumi.getter(name="operatingSystem") def operating_system(self) -> Optional[pulumi.Input['OperatingSystem']]: @@ -594,6 +630,7 @@ def __init__(__self__, node_group_name_prefix: Optional[pulumi.Input[str]] = None, node_role: Optional[pulumi.Input['pulumi_aws.iam.Role']] = None, node_role_arn: Optional[pulumi.Input[str]] = None, + nodeadm_extra_options: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NodeadmOptionsArgs', 'NodeadmOptionsArgsDict']]]]] = None, operating_system: Optional[pulumi.Input['OperatingSystem']] = None, release_version: Optional[pulumi.Input[str]] = None, remote_access: Optional[pulumi.Input[pulumi.InputType['pulumi_aws.eks.NodeGroupRemoteAccessArgs']]] = None, @@ -665,6 +702,17 @@ def __init__(__self__, :param pulumi.Input[str] node_role_arn: Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group. Note, `nodeRoleArn` and `nodeRole` are mutually exclusive, and a single option must be used. + :param pulumi.Input[Sequence[pulumi.Input[Union['NodeadmOptionsArgs', 'NodeadmOptionsArgsDict']]]] nodeadm_extra_options: Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ :param pulumi.Input['OperatingSystem'] operating_system: The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -737,6 +785,7 @@ def _internal_init(__self__, node_group_name_prefix: Optional[pulumi.Input[str]] = None, node_role: Optional[pulumi.Input['pulumi_aws.iam.Role']] = None, node_role_arn: Optional[pulumi.Input[str]] = None, + nodeadm_extra_options: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NodeadmOptionsArgs', 'NodeadmOptionsArgsDict']]]]] = None, operating_system: Optional[pulumi.Input['OperatingSystem']] = None, release_version: Optional[pulumi.Input[str]] = None, remote_access: Optional[pulumi.Input[pulumi.InputType['pulumi_aws.eks.NodeGroupRemoteAccessArgs']]] = None, @@ -778,6 +827,7 @@ def _internal_init(__self__, __props__.__dict__["node_group_name_prefix"] = node_group_name_prefix __props__.__dict__["node_role"] = node_role __props__.__dict__["node_role_arn"] = node_role_arn + __props__.__dict__["nodeadm_extra_options"] = nodeadm_extra_options __props__.__dict__["operating_system"] = operating_system __props__.__dict__["release_version"] = release_version __props__.__dict__["remote_access"] = remote_access diff --git a/sdk/python/pulumi_eks/node_group.py b/sdk/python/pulumi_eks/node_group.py index 05c1be9b2..1172fa442 100644 --- a/sdk/python/pulumi_eks/node_group.py +++ b/sdk/python/pulumi_eks/node_group.py @@ -52,6 +52,7 @@ def __init__(__self__, *, node_subnet_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, node_user_data: Optional[pulumi.Input[str]] = None, node_user_data_override: Optional[pulumi.Input[str]] = None, + nodeadm_extra_options: Optional[pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]]] = None, operating_system: Optional[pulumi.Input['OperatingSystem']] = None, spot_price: Optional[pulumi.Input[str]] = None, taints: Optional[Mapping[str, 'TaintArgs']] = None, @@ -145,6 +146,17 @@ def __init__(__self__, *, :param pulumi.Input[str] node_user_data_override: User specified code to run on node startup. This code is expected to handle the full AWS EKS bootstrapping code and signal node readiness to the managing CloudFormation stack. This code must be a complete and executable user data script in bash (Linux) or powershell (Windows). See for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html + :param pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]] nodeadm_extra_options: Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ :param pulumi.Input['OperatingSystem'] operating_system: The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -216,6 +228,8 @@ def __init__(__self__, *, pulumi.set(__self__, "node_user_data", node_user_data) if node_user_data_override is not None: pulumi.set(__self__, "node_user_data_override", node_user_data_override) + if nodeadm_extra_options is not None: + pulumi.set(__self__, "nodeadm_extra_options", nodeadm_extra_options) if operating_system is not None: pulumi.set(__self__, "operating_system", operating_system) if spot_price is not None: @@ -664,6 +678,28 @@ def node_user_data_override(self) -> Optional[pulumi.Input[str]]: def node_user_data_override(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "node_user_data_override", value) + @property + @pulumi.getter(name="nodeadmExtraOptions") + def nodeadm_extra_options(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]]]: + """ + Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + """ + return pulumi.get(self, "nodeadm_extra_options") + + @nodeadm_extra_options.setter + def nodeadm_extra_options(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]]]): + pulumi.set(self, "nodeadm_extra_options", value) + @property @pulumi.getter(name="operatingSystem") def operating_system(self) -> Optional[pulumi.Input['OperatingSystem']]: @@ -753,6 +789,7 @@ def __init__(__self__, node_subnet_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, node_user_data: Optional[pulumi.Input[str]] = None, node_user_data_override: Optional[pulumi.Input[str]] = None, + nodeadm_extra_options: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NodeadmOptionsArgs', 'NodeadmOptionsArgsDict']]]]] = None, operating_system: Optional[pulumi.Input['OperatingSystem']] = None, spot_price: Optional[pulumi.Input[str]] = None, taints: Optional[Mapping[str, Union['TaintArgs', 'TaintArgsDict']]] = None, @@ -850,6 +887,17 @@ def __init__(__self__, :param pulumi.Input[str] node_user_data_override: User specified code to run on node startup. This code is expected to handle the full AWS EKS bootstrapping code and signal node readiness to the managing CloudFormation stack. This code must be a complete and executable user data script in bash (Linux) or powershell (Windows). See for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html + :param pulumi.Input[Sequence[pulumi.Input[Union['NodeadmOptionsArgs', 'NodeadmOptionsArgsDict']]]] nodeadm_extra_options: Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ :param pulumi.Input['OperatingSystem'] operating_system: The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -914,6 +962,7 @@ def _internal_init(__self__, node_subnet_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, node_user_data: Optional[pulumi.Input[str]] = None, node_user_data_override: Optional[pulumi.Input[str]] = None, + nodeadm_extra_options: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NodeadmOptionsArgs', 'NodeadmOptionsArgsDict']]]]] = None, operating_system: Optional[pulumi.Input['OperatingSystem']] = None, spot_price: Optional[pulumi.Input[str]] = None, taints: Optional[Mapping[str, Union['TaintArgs', 'TaintArgsDict']]] = None, @@ -963,6 +1012,7 @@ def _internal_init(__self__, __props__.__dict__["node_subnet_ids"] = node_subnet_ids __props__.__dict__["node_user_data"] = node_user_data __props__.__dict__["node_user_data_override"] = node_user_data_override + __props__.__dict__["nodeadm_extra_options"] = nodeadm_extra_options __props__.__dict__["operating_system"] = operating_system __props__.__dict__["spot_price"] = spot_price __props__.__dict__["taints"] = taints diff --git a/sdk/python/pulumi_eks/node_group_v2.py b/sdk/python/pulumi_eks/node_group_v2.py index 8ca1fed5e..ace5c4b2b 100644 --- a/sdk/python/pulumi_eks/node_group_v2.py +++ b/sdk/python/pulumi_eks/node_group_v2.py @@ -54,6 +54,7 @@ def __init__(__self__, *, node_subnet_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, node_user_data: Optional[pulumi.Input[str]] = None, node_user_data_override: Optional[pulumi.Input[str]] = None, + nodeadm_extra_options: Optional[pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]]] = None, operating_system: Optional[pulumi.Input['OperatingSystem']] = None, spot_price: Optional[pulumi.Input[str]] = None, taints: Optional[Mapping[str, 'TaintArgs']] = None, @@ -149,6 +150,17 @@ def __init__(__self__, *, :param pulumi.Input[str] node_user_data_override: User specified code to run on node startup. This code is expected to handle the full AWS EKS bootstrapping code and signal node readiness to the managing CloudFormation stack. This code must be a complete and executable user data script in bash (Linux) or powershell (Windows). See for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html + :param pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]] nodeadm_extra_options: Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ :param pulumi.Input['OperatingSystem'] operating_system: The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -224,6 +236,8 @@ def __init__(__self__, *, pulumi.set(__self__, "node_user_data", node_user_data) if node_user_data_override is not None: pulumi.set(__self__, "node_user_data_override", node_user_data_override) + if nodeadm_extra_options is not None: + pulumi.set(__self__, "nodeadm_extra_options", nodeadm_extra_options) if operating_system is not None: pulumi.set(__self__, "operating_system", operating_system) if spot_price is not None: @@ -696,6 +710,28 @@ def node_user_data_override(self) -> Optional[pulumi.Input[str]]: def node_user_data_override(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "node_user_data_override", value) + @property + @pulumi.getter(name="nodeadmExtraOptions") + def nodeadm_extra_options(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]]]: + """ + Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + """ + return pulumi.get(self, "nodeadm_extra_options") + + @nodeadm_extra_options.setter + def nodeadm_extra_options(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['NodeadmOptionsArgs']]]]): + pulumi.set(self, "nodeadm_extra_options", value) + @property @pulumi.getter(name="operatingSystem") def operating_system(self) -> Optional[pulumi.Input['OperatingSystem']]: @@ -787,6 +823,7 @@ def __init__(__self__, node_subnet_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, node_user_data: Optional[pulumi.Input[str]] = None, node_user_data_override: Optional[pulumi.Input[str]] = None, + nodeadm_extra_options: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NodeadmOptionsArgs', 'NodeadmOptionsArgsDict']]]]] = None, operating_system: Optional[pulumi.Input['OperatingSystem']] = None, spot_price: Optional[pulumi.Input[str]] = None, taints: Optional[Mapping[str, Union['TaintArgs', 'TaintArgsDict']]] = None, @@ -886,6 +923,17 @@ def __init__(__self__, :param pulumi.Input[str] node_user_data_override: User specified code to run on node startup. This code is expected to handle the full AWS EKS bootstrapping code and signal node readiness to the managing CloudFormation stack. This code must be a complete and executable user data script in bash (Linux) or powershell (Windows). See for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html + :param pulumi.Input[Sequence[pulumi.Input[Union['NodeadmOptionsArgs', 'NodeadmOptionsArgsDict']]]] nodeadm_extra_options: Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ :param pulumi.Input['OperatingSystem'] operating_system: The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -952,6 +1000,7 @@ def _internal_init(__self__, node_subnet_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, node_user_data: Optional[pulumi.Input[str]] = None, node_user_data_override: Optional[pulumi.Input[str]] = None, + nodeadm_extra_options: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NodeadmOptionsArgs', 'NodeadmOptionsArgsDict']]]]] = None, operating_system: Optional[pulumi.Input['OperatingSystem']] = None, spot_price: Optional[pulumi.Input[str]] = None, taints: Optional[Mapping[str, Union['TaintArgs', 'TaintArgsDict']]] = None, @@ -1003,6 +1052,7 @@ def _internal_init(__self__, __props__.__dict__["node_subnet_ids"] = node_subnet_ids __props__.__dict__["node_user_data"] = node_user_data __props__.__dict__["node_user_data_override"] = node_user_data_override + __props__.__dict__["nodeadm_extra_options"] = nodeadm_extra_options __props__.__dict__["operating_system"] = operating_system __props__.__dict__["spot_price"] = spot_price __props__.__dict__["taints"] = taints diff --git a/sdk/python/pulumi_eks/outputs.py b/sdk/python/pulumi_eks/outputs.py index e84720cab..cb97d462d 100644 --- a/sdk/python/pulumi_eks/outputs.py +++ b/sdk/python/pulumi_eks/outputs.py @@ -20,6 +20,7 @@ 'ClusterNodeGroupOptions', 'CoreData', 'NodeGroupData', + 'NodeadmOptions', 'Taint', ] @@ -258,6 +259,8 @@ def __key_warning(key: str): suggest = "node_user_data" elif key == "nodeUserDataOverride": suggest = "node_user_data_override" + elif key == "nodeadmExtraOptions": + suggest = "nodeadm_extra_options" elif key == "operatingSystem": suggest = "operating_system" elif key == "spotPrice": @@ -306,6 +309,7 @@ def __init__(__self__, *, node_subnet_ids: Optional[Sequence[str]] = None, node_user_data: Optional[str] = None, node_user_data_override: Optional[str] = None, + nodeadm_extra_options: Optional[Sequence['outputs.NodeadmOptions']] = None, operating_system: Optional['OperatingSystem'] = None, spot_price: Optional[str] = None, taints: Optional[Mapping[str, 'outputs.Taint']] = None, @@ -398,6 +402,17 @@ def __init__(__self__, *, :param str node_user_data_override: User specified code to run on node startup. This code is expected to handle the full AWS EKS bootstrapping code and signal node readiness to the managing CloudFormation stack. This code must be a complete and executable user data script in bash (Linux) or powershell (Windows). See for more details: https://docs.aws.amazon.com/eks/latest/userguide/worker.html + :param Sequence['NodeadmOptions'] nodeadm_extra_options: Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ :param 'OperatingSystem' operating_system: The type of OS to use for the node group. Will be used to determine the right EKS optimized AMI to use based on the instance types and gpu configuration. Valid values are `AL2`, `AL2023` and `Bottlerocket`. @@ -468,6 +483,8 @@ def __init__(__self__, *, pulumi.set(__self__, "node_user_data", node_user_data) if node_user_data_override is not None: pulumi.set(__self__, "node_user_data_override", node_user_data_override) + if nodeadm_extra_options is not None: + pulumi.set(__self__, "nodeadm_extra_options", nodeadm_extra_options) if operating_system is not None: pulumi.set(__self__, "operating_system", operating_system) if spot_price is not None: @@ -780,6 +797,24 @@ def node_user_data_override(self) -> Optional[str]: """ return pulumi.get(self, "node_user_data_override") + @property + @pulumi.getter(name="nodeadmExtraOptions") + def nodeadm_extra_options(self) -> Optional[Sequence['outputs.NodeadmOptions']]: + """ + Extra nodeadm configuration sections to be added to the nodeadm user data. This can be shell scripts, nodeadm NodeConfig or any other user data compatible script. When configuring additional nodeadm NodeConfig sections, they'll be merged with the base settings the provider sets. You can overwrite base settings or provide additional settings this way. + The base settings the provider sets are: + - cluster.name + - cluster.apiServerEndpoint + - cluster.certificateAuthority + - cluster.cidr + + Note: This is only applicable when using AL2023. + See for more details: + - https://awslabs.github.io/amazon-eks-ami/nodeadm/ + - https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/ + """ + return pulumi.get(self, "nodeadm_extra_options") + @property @pulumi.getter(name="operatingSystem") def operating_system(self) -> Optional['OperatingSystem']: @@ -1181,6 +1216,60 @@ def node_security_group(self) -> 'pulumi_aws.ec2.SecurityGroup': return pulumi.get(self, "node_security_group") +@pulumi.output_type +class NodeadmOptions(dict): + """ + MIME document parts for nodeadm configuration. This can be shell scripts, nodeadm configuration or any other user data compatible script. + + See for more details: https://awslabs.github.io/amazon-eks-ami/nodeadm/. + """ + @staticmethod + def __key_warning(key: str): + suggest = None + if key == "contentType": + suggest = "content_type" + + if suggest: + pulumi.log.warn(f"Key '{key}' not found in NodeadmOptions. Access the value via the '{suggest}' property getter instead.") + + def __getitem__(self, key: str) -> Any: + NodeadmOptions.__key_warning(key) + return super().__getitem__(key) + + def get(self, key: str, default = None) -> Any: + NodeadmOptions.__key_warning(key) + return super().get(key, default) + + def __init__(__self__, *, + content: str, + content_type: str): + """ + MIME document parts for nodeadm configuration. This can be shell scripts, nodeadm configuration or any other user data compatible script. + + See for more details: https://awslabs.github.io/amazon-eks-ami/nodeadm/. + :param str content: The ARN of the access policy to associate with the principal + :param str content_type: The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + """ + pulumi.set(__self__, "content", content) + pulumi.set(__self__, "content_type", content_type) + + @property + @pulumi.getter + def content(self) -> str: + """ + The ARN of the access policy to associate with the principal + """ + return pulumi.get(self, "content") + + @property + @pulumi.getter(name="contentType") + def content_type(self) -> str: + """ + The MIME type of the content. Examples are `text/x-shellscript; charset="us-ascii"` for shell scripts, and `application/node.eks.aws` nodeadm configuration. + """ + return pulumi.get(self, "content_type") + + @pulumi.output_type class Taint(dict): """