Howdy! I’ve got a static website implementation v...
# aws
Howdy! I’ve got a static website implementation very close to the original Pūlumi example. However, now that I’m trying to
pulumi destroy
the stack, I receive an error that
**deleting failed**
Copy code
  aws:cloudfront:Distribution (cdn):
    error: deleting urn:pulumi:website-dev::website::aws:cloudfront/distribution:Distribution::cdn: CloudFront Distribution ED…W9 cannot be deleted: PreconditionFailed: The request failed because it didn't meet the preconditions in one or more request-header fields.
    	status code: 412, request id: 9180b51d-17da-4291-9399-38784fcf2f65
Before attempting to destroy, I changed all protect resource options (for all resources, not just the Distribution) to
, yet still the error occurs. Question: where can I find more information about the mentioned preconditions, and what does the request id refer to (is that a Pūlumi request id or an AWS request id)?
hey Jens! I think you need to run
pulumi refresh
- see this comment for more:
Ok, that worked and now I’m getting the next error:
Copy code
Error deleting Lambda Function: InvalidParameterValueException: Lambda was unable to delete arn:aws:lambda:us-east-1:48…5:function:language-redirect-9b04e25:12 because it is a replicated function. Please see our documentation for Deleting Lambda@Edge Functions and Replicas.
Looking for that documentation now, although here is AWS’s doc.
Hmm, so I ignore this error for now? Actually, finding the urn and deleting the lambda individually worked:
Copy code
> pulumi stack --show-urns
> pulumi state delete urn:pulumi:…
> pulumi destroy
That will have left the lambda in AWS (
pulumi state delete
removes a resource from Pulumi, not from the provider behind it). You'll need to delete the lambda through the console.
Oh thanks for that, @little-cartoon-10569 Is there a better way to manage edge-replicated lambdas using Pūlumi?