You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
traffic_filter_association resource gets deleted when doing plan/apply after being applied the first time.
Readiness Checklist
I am running the latest version
I checked the documentation and found no answer
I checked to make sure that this issue has not already been filed
I am reporting the issue to the correct repository (for multi-repository projects)
Expected Behavior
If no changes to terraform code have been made, terraform should NOT delete a resource in a following plan/apply run.
Current Behavior
I spun up a managed EC deployment with a traffic_filter and traffic_filter_association resources. Everything deploys ok.
When I do plan/apply a second time, the association gets removed. Apply again and it gets added.
I already destroyed and created everything on GCE and ES sides to reproduce the issue.
First plan:
# module.elasticsearch.ec_deployment_traffic_filter_association.elasticsearch will be created
+ resource "ec_deployment_traffic_filter_association" "elasticsearch" {
+ deployment_id = (known after apply)
+ id = (known after apply)
+ traffic_filter_id = (known after apply)
}
Second plan:
# module.elasticsearch.ec_deployment.elasticsearch will be updated in-place
~ resource "ec_deployment" "elasticsearch" {
id = "04add8bddea98dbac26a80e4ef579b97"
name = "fox2-elasticsearch"
tags = {}
~ traffic_filter = [
- "c02b53bc30a34b2db9017426fdccb28a",
]
# (6 unchanged attributes hidden)
# (2 unchanged blocks hidden)
}
Third plan:
Terraform will perform the following actions:
# module.elasticsearch.ec_deployment_traffic_filter_association.elasticsearch will be created
+ resource "ec_deployment_traffic_filter_association" "elasticsearch" {
+ deployment_id = "04add8bddea98dbac26a80e4ef579b97"
+ id = (known after apply)
+ traffic_filter_id = "c02b53bc30a34b2db9017426fdccb28a"
}
Plan: 1 to add, 0 to change, 0 to destroy.
I wonder if something gets updated in the traffic filter association after it is created by terraform.
## Terraform definition
data "ec_stack" "elasticsearch" {
version_regex = "latest"
region = "gcp-us-east-4"
}
resource "ec_deployment" "elasticsearch" {
name = "fox2-elasticsearch"
region = data.ec_stack.elasticsearch.region
version = data.ec_stack.elasticsearch.version
deployment_template_id = "gcp-storage-optimized"
elasticsearch {}
kibana {}
}
resource "ec_deployment_traffic_filter" "gcp_psc" {
name = "fox2-psc"
region = data.ec_stack.elasticsearch.region
type = "gcp_private_service_connect_endpoint"
description = "Endpoint for fox2 in GCP"
rule {
source = google_compute_forwarding_rule.elasticsearch.psc_connection_id
}
}
resource "ec_deployment_traffic_filter_association" "elasticsearch" {
traffic_filter_id = ec_deployment_traffic_filter.gcp_psc.id
deployment_id = ec_deployment.elasticsearch.id
}
Steps to Reproduce
Create an EC deployment
Create a traffic rule and traffic rule association for above deployment
terraform plan/apply
Repeat plan/apply and see how association gets destroyed
Context
This issue currently prevents automating a managed ES deployment.
Possible Solution
Your Environment
Provider version used: 0.4.1
ES version: 8.2.3 (latest)
Running against Elastic Cloud SaaS or Elastic Cloud Enterprise and version: 8.2.3
The text was updated successfully, but these errors were encountered:
ec provider 0.4.1
traffic_filter_association resource gets deleted when doing plan/apply after being applied the first time.
Readiness Checklist
Expected Behavior
If no changes to terraform code have been made, terraform should NOT delete a resource in a following plan/apply run.
Current Behavior
I spun up a managed EC deployment with a
traffic_filter
andtraffic_filter_association
resources. Everything deploys ok.When I do plan/apply a second time, the association gets removed. Apply again and it gets added.
I already destroyed and created everything on GCE and ES sides to reproduce the issue.
First plan:
Second plan:
Third plan:
I wonder if something gets updated in the traffic filter association after it is created by terraform.
## Terraform definition
Steps to Reproduce
Context
This issue currently prevents automating a managed ES deployment.
Possible Solution
Your Environment
The text was updated successfully, but these errors were encountered: