mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 22:37:55 -05:00
fix(cloudformation): create stage from AWS::ApiGateway::Deployment inline StageName (#1400)
AWS::ApiGateway::Deployment accepts an inline StageName; previously the deployment was created but the stage was not, so get-stages returned empty and invoking .../{stage}/_user_request_/... returned Stage not found. Now create the stage (with StageDescription.Description when present) bound to the new deployment.
Refs #1163
This commit is contained in:
1 parent
d77f11abbb
commit
f01a680bff
2 files changed
+86
No files matched your search
+14
@@ -2601,6 +2601,20 @@ public class CloudFormationResourceProvisioner {
|
||||
|
||||
var deployment = apiGatewayService.createDeployment(region, apiId, req);
|
||||
r.setPhysicalId(deployment.id());
|
||||
|
||||
// AWS::ApiGateway::Deployment accepts an inline StageName: when present, AWS creates that
|
||||
// stage pointing at this deployment, with no separate AWS::ApiGateway::Stage resource.
|
||||
String stageName = resolveOptional(props, "StageName", engine);
|
||||
if (stageName != null && !stageName.isBlank()) {
|
||||
Map<String, Object> stageReq = new HashMap<>();
|
||||
stageReq.put("stageName", stageName);
|
||||
stageReq.put("deploymentId", deployment.id());
|
||||
JsonNode stageDescription = props != null ? props.get("StageDescription") : null;
|
||||
if (stageDescription != null && stageDescription.has("Description")) {
|
||||
stageReq.put("description", resolveOptional(stageDescription, "Description", engine));
|
||||
}
|
||||
apiGatewayService.createStage(region, apiId, stageReq);
|
||||
}
|
||||
}
|
||||
|
||||
private void provisionApiGatewayStage(StackResource r, JsonNode props, CloudFormationTemplateEngine engine,
|
||||
|
||||
Reference in new issue
Block a user