Provider sends empty project id for gitlab_project_security_policy_attachment during plan
# description I have terraform code that creates a gitlab project and then creates a security policy project attachment with an already existent security policy project. I am not creating the attachment on the group level but on the project level. But since the gitlab project does not yet exist, during plan the provider seems to try to validate the existence of the project by sending an empty string. Thus the error: # error message ``` Current user is not a member of the project ''. To apply a security policy, the token must be added as an Owner to the project. ``` # code snippet ``` resource "gitlab_project_security_policy_attachment" "project1" { count = var.use_gitlab_security_policy ? 1 : 0 project = gitlab_project.project1.id policy_project = var.security_policy_project_id } resource "gitlab_project" "project1" { name = var.project_name path = var.project_name namespace_id = var.parentgroup_id description = var.project_description default_branch = "main" visibility_level = "private" only_allow_merge_if_all_discussions_are_resolved = true remove_source_branch_after_merge = false container_registry_access_level = var.container_registry_access_level environments_access_level = var.environments_access_level model_experiments_access_level = var.model_experiments_access_level model_registry_access_level = var.model_registry_access_level packages_enabled = var.packages_enabled pages_access_level = var.pages_access_level releases_access_level = var.releases_access_level squash_option = var.squash_option } ``` # version info gitlabhq/gitlab version 18.9.0
issue