diff --git a/pkg/cfn/builder/api_test.go b/pkg/cfn/builder/api_test.go index 9aba605056..0f5b2d8462 100644 --- a/pkg/cfn/builder/api_test.go +++ b/pkg/cfn/builder/api_test.go @@ -2499,7 +2499,7 @@ var _ = Describe("CloudFormation template builder API", func() { Expect(ngTemplate.Resources).To(HaveKey("NodeGroupLaunchTemplate")) launchTemplateData := getLaunchTemplateData(ngTemplate) - Expect(launchTemplateData.InstanceType).To(Equal("")) + Expect(launchTemplateData.InstanceType).To(Equal("m5.large")) Expect(launchTemplateData.InstanceMarketOptions).To(BeNil()) nodeGroupProperties := getNodeGroupProperties(ngTemplate) diff --git a/pkg/cfn/builder/nodegroup.go b/pkg/cfn/builder/nodegroup.go index b016a08bfa..162994d56d 100644 --- a/pkg/cfn/builder/nodegroup.go +++ b/pkg/cfn/builder/nodegroup.go @@ -2,6 +2,7 @@ package builder import ( "fmt" + "github.com/kris-nova/logger" cfn "github.com/aws/aws-sdk-go/service/cloudformation" @@ -119,7 +120,7 @@ func (n *NodeGroupResourceSet) addResourcesForNodeGroup() error { Ebs: &gfn.AWSEC2LaunchTemplate_Ebs{ VolumeSize: gfn.NewInteger(*volumeSize), VolumeType: gfn.NewString(*n.spec.VolumeType), - Encrypted: gfn.NewBoolean(*n.spec.VolumeEncrypted), + Encrypted: gfn.NewBoolean(*n.spec.VolumeEncrypted), }, }} if api.IsSetAndNonEmptyString(n.spec.VolumeKmsKeyID) { @@ -214,6 +215,8 @@ func newLaunchTemplateData(n *NodeGroupResourceSet) *gfn.AWSEC2LaunchTemplate_La } if !api.HasMixedInstances(n.spec) { launchTemplateData.InstanceType = gfn.NewString(n.spec.InstanceType) + } else { + launchTemplateData.InstanceType = gfn.NewString(n.spec.InstancesDistribution.InstanceTypes[0]) } return launchTemplateData