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

Refactor wrong lifecycle customization description for datasource #35246

Open
dancer1325 opened this issue May 27, 2024 · 1 comment
Open

Refactor wrong lifecycle customization description for datasource #35246

dancer1325 opened this issue May 27, 2024 · 1 comment
Labels
documentation new new issue not yet triaged

Comments

@dancer1325
Copy link

Terraform Version

At least v1.7X

Affected Pages

https://developer.hashicorp.com/terraform/language/data-sources#lifecycle-customizations

What is the docs issue?

You can read

Data resources do not have any customization settings available for their lifecycle. However, the lifecycle block is reserved for future versions.

and at least from v1.7.x, and as it's indicated also in the tutorial https://developer.hashicorp.com/terraform/tutorials/configuration-language/custom-conditions#add-a-postcondition, you can declare

data "aws_vpc" "app" {
  id = var.aws_vpc_id

  lifecycle {
    postcondition {
      condition     = self.enable_dns_support == true
      error_message = "The selected VPC must have DNS support enabled."      
    }
  }
}

Proposal

Make some reference that you can customize as resource. A proposal could be something like

Data resources can customize their lifecycle as resource

References

No response

@crw
Copy link
Collaborator

crw commented Jun 3, 2024

Thanks for this docs request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants