{"record":{"id":"3ea3b4db74da3279","repo":"kubernetes/kops","slug":"error-modifying-hostname-type-w","errorCode":null,"errorMessage":"error modifying hostname type: %w","messagePattern":"error modifying hostname type: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/subnet.go","lineNumber":323,"sourceCode":"\t\t}\n\t\t_, err := t.Cloud.EC2().ModifySubnetAttribute(ctx, request)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error modifying AssignIPv6AddressOnCreation: %w\", err)\n\t\t}\n\t}\n\n\tif changes.ResourceBasedNaming != nil {\n\t\thostnameType := ec2types.HostnameTypeIpName\n\t\tif *changes.ResourceBasedNaming {\n\t\t\thostnameType = ec2types.HostnameTypeResourceName\n\t\t}\n\t\trequest := &ec2.ModifySubnetAttributeInput{\n\t\t\tSubnetId:                       e.ID,\n\t\t\tPrivateDnsHostnameTypeOnLaunch: hostnameType,\n\t\t}\n\t\t_, err := t.Cloud.EC2().ModifySubnetAttribute(ctx, request)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error modifying hostname type: %w\", err)\n\t\t}\n\n\t\tif fi.ValueOf(e.CIDR) == \"\" {\n\t\t\trequest = &ec2.ModifySubnetAttributeInput{\n\t\t\t\tSubnetId:    e.ID,\n\t\t\t\tEnableDns64: &ec2types.AttributeBooleanValue{Value: aws.Bool(true)},\n\t\t\t}\n\t\t\t_, err = t.Cloud.EC2().ModifySubnetAttribute(ctx, request)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error enabling DNS64: %w\", err)\n\t\t\t}\n\t\t} else {\n\t\t\trequest = &ec2.ModifySubnetAttributeInput{\n\t\t\t\tSubnetId:                             e.ID,\n\t\t\t\tEnableResourceNameDnsARecordOnLaunch: &ec2types.AttributeBooleanValue{Value: changes.ResourceBasedNaming},\n\t\t\t}\n\t\t\t_, err = t.Cloud.EC2().ModifySubnetAttribute(ctx, request)\n\t\t\tif err != nil {","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/subnet.go#L305-L341","documentation":"ModifySubnetAttribute failed while changing PrivateDnsHostnameTypeOnLaunch (IP-name vs resource-based naming) on the subnet; the wrapped error is the AWS API response.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/subnet.go:323 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check ec2:ModifySubnetAttribute permissions","Ensure resource-based naming is supported in the region/account before enabling it"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}