Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to use lifecycle block in the module. Pls guide me with example. #343

Closed
mkanna opened this issue Jun 3, 2021 · 6 comments
Closed

Comments

@mkanna
Copy link

mkanna commented Jun 3, 2021

Description

Please provide a clear and concise description of the issue you are encountering, your current setup, and what steps led up to the issue. If you can provide a reproduction, that will help tremendously.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

  • Terraform:
  • Provider(s):
  • Module:

Reproduction

Steps to reproduce the behavior:

Code Snippet to Reproduce

Expected behavior

Actual behavior

Terminal Output Screenshot(s)

Additional context

@mkanna
Copy link
Author

mkanna commented Jun 3, 2021

lifecycle {
ignore_changes = [
"snapshot_identifier",
]
}

@antonbabenko
Copy link
Member

This is not supported by Terraform.

@mkanna
Copy link
Author

mkanna commented Jun 4, 2021

Hello, Thank you for replying back. Could you please help in understanding why it is not possible to use lifecycle block in this module? with TF resources it is straightforward but unable to understand the complexity behind using lifecycle block with the AWS rds module.
Could you please point me to the link if this has already been raised and closed?

Thanks for your time.

@antonbabenko
Copy link
Member

This is a limitation of Terraform, we can't do anything about it here in the module. Here are the main issues with solid details - hashicorp/terraform#27360
hashicorp/terraform#4149

@ghost
Copy link

ghost commented Feb 7, 2022

@mkanna as an alternative, you can just remove the snapshot_identifier argument from your module's calls and your instances won't be affected. Not ideal but the best option.
https://github.com/hashicorp/terraform-provider-aws/pull/18013/files

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants