{"record":{"id":"14425eb8f3faf8f1","repo":"floci-io/floci","slug":"invalidrequestexception-14425e","errorCode":"InvalidRequestException","errorMessage":"DesiredState is required.","messagePattern":"DesiredState is required\\.","errorType":"error_code","errorClass":"AwsException","httpStatus":400,"severity":"error","filePath":"src/main/java/io/github/hectorvent/floci/services/cloudcontrol/CloudControlService.java","lineNumber":103,"sourceCode":"        this.s3Service = s3Service;\n        this.ec2Service = ec2Service;\n        this.iamService = iamService;\n        this.provisioner = provisioner;\n        this.mapper = mapper;\n    }\n\n    /**\n     * Cloud Control {@code CreateResource}. Cloud Control is asynchronous: the call returns an\n     * IN_PROGRESS ProgressEvent + a request token immediately, and provisioning runs in the\n     * background. Clients poll {@link #requestStatus} until SUCCESS/FAILED. This matters because\n     * some resources (e.g. an EC2 instance, which launches a container) take longer than a client's\n     * synchronous-call deadline — a synchronous create would time out on the caller.\n     */\n    public ProgressEvent createResource(String region, String typeName, String desiredStateJson) {\n        // DesiredState is a required member of CreateResourceInput. Defaulting an absent one to an\n        // empty object provisioned a resource the caller never described.\n        if (desiredStateJson == null || desiredStateJson.isBlank()) {\n            throw new AwsException(\"InvalidRequestException\", \"DesiredState is required.\", 400);\n        }\n        JsonNode props;\n        try {\n            props = mapper.readTree(desiredStateJson);\n        } catch (Exception e) {\n            throw new AwsException(\"InvalidRequestException\", \"DesiredState is not valid JSON.\", 400);\n        }\n        String token = UUID.randomUUID().toString();\n        ProgressEvent pending = new ProgressEvent(typeName, null, token, \"CREATE\", \"IN_PROGRESS\", null, null);\n        record(pending);\n        executor.submit(() -> {\n            try {\n                var resource = provisioner.provisionStandalone(typeName, props, region, ACCOUNT);\n                if (resource == null || resource.getPhysicalId() == null) {\n                    record(pending.failed(\"CreateResource is not supported for \" + typeName + \".\"));\n                } else {\n                    String model = resourceModel(region, typeName, resource.getPhysicalId(), props);\n                    // Kept so GetResource can read back a type the read side does not list, and so","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/services/cloudcontrol/CloudControlService.java#L85-L121","documentation":"Error \"DesiredState is required.\" thrown in floci-io/floci.","triggerScenarios":"Thrown at src/main/java/io/github/hectorvent/floci/services/cloudcontrol/CloudControlService.java:103 when the library encounters an invalid state.","commonSituations":"Occurs when UpdateResource is called without DesiredState. Include the DesiredState JSON document describing the target properties.","solutions":["Provide DesiredState as a JSON document describing the desired resource properties."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}