mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(msk): return BadRequestException when a configuration ARN does not exist (#2572)
* fix(msk): return BadRequestException when a configuration ARN does not exist Real MSK reports an unknown or deleted configuration ARN as BadRequestException (400) with a message containing "Configuration ARN does not exist", not NotFoundException (404). terraform-provider-aws (and the Pulumi provider bridging it) substring-matches exactly that code and message to detect a deleted configuration, so with the 404 the provider's post-delete waiter never recognizes the configuration as gone and every terraform/pulumi destroy of aws_msk_configuration fails. All configuration operations resolve ARNs through MskService#describeConfiguration, so Describe/Update/Delete and the revision actions now share the corrected error shape. Cluster APIs are untouched: real MSK does use NotFoundException there. * test(msk): assert status, message and error-type header on unknown-ARN update tests
This commit is contained in:
1 parent
399bf20387
commit
247bd590bc
3 files changed
+45
-10
No files matched your search
@@ -162,8 +162,13 @@ public class MskService implements ResourceProvider {
|
||||
}
|
||||
|
||||
public MskConfiguration describeConfiguration(String arn) {
|
||||
// Real MSK reports an unknown configuration ARN as BadRequestException (400), not
|
||||
// NotFoundException. The message prefix is a compatibility contract: terraform-provider-aws
|
||||
// (and the Pulumi provider bridging it) substring-matches "Configuration ARN does not exist"
|
||||
// to detect that a configuration is gone, so its post-delete waiter can complete.
|
||||
return configurationStorage.get(arn)
|
||||
.orElseThrow(() -> new AwsException("NotFoundException", "Configuration not found: " + arn, 404));
|
||||
.orElseThrow(() -> new AwsException("BadRequestException",
|
||||
"Configuration ARN does not exist: " + arn, 400));
|
||||
}
|
||||
|
||||
public PaginatedResult<MskConfiguration> listConfigurations(Integer maxResults, String nextToken) {
|
||||
|
||||
Reference in new issue
Block a user