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

Add Support for Ignoring Changes to update_time in google_artifact_registry_repository resource #47

Open
oerd opened this issue Nov 26, 2024 · 0 comments · May be fixed by #48
Open

Add Support for Ignoring Changes to update_time in google_artifact_registry_repository resource #47

oerd opened this issue Nov 26, 2024 · 0 comments · May be fixed by #48

Comments

@oerd
Copy link

oerd commented Nov 26, 2024

First, thank you for maintaining this Terraform module. It's been very helpful for managing our GCP infrastructure.

Issue Summary:

We've encountered an issue related to the update_time attribute of the google_artifact_registry_repository resource when using this module to manage Google Artifact Registry repositories. Specifically, whenever we push Docker images to the Artifact Registry outside of Terraform (e.g., via CI/CD pipelines), the update_time attribute gets updated. This causes Terraform to detect changes made outside of its management and results in warnings during terraform plan or terraform apply operations.

Detailed Explanation:

Here's the warning we receive:

Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the last "terraform apply" which may have affected this plan:

  # module.artifact_registry.google_artifact_registry_repository.repo has changed
  ~ resource "google_artifact_registry_repository" "repo" {
        id                     = "projects/our-project-stage/locations/europe-west3/repositories/our-project-stage"
        name                   = "our-project-stage"
      ~ update_time            = "2024-11-25T15:25:53.371764Z" -> "2024-11-26T14:15:49.657338Z"
        # (other attributes omitted)
    }

Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to undo or respond to these changes.

This warning occurs because the update_time attribute changes whenever the repository is modified, including when new images are pushed. Since we cannot modify the module's code to add a lifecycle block that ignores changes to this attribute, we're unable to suppress these warnings.

@oerd oerd linked a pull request Nov 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant