Open laksh-bhat opened 1 year ago
@laksh-bhat are you able to see if other tools (like gcloud) work as you expected?
Yes, gcloud
works as expected.
gcloud datastream private-connections delete 'datastream-conn' --location=us-central1 --force --quiet
Deleted private_connection [datastream-conn].
@laksh-bhat I do see force
is available in below api but I am not sure if that should be implemented in the Terraform. 1) For use case, how do you manage those child routes? If they are created via Terraform, you better continue let Terraform to manage deletion. 2) Implementing force
seems against the pattern, as Terraform is more declarative.
If you want this feature, you may file an enhancement and then it will be triaged. This is not a bug and I am closing it accordingly.
I understand this may seem like an anti-pattern for terraform but the private connections
API doesn't allow us to manage the routes explicitly (you set a subnet and private VPC through a peering config).
resource "google_datastream_private_connection" "private_vpc_datastream_conn" {
# This resource must have an IP range with a minimum CIDR block of /29
# https://cloud.google.com/datastream/docs/create-a-private-connectivity-configuration
display_name = "datastream private connection"
project = var.project
location = var.region
private_connection_id = "${var.region}-${var.cell}-${var.env}-datastream-conn"
vpc_peering_config {
vpc = var.private_network_id
subnet = var.datastream_subnet_cidr
}
}
The routes created by this, hence, aren't in terraform state. I strongly urge you to reconsider this decision to not implement the force
flag @edwardmedia. Without this flag, the resource is pretty much useless.
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.
Note from triage: Reopening to track the request to add a field for configuring force
to send to the API at deletion time. This should use a deletion_policy
field - see https://googlecloudplatform.github.io/magic-modules/best-practices/#deletion-policy
I ran into this too. Is there an update on how to use terraform to delete google_datastream_private_connection
resource? Without the ability to delete, the resource is pretty much useless.
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
1.3.4
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
terraform apply -var-file="$TFVARS_FILE" -destroy
is successfulActual Behavior
Steps to Reproduce
terraform apply -var-file="$TFVARS_FILE" -destroy
Important Factoids
References
10810
b/336319220