{"record":{"id":"69f9455872e5ba51","repo":"kubernetes/kops","slug":"subnet-id-is-required-for-subnet-name-v","errorCode":null,"errorMessage":"Subnet ID is required for subnet name=%v","messagePattern":"Subnet ID is required for subnet name=(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/network_load_balancer.go","lineNumber":441,"sourceCode":"\t\t}\n\n\t\tif e.AccessLog != nil {\n\t\t\tif e.AccessLog.Enabled == nil {\n\t\t\t\treturn fi.RequiredField(\"Accesslog.Enabled\")\n\t\t\t}\n\t\t\tif *e.AccessLog.Enabled {\n\t\t\t\tif e.AccessLog.S3BucketName == nil {\n\t\t\t\t\treturn fi.RequiredField(\"Accesslog.S3Bucket\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif len(changes.SubnetMappings) > 0 {\n\t\t\texpectedSubnets := make(map[string]*string)\n\t\t\tfor _, s := range e.SubnetMappings {\n\t\t\t\tsubnetID := fi.ValueOf(s.Subnet.ID)\n\t\t\t\tif subnetID == \"\" {\n\t\t\t\t\treturn fmt.Errorf(\"Subnet ID is required for subnet name=%v\", fi.ValueOf(s.Subnet.Name))\n\t\t\t\t}\n\t\t\t\tif s.AllocationID != nil {\n\t\t\t\t\texpectedSubnets[subnetID] = s.AllocationID\n\t\t\t\t} else if s.PrivateIPv4Address != nil {\n\t\t\t\t\texpectedSubnets[subnetID] = s.PrivateIPv4Address\n\t\t\t\t} else {\n\t\t\t\t\texpectedSubnets[subnetID] = nil\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor _, s := range a.SubnetMappings {\n\t\t\t\tsubnetID := fi.ValueOf(s.Subnet.ID)\n\t\t\t\tif subnetID == \"\" {\n\t\t\t\t\treturn fmt.Errorf(\"Subnet ID is required for subnet name=%v\", fi.ValueOf(s.Subnet.Name))\n\t\t\t\t}\n\n\t\t\t\teIP, ok := expectedSubnets[subnetID]\n\t\t\t\tif !ok {","sourceCodeStart":423,"sourceCodeEnd":459,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/network_load_balancer.go#L423-L459","documentation":"CheckChanges requires every expected NLB SubnetMapping to carry a concrete subnet ID (shared/managed subnets must already be resolved); a mapping still had only a Name, so the diff cannot be validated.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/network_load_balancer.go:441 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the referenced subnets exist (or are tagged for discovery) before running the apply; run `kops update` first","Give shared subnets explicit ids in the spec so they resolve deterministically"],"exampleFix":null,"handlingStrategy":"validation","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-12T07:17:12.445Z"}