I am unable to stop destroy resource since lifecyle block is not recognizing
Please find below screenshot. Please assist on this, thanks
lifecycle is a Meta-Argument. Place it inside your resource block that you don’t want destroyed.
resource "aws_ami_user" "admin-user" {
# blah blah
lifecycle {
prevent_destroy = true
} # <--- lifecycle closing bracket
} # <----- resource closing bracket
Your pic shows the meta-argument is set up outside your resource block
Hi robcecc,
I have put the lifecycle block now inside the resource block, however it is still going to destroy the user. please assist further.
HI Robecc27,
I troubleshooted based on your suggestion, it worked. thank you.
You can ignore my previous comment.
Glad to hear you solved your issue! =)
Take Care!