diff --git a/mmv1/templates/terraform/custom_import/dialogflowcx_flow.go.erb b/mmv1/templates/terraform/custom_import/dialogflowcx_flow.go.erb index 9710bd1d2b69..6deca14d0d1c 100644 --- a/mmv1/templates/terraform/custom_import/dialogflowcx_flow.go.erb +++ b/mmv1/templates/terraform/custom_import/dialogflowcx_flow.go.erb @@ -15,4 +15,9 @@ if err != nil { } d.SetId(id) +// Set is_default_start_flow if the resource is actually the Default Start Flow +if d.Get("name").(string) == "00000000-0000-0000-0000-000000000000" { + d.Set("is_default_start_flow", true) +} + return []*schema.ResourceData{d}, nil \ No newline at end of file diff --git a/mmv1/templates/terraform/custom_import/dialogflowcx_intent.go.erb b/mmv1/templates/terraform/custom_import/dialogflowcx_intent.go.erb index 9f7a00d23a7c..bf26d2f2de3d 100644 --- a/mmv1/templates/terraform/custom_import/dialogflowcx_intent.go.erb +++ b/mmv1/templates/terraform/custom_import/dialogflowcx_intent.go.erb @@ -15,4 +15,12 @@ } d.SetId(id) + // Set is_default_X if the resource is actually a Default Intent + if d.Get("name").(string) == "00000000-0000-0000-0000-000000000000" { + d.Set("is_default_welcome_intent", true) + } + if d.Get("name").(string) == "00000000-0000-0000-0000-000000000001" { + d.Set("is_default_negative_intent", true) + } + return []*schema.ResourceData{d}, nil \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/dialogflowcx_flow_default_start_flow.tf.erb b/mmv1/templates/terraform/examples/dialogflowcx_flow_default_start_flow.tf.erb index aca50d5b5978..19bda4f341dd 100644 --- a/mmv1/templates/terraform/examples/dialogflowcx_flow_default_start_flow.tf.erb +++ b/mmv1/templates/terraform/examples/dialogflowcx_flow_default_start_flow.tf.erb @@ -23,6 +23,7 @@ resource "google_dialogflow_cx_flow" "<%= ctx[:primary_resource_id] %>" { parent = google_dialogflow_cx_agent.agent.id is_default_start_flow = true display_name = "Default Start Flow" + description = "A start flow created along with the agent" nlu_settings { classification_threshold = 0.3 diff --git a/mmv1/third_party/terraform/services/dialogflowcx/resource_dialogflowcx_flow_test.go b/mmv1/third_party/terraform/services/dialogflowcx/resource_dialogflowcx_flow_test.go index a6d5c83a6b45..cd3cf4d5b83a 100644 --- a/mmv1/third_party/terraform/services/dialogflowcx/resource_dialogflowcx_flow_test.go +++ b/mmv1/third_party/terraform/services/dialogflowcx/resource_dialogflowcx_flow_test.go @@ -403,6 +403,7 @@ resource "google_dialogflow_cx_flow" "default_start_flow" { parent = google_dialogflow_cx_agent.agent.id is_default_start_flow = true display_name = "Default Start Flow" + description = "A start flow created along with the agent" nlu_settings { classification_threshold = 0.3