{"record":{"id":"b7b1f7479818c7e4","repo":"floci-io/floci","slug":"validationerror-b7b1f7","errorCode":"ValidationError","errorMessage":"No export named ${exportName} found","messagePattern":"No export named (.+?) found","errorType":"validation","errorClass":"AwsException","httpStatus":400,"severity":"error","filePath":"src/main/java/io/github/hectorvent/floci/services/cloudformation/CloudFormationTemplateEngine.java","lineNumber":415,"sourceCode":"                    if (secondLvl != null) {\n                        return resolve(secondLvl);\n                    }\n                }\n            }\n        }\n        return \"\";\n    }\n\n    private String resolveImportValue(JsonNode node) {\n        String exportName = resolve(node);\n        if (importValueResolver != null) {\n            String value = importValueResolver.apply(exportName);\n            if (value != null) {\n                return value;\n            }\n        }\n        LOG.warnv(\"Unresolved Fn::ImportValue: {0}\", exportName);\n        throw new AwsException(\"ValidationError\", \"No export named \" + exportName + \" found\", 400);\n    }\n}\n","sourceCodeStart":397,"sourceCodeEnd":418,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/services/cloudformation/CloudFormationTemplateEngine.java#L397-L418","documentation":"Raised by CloudFormationTemplateEngine while resolving Fn::ImportValue when no export with that name exists in the emulator (or the importValue resolver returned null). Cross-stack references fail at template resolution time, before any resource is provisioned.","triggerScenarios":"A template containing {\"Fn::ImportValue\": \"some-export-name\"} is deployed when no other stack in the same account/region has exported 'some-export-name' via Outputs.Exports, or the exporting stack was deleted after the consumer was written.","commonSituations":"Deploying stacks out of order (consumer before producer), a typo between the Outputs.Export.Name in one template and the Fn::ImportValue literal in another, or the producer stack having been deleted/recreated so the export no longer exists.","solutions":["List current exports: aws --endpoint-url http://localhost:4566 cloudformation list-exports and compare names character-by-character.","Deploy or fix the exporting (producer) stack first so its Outputs section exports the expected name.","If the export was lost to a restart (memory storage), redeploy the producer stack before the consumer.","For parameterized pipelines, pass the export name as a template parameter instead of hardcoding it, so the mismatch fails with a clearer message."],"exampleFix":"# before (producer missing export)\nOutputs:\n  BucketArn:\n    Value: !GetAtt Bucket.Arn   # no Export!\n\n# after\nOutputs:\n  BucketArn:\n    Value: !GetAtt Bucket.Arn\n    Export:\n      Name: shared-bucket-arn","handlingStrategy":"validation","validationCode":"// Before deploying the consumer, verify the export exists\nboolean exported = cfn.listExports(req -> {}).exports().stream()\n        .anyMatch(x -> x.name().equals(\"shared-bucket-arn\"));\nif (!exported) throw new IllegalStateException(\"Deploy producer stack first\");","typeGuard":null,"tryCatchPattern":"catch CloudFormationException with code ValidationError and message containing \"No export named\"; fail the deploy with a clear 'deploy the producer stack first' message — there is nothing to retry.","preventionTips":["Deploy producer stacks before consumer stacks in pipelines","Single-source export names as constants or parameters shared by both templates","Assert required exports exist in a pre-deploy step"],"tags":["cloudformation","fn-importvalue","exports","template"],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}