SNS `delete_endpoint` is not idempotent
DiegoHDMGZ opened this issue · comments
The AWS documentation states that delete_endpoint
is idempotent. However, moto raises a NotFoundException
when attempting to delete an endpoint that was already deleted.
Example code:
client = boto3.client("sns")
platform_application_arn = client.create_platform_application(
Name="test",
Platform="GCM",
Attributes={},
)["PlatformApplicationArn"]
token = "test-token"
endpoint_arn = client.create_platform_endpoint(
PlatformApplicationArn=platform_application_arn,
Token=token,
)["EndpointArn"]
client.delete_endpoint(EndpointArn=endpoint_arn) # Works as expected
client.delete_endpoint(EndpointArn=endpoint_arn) # Raises NotFoundException
Expected result: The last call to delete_endpoint
should not raise an exception
Moto version: 5.0.3
Hi @DiegoHDMGZ, thanks for raising this - I'll open a PR with a fix.