diff --git a/examples/cluster/index.ts b/examples/cluster/index.ts index 118282f22..aa7c12d73 100644 --- a/examples/cluster/index.ts +++ b/examples/cluster/index.ts @@ -18,6 +18,8 @@ const cluster1 = new eks.Cluster(`${projectName}-1`, { nodeAmiId: "ami-066e69f6f03b5383e", }); +export const defaultAsgArn: pulumi.Output = cluster1.defaultNodeGroup.apply(ng => ng?.autoScalingGroup.arn ?? pulumi.output("")); + const cluster2 = new eks.Cluster(`${projectName}-2`, { vpcId: vpc.vpcId, publicSubnetIds: vpc.publicSubnetIds, diff --git a/examples/examples_nodejs_test.go b/examples/examples_nodejs_test.go index 83e75fa92..e70289471 100644 --- a/examples/examples_nodejs_test.go +++ b/examples/examples_nodejs_test.go @@ -56,6 +56,8 @@ func TestAccCluster(t *testing.T) { info.Outputs["kubeconfig4"], ) + assert.NotEmpty(t, info.Outputs["defaultAsgArn"], "should have a default ASG") + // let's test there's a iamRoleArn specified for the cluster assert.NotEmpty(t, info.Outputs["iamRoleArn"]) diff --git a/provider/cmd/pulumi-gen-eks/main.go b/provider/cmd/pulumi-gen-eks/main.go index 909a99294..4b136cf8f 100644 --- a/provider/cmd/pulumi-gen-eks/main.go +++ b/provider/cmd/pulumi-gen-eks/main.go @@ -1393,15 +1393,15 @@ func generateSchema(version semver.Version) schema.PackageSpec { }, Description: "The additional security groups for the node group that captures user-specific rules.", }, - "autoScalingGroupName": { - TypeSpec: schema.TypeSpec{Type: "string"}, - Description: "The AutoScalingGroup name for the node group.", + "autoScalingGroup": { + TypeSpec: schema.TypeSpec{Ref: awsRef("#/resources/aws:autoscaling%2Fgroup:Group")}, + Description: "The AutoScalingGroup for the node group.", }, }, Required: []string{ "nodeSecurityGroup", "extraNodeSecurityGroups", - "autoScalingGroupName", + "autoScalingGroup", }, }, }, diff --git a/provider/cmd/pulumi-resource-eks/schema.json b/provider/cmd/pulumi-resource-eks/schema.json index 7ab3ed750..265f06aa8 100644 --- a/provider/cmd/pulumi-resource-eks/schema.json +++ b/provider/cmd/pulumi-resource-eks/schema.json @@ -677,9 +677,9 @@ "eks:index:NodeGroupData": { "description": "NodeGroupData describes the resources created for the given NodeGroup.", "properties": { - "autoScalingGroupName": { - "type": "string", - "description": "The AutoScalingGroup name for the node group." + "autoScalingGroup": { + "$ref": "/aws/v6.18.2/schema.json#/resources/aws:autoscaling%2Fgroup:Group", + "description": "The AutoScalingGroup for the node group." }, "extraNodeSecurityGroups": { "type": "array", @@ -697,7 +697,7 @@ "required": [ "nodeSecurityGroup", "extraNodeSecurityGroups", - "autoScalingGroupName" + "autoScalingGroup" ] }, "eks:index:NodeadmOptions": { diff --git a/sdk/dotnet/Outputs/NodeGroupData.cs b/sdk/dotnet/Outputs/NodeGroupData.cs index 72222b050..a413bcb8f 100644 --- a/sdk/dotnet/Outputs/NodeGroupData.cs +++ b/sdk/dotnet/Outputs/NodeGroupData.cs @@ -17,9 +17,9 @@ namespace Pulumi.Eks.Outputs public sealed class NodeGroupData { /// - /// The AutoScalingGroup name for the node group. + /// The AutoScalingGroup for the node group. /// - public readonly string AutoScalingGroupName; + public readonly Pulumi.Aws.AutoScaling.Group AutoScalingGroup; /// /// The additional security groups for the node group that captures user-specific rules. /// @@ -31,13 +31,13 @@ public sealed class NodeGroupData [OutputConstructor] private NodeGroupData( - string autoScalingGroupName, + Pulumi.Aws.AutoScaling.Group autoScalingGroup, ImmutableArray extraNodeSecurityGroups, Pulumi.Aws.Ec2.SecurityGroup nodeSecurityGroup) { - AutoScalingGroupName = autoScalingGroupName; + AutoScalingGroup = autoScalingGroup; ExtraNodeSecurityGroups = extraNodeSecurityGroups; NodeSecurityGroup = nodeSecurityGroup; } diff --git a/sdk/go/eks/pulumiTypes.go b/sdk/go/eks/pulumiTypes.go index dbac9a9e6..280b0de8b 100644 --- a/sdk/go/eks/pulumiTypes.go +++ b/sdk/go/eks/pulumiTypes.go @@ -8,6 +8,7 @@ import ( "reflect" "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/autoscaling" "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/eks" "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" @@ -2740,8 +2741,8 @@ func (o KubeconfigOptionsPtrOutput) RoleArn() pulumi.StringPtrOutput { // NodeGroupData describes the resources created for the given NodeGroup. type NodeGroupData struct { - // The AutoScalingGroup name for the node group. - AutoScalingGroupName string `pulumi:"autoScalingGroupName"` + // The AutoScalingGroup for the node group. + AutoScalingGroup *autoscaling.Group `pulumi:"autoScalingGroup"` // The additional security groups for the node group that captures user-specific rules. ExtraNodeSecurityGroups []*ec2.SecurityGroup `pulumi:"extraNodeSecurityGroups"` // The security group for the node group to communicate with the cluster. @@ -2763,9 +2764,9 @@ func (o NodeGroupDataOutput) ToNodeGroupDataOutputWithContext(ctx context.Contex return o } -// The AutoScalingGroup name for the node group. -func (o NodeGroupDataOutput) AutoScalingGroupName() pulumi.StringOutput { - return o.ApplyT(func(v NodeGroupData) string { return v.AutoScalingGroupName }).(pulumi.StringOutput) +// The AutoScalingGroup for the node group. +func (o NodeGroupDataOutput) AutoScalingGroup() autoscaling.GroupOutput { + return o.ApplyT(func(v NodeGroupData) *autoscaling.Group { return v.AutoScalingGroup }).(autoscaling.GroupOutput) } // The additional security groups for the node group that captures user-specific rules. @@ -2802,14 +2803,14 @@ func (o NodeGroupDataPtrOutput) Elem() NodeGroupDataOutput { }).(NodeGroupDataOutput) } -// The AutoScalingGroup name for the node group. -func (o NodeGroupDataPtrOutput) AutoScalingGroupName() pulumi.StringPtrOutput { - return o.ApplyT(func(v *NodeGroupData) *string { +// The AutoScalingGroup for the node group. +func (o NodeGroupDataPtrOutput) AutoScalingGroup() autoscaling.GroupOutput { + return o.ApplyT(func(v *NodeGroupData) *autoscaling.Group { if v == nil { return nil } - return &v.AutoScalingGroupName - }).(pulumi.StringPtrOutput) + return v.AutoScalingGroup + }).(autoscaling.GroupOutput) } // The additional security groups for the node group that captures user-specific rules. diff --git a/sdk/java/src/main/java/com/pulumi/eks/outputs/NodeGroupData.java b/sdk/java/src/main/java/com/pulumi/eks/outputs/NodeGroupData.java index 2f218637f..cf70896b6 100644 --- a/sdk/java/src/main/java/com/pulumi/eks/outputs/NodeGroupData.java +++ b/sdk/java/src/main/java/com/pulumi/eks/outputs/NodeGroupData.java @@ -3,20 +3,20 @@ package com.pulumi.eks.outputs; +import com.pulumi.aws.autoscaling.Group; import com.pulumi.aws.ec2.SecurityGroup; import com.pulumi.core.annotations.CustomType; import com.pulumi.exceptions.MissingRequiredPropertyException; -import java.lang.String; import java.util.List; import java.util.Objects; @CustomType public final class NodeGroupData { /** - * @return The AutoScalingGroup name for the node group. + * @return The AutoScalingGroup for the node group. * */ - private String autoScalingGroupName; + private Group autoScalingGroup; /** * @return The additional security groups for the node group that captures user-specific rules. * @@ -30,11 +30,11 @@ public final class NodeGroupData { private NodeGroupData() {} /** - * @return The AutoScalingGroup name for the node group. + * @return The AutoScalingGroup for the node group. * */ - public String autoScalingGroupName() { - return this.autoScalingGroupName; + public Group autoScalingGroup() { + return this.autoScalingGroup; } /** * @return The additional security groups for the node group that captures user-specific rules. @@ -60,23 +60,23 @@ public static Builder builder(NodeGroupData defaults) { } @CustomType.Builder public static final class Builder { - private String autoScalingGroupName; + private Group autoScalingGroup; private List extraNodeSecurityGroups; private SecurityGroup nodeSecurityGroup; public Builder() {} public Builder(NodeGroupData defaults) { Objects.requireNonNull(defaults); - this.autoScalingGroupName = defaults.autoScalingGroupName; + this.autoScalingGroup = defaults.autoScalingGroup; this.extraNodeSecurityGroups = defaults.extraNodeSecurityGroups; this.nodeSecurityGroup = defaults.nodeSecurityGroup; } @CustomType.Setter - public Builder autoScalingGroupName(String autoScalingGroupName) { - if (autoScalingGroupName == null) { - throw new MissingRequiredPropertyException("NodeGroupData", "autoScalingGroupName"); + public Builder autoScalingGroup(Group autoScalingGroup) { + if (autoScalingGroup == null) { + throw new MissingRequiredPropertyException("NodeGroupData", "autoScalingGroup"); } - this.autoScalingGroupName = autoScalingGroupName; + this.autoScalingGroup = autoScalingGroup; return this; } @CustomType.Setter @@ -100,7 +100,7 @@ public Builder nodeSecurityGroup(SecurityGroup nodeSecurityGroup) { } public NodeGroupData build() { final var _resultValue = new NodeGroupData(); - _resultValue.autoScalingGroupName = autoScalingGroupName; + _resultValue.autoScalingGroup = autoScalingGroup; _resultValue.extraNodeSecurityGroups = extraNodeSecurityGroups; _resultValue.nodeSecurityGroup = nodeSecurityGroup; return _resultValue; diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index c74df0f80..d110a0089 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -373,9 +373,9 @@ export interface CoreData { */ export interface NodeGroupData { /** - * The AutoScalingGroup name for the node group. + * The AutoScalingGroup for the node group. */ - autoScalingGroupName: string; + autoScalingGroup: pulumiAws.autoscaling.Group; /** * The additional security groups for the node group that captures user-specific rules. */ diff --git a/sdk/python/pulumi_eks/outputs.py b/sdk/python/pulumi_eks/outputs.py index 12b12b9da..db4e0a728 100644 --- a/sdk/python/pulumi_eks/outputs.py +++ b/sdk/python/pulumi_eks/outputs.py @@ -1192,8 +1192,8 @@ class NodeGroupData(dict): @staticmethod def __key_warning(key: str): suggest = None - if key == "autoScalingGroupName": - suggest = "auto_scaling_group_name" + if key == "autoScalingGroup": + suggest = "auto_scaling_group" elif key == "extraNodeSecurityGroups": suggest = "extra_node_security_groups" elif key == "nodeSecurityGroup": @@ -1211,26 +1211,26 @@ def get(self, key: str, default = None) -> Any: return super().get(key, default) def __init__(__self__, *, - auto_scaling_group_name: str, + auto_scaling_group: 'pulumi_aws.autoscaling.Group', extra_node_security_groups: Sequence['pulumi_aws.ec2.SecurityGroup'], node_security_group: 'pulumi_aws.ec2.SecurityGroup'): """ NodeGroupData describes the resources created for the given NodeGroup. - :param str auto_scaling_group_name: The AutoScalingGroup name for the node group. + :param 'pulumi_aws.autoscaling.Group' auto_scaling_group: The AutoScalingGroup for the node group. :param Sequence['pulumi_aws.ec2.SecurityGroup'] extra_node_security_groups: The additional security groups for the node group that captures user-specific rules. :param 'pulumi_aws.ec2.SecurityGroup' node_security_group: The security group for the node group to communicate with the cluster. """ - pulumi.set(__self__, "auto_scaling_group_name", auto_scaling_group_name) + pulumi.set(__self__, "auto_scaling_group", auto_scaling_group) pulumi.set(__self__, "extra_node_security_groups", extra_node_security_groups) pulumi.set(__self__, "node_security_group", node_security_group) @property - @pulumi.getter(name="autoScalingGroupName") - def auto_scaling_group_name(self) -> str: + @pulumi.getter(name="autoScalingGroup") + def auto_scaling_group(self) -> 'pulumi_aws.autoscaling.Group': """ - The AutoScalingGroup name for the node group. + The AutoScalingGroup for the node group. """ - return pulumi.get(self, "auto_scaling_group_name") + return pulumi.get(self, "auto_scaling_group") @property @pulumi.getter(name="extraNodeSecurityGroups")