{"record":{"id":"a6800872dceeded4","repo":"hashicorp/terraform","slug":"q-cannot-be-higher-than-d-d","errorCode":null,"errorMessage":"%q cannot be higher than %d: %d","messagePattern":"%q cannot be higher than (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/backend/remote-state/cos/backend.go","lineNumber":260,"sourceCode":"\t\t\t},\n\t\t},\n\t}\n\n\tresult := &Backend{Backend: s}\n\tresult.Backend.ConfigureFunc = result.configure\n\n\treturn result\n}\n\nfunc validateIntegerInRange(min, max int64) schema.SchemaValidateFunc {\n\treturn func(v interface{}, k string) (ws []string, errors []error) {\n\t\tvalue := int64(v.(int))\n\t\tif value < min {\n\t\t\terrors = append(errors, fmt.Errorf(\n\t\t\t\t\"%q cannot be lower than %d: %d\", k, min, value))\n\t\t}\n\t\tif value > max {\n\t\t\terrors = append(errors, fmt.Errorf(\n\t\t\t\t\"%q cannot be higher than %d: %d\", k, max, value))\n\t\t}\n\t\treturn\n\t}\n}\n\n// configure init cos client\nfunc (b *Backend) configure(ctx context.Context) error {\n\tif b.cosClient != nil {\n\t\treturn nil\n\t}\n\n\tb.cosContext = ctx\n\tdata := schema.FromContextBackendConfig(b.cosContext)\n\n\tb.region = data.Get(\"region\").(string)\n\tb.bucket = data.Get(\"bucket\").(string)\n\tb.prefix = data.Get(\"prefix\").(string)","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/backend/remote-state/cos/backend.go#L242-L278","documentation":"Produced by validateIntegerInRange (cos/backend.go:260), used to validate assume_role.session_duration (range 0..43200). It fires when the configured integer exceeds the maximum supported STS session length of 43200 seconds (12 hours).","triggerScenarios":"Setting assume_role.session_duration above 43200 (or via TENCENTCLOUD_ASSUME_ROLE_SESSION_DURATION) triggers the > max branch.","commonSituations":"Specifying minutes instead of seconds (e.g. 7200 minutes); wanting an overly long session that exceeds STS limits; copy-paste from another cloud's max.","solutions":["Set session_duration to at most 43200 seconds.","Use 7200 (default) for typical runs; raise only if a long apply needs more time.","Verify TENCENTCLOUD_ASSUME_ROLE_SESSION_DURATION units are seconds."],"exampleFix":"// before\nassume_role {\n  session_duration = 100000\n}\n// after\nassume_role {\n  session_duration = 43200\n}","handlingStrategy":"validation","validationCode":"// Validate session_duration is within [min,max] before configuring\nfunc validateRange(name string, v, minV, maxV int64) error {\n    if v < minV { return fmt.Errorf(\"%q cannot be lower than %d: %d\", name, minV, v) }\n    if v > maxV { return fmt.Errorf(\"%q cannot be higher than %d: %d\", name, maxV, v) }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cap session_duration at 43200 seconds (12h STS max).","Do not specify minutes by mistake - the unit is seconds.","Validate env-provided durations in your provisioning scripts."],"tags":["cos","tencentcloud","validation","config","assume-role","sts"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T20:17:04.800Z"}