https://pulumi.com logo
#aws
Title
# aws
m

miniature-potato-84713

05/22/2021, 8:29 PM
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**
because
Copy code
Diagnostics:
  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
false
, 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)?
b

billowy-army-68599

05/22/2021, 8:38 PM
hey Jens! I think you need to run
pulumi refresh
- see this comment for more: https://github.com/pulumi/pulumi-aws/issues/308#issuecomment-415928729
m

miniature-potato-84713

05/22/2021, 8:53 PM
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.
b

billowy-army-68599

05/22/2021, 8:57 PM
m

miniature-potato-84713

05/22/2021, 9:03 PM
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
l

little-cartoon-10569

05/23/2021, 9:18 PM
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.
m

miniature-potato-84713

05/24/2021, 11:01 AM
Oh thanks for that, @little-cartoon-10569 Is there a better way to manage edge-replicated lambdas using Pūlumi?