floci-io/floci · error · AwsException
InvalidRequestException
InvalidRequestException
Error message
DesiredState is required.
What it means
Error "DesiredState is required." thrown in floci-io/floci.
Source
Thrown at src/main/java/io/github/hectorvent/floci/services/cloudcontrol/CloudControlService.java:103
this.s3Service = s3Service;
this.ec2Service = ec2Service;
this.iamService = iamService;
this.provisioner = provisioner;
this.mapper = mapper;
}
/**
* Cloud Control {@code CreateResource}. Cloud Control is asynchronous: the call returns an
* IN_PROGRESS ProgressEvent + a request token immediately, and provisioning runs in the
* background. Clients poll {@link #requestStatus} until SUCCESS/FAILED. This matters because
* some resources (e.g. an EC2 instance, which launches a container) take longer than a client's
* synchronous-call deadline — a synchronous create would time out on the caller.
*/
public ProgressEvent createResource(String region, String typeName, String desiredStateJson) {
// DesiredState is a required member of CreateResourceInput. Defaulting an absent one to an
// empty object provisioned a resource the caller never described.
if (desiredStateJson == null || desiredStateJson.isBlank()) {
throw new AwsException("InvalidRequestException", "DesiredState is required.", 400);
}
JsonNode props;
try {
props = mapper.readTree(desiredStateJson);
} catch (Exception e) {
throw new AwsException("InvalidRequestException", "DesiredState is not valid JSON.", 400);
}
String token = UUID.randomUUID().toString();
ProgressEvent pending = new ProgressEvent(typeName, null, token, "CREATE", "IN_PROGRESS", null, null);
record(pending);
executor.submit(() -> {
try {
var resource = provisioner.provisionStandalone(typeName, props, region, ACCOUNT);
if (resource == null || resource.getPhysicalId() == null) {
record(pending.failed("CreateResource is not supported for " + typeName + "."));
} else {
String model = resourceModel(region, typeName, resource.getPhysicalId(), props);
// Kept so GetResource can read back a type the read side does not list, and soView on GitHub (pinned to 62ff490619)
Solutions
- Provide DesiredState as a JSON document describing the desired resource properties.
When it happens
Trigger: Thrown at src/main/java/io/github/hectorvent/floci/services/cloudcontrol/CloudControlService.java:103 when the library encounters an invalid state.
Common situations: Occurs when UpdateResource is called without DesiredState. Include the DesiredState JSON document describing the target properties.
AI-assisted analysis of floci-io/floci@62ff490619 (2026-08-14).
Data as JSON: /api/errors/14425eb8f3faf8f1.
Report an issue: GitHub.