pulumi-aws-native
pulumi-aws-native copied to clipboard
SES Template not deleted after delete
What happened?
Found when debugging https://github.com/pulumi/pulumi-aws-native/issues/834
If you replace an aws.ses.Template, the 'old' template will be listed by pulumi as deleted. However, it is not!
Expected Behavior
The template to have been deleted after being replaced.
Steps to reproduce
Create a template with:
const reminderEveryWeekTemplate = new aws.ses.Template("weekly-reminder-template", {template: {
templateName: "SomeName",
subjectPart: "SUBJECT",
textPart: "Hello",
htmlPart: "<b>Hello</b>",
}}, { replaceOnChanges: ["template.templateName"] }); // <-- replaceOnChanges added to trigger replacement as workaround on https://github.com/pulumi/pulumi-aws-native/issues/834
Then change the templateName value SomeName
into SomeOtherName
, re-run pulumi, check the output (should state "replaced"). Go to AWS SES service in the region it was created, click on "Email templates" and see that "SomeName" co-exists next to "SomeOtherName".
Output of pulumi about
Dependencies:
NAME VERSION
@pulumi/aws-native 0.52.0
@pulumi/pulumi 3.57.1
@pulumi/random 4.11.2
Additional context
Part of output, stating it is replaced:
Type Name Status Info
+- ├─ aws-native:ses:Template weekly-reminder-template replaced (2s) [diff: ~template]
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
I've just reproduced this locally with debugger attached and see the following:
-
DeleteResource
is called with:-
TypeName
:AWS::SES::Template
-
Identifier
:SomeName
-
ClientToken
set to relevant value -
RoleArn
:nil
-
- Delete result is OK
-
waitForResourceOpCompletion
returns progress event with:- ErrorCode: "NotFound"
- Identifier: *"SomeName"
- Operation: "DELETE"
- OperationStatus: "FAILED"
- ResourceModel: *string nil
- RetryAfter: *time.Time nil
- StatusMessage: *"Resource of type 'AWS::SES::Template' with identifier 'null' was not found."
- TypeName: *"AWS::SES::Template"
- We treat a "NotFound" during a delete operation as successful as it's already been deleted so we continue.
This appears it could be a service-side issue as I can confirm the resource is there in the console. Specifically, the response that comes back has the identifier set, but the error messge indicates they interpreted the identifier as null
.
This issue is not limited to replacements - all delete operations fail with NotFound.
Interestingly, in the console there is also no way to delete an SES template, so this might just be how SES templates work - they are not deletable. Awaiting confirmation from AWS as to root cause.
@danielrbradley thank you for your analysis. SES templates are deletable, but only through the cli (and the aws-classic pulumi package). Through the console SES template cannot be viewed, changed, created or delete.
Example code with aws-classic that does replace (delete) the template:
new awsClassic.ses.Template("weekly-reminder-template", {
name: "SomeName",
subject: "SUBJECT",
text: "Hello",
html: "<b>Hello</b>",
});
For the cli you have to use delete-template
link
Interesting, ok this just looks like an issue in CloudControl then
@danielrbradley has there been any feedback from your AWS ticket on the matter? I have no clue what the usual response times are from AWS with their Cloud Control service.
Unfortunately there's been no response yet.
@danielrbradley Has there been any feedback from AWS about this issue?
Still an issue. Created an issue upstream to track https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/2133