mirror of
https://github.com/floci-io/floci.git
synced 2026-12-02 09:47:56 -05:00
* fix(cloudformation): keep AWS::ApiGateway::RestApi on stack updates UpdateStack runs provision again for every resource, and the RestApi arm called CreateRestApi unconditionally. Each update minted a new API, pointed the stack at it and left the previous one behind, so the API id and invoke URL changed on every deploy. No RestApi property requires replacement, so an update now keeps the API from the previous provision and patches it in place: - Name and Description go through UpdateRestApi, and a template without Name keeps the name the API has. - A changed EndpointConfiguration is applied through the UpdateRestApi paths AWS documents for it, replace /endpointConfiguration/types/<type> and add or remove /endpointConfiguration/vpcEndpointIds, which UpdateRestApi now accepts under the rules CreateRestApi applies. - A Body or BodyS3Location is resolved before anything changes and is still applied with PutRestApi in overwrite mode. - RootResourceId comes from the API's root rather than the first resource listed, which is the root only on a freshly created API. - An API removed out of band is created again, as a replacement that a rollback deletes. The name, description and endpoint configuration are snapshotted before the patch, so a later resource that fails the update puts them back, and so does a Body that PutRestApi rejects. An update that re-applied a Body still reports that rollback is not implemented: PutRestApi replaced the API's resources, methods and models, which the snapshot does not hold. The Resources and Methods on the kept API rely on the update and delete handling from #4511. * fix(apigateway): accept the index form of the endpoint type patch path UpdateRestApi took replace /endpointConfiguration/types/<type> only when the path named the API's current type, as the API Gateway guide writes it. Terraform sends /endpointConfiguration/types/0 instead, which AWS accepts too, and Floci answered it with a 400. An API has exactly one endpoint type, so index 0 is accepted as well. * fix(cloudformation): reject more than one endpoint type on a RestApi update CreateRestApi rejects an EndpointConfiguration with more than one type, but an in-place update of AWS::ApiGateway::RestApi used the first type and reported success. The provisioner now rejects the list before it changes anything, with the same BadRequestException as CreateRestApi, and the stack rolls back with the API unchanged. * fix(cloudformation): delete a recreated RestApi whose OpenAPI body is rejected An update that recreates an API removed out of band, and whose Body putRestApi rejects, left the new API behind. After the failed update the stack keeps its previous resource, so nothing tracked the new API. The provisioner now deletes it before it reports the failure. * fix(cloudformation): list a recreated RestApi that cannot be deleted for cleanup When the delete of an API recreated by a failed update also fails, list that API for the next cleanup, which the restored resource inherits, and report the rollback failure, as Ec2NetworkCfnProvisioner does for a failed undo. * refactor(cloudformation): log the failed RestApi cleanup with warnv Use JBoss Logging's parameterized form, as AGENTS.md requires.