@@ -63,6 +63,35 @@ func TestAccDialogflowConversationProfile_update(t *testing.T) {
6363 })
6464}
6565
66+ func TestAccDialogflowConversationProfile_regional (t * testing.T ) {
67+ t .Parallel ()
68+
69+ context := map [string ]interface {}{
70+ "org_id" : envvar .GetTestOrgFromEnv (t ),
71+ "billing_account" : envvar .GetTestBillingAccountFromEnv (t ),
72+ "random_suffix" : acctest .RandString (t , 10 ),
73+ }
74+
75+ acctest .VcrTest (t , resource.TestCase {
76+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
77+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
78+ ExternalProviders : map [string ]resource.ExternalProvider {
79+ "time" : {},
80+ },
81+ Steps : []resource.TestStep {
82+ {
83+ Config : testAccDialogflowConversationProfile_dialogflowRegional (context ),
84+ },
85+ {
86+ ResourceName : "google_dialogflow_conversation_profile.profile" ,
87+ ImportState : true ,
88+ ImportStateVerify : true ,
89+ ImportStateVerifyIgnore : []string {"location" , "logging_config" , "logging_config.0" , "logging_config.0.enable_stackdriver_logging" },
90+ },
91+ },
92+ })
93+ }
94+
6695func testAccDialogflowConversationProfile_dialogflowAgentFull1 (context map [string ]interface {}) string {
6796 return acctest .Nprintf (`
6897 resource "google_project" "agent_project" {
@@ -246,6 +275,7 @@ func testAccDialogflowConversationProfile_dialogflowAgentFull1(context map[strin
246275 }
247276` , context )
248277}
278+
249279func testAccDialogflowConversationProfile_dialogflowAgentFull2 (context map [string ]interface {}) string {
250280 return acctest .Nprintf (`
251281 resource "google_project" "agent_project" {
@@ -409,3 +439,63 @@ func testAccDialogflowConversationProfile_dialogflowAgentFull2(context map[strin
409439 }
410440` , context )
411441}
442+
443+ func testAccDialogflowConversationProfile_dialogflowRegional (context map [string ]interface {}) string {
444+ return acctest .Nprintf (`
445+ resource "google_project" "agent_project" {
446+ name = "tf-test-dialogflow-%{random_suffix}"
447+ project_id = "tf-test-dialogflow-%{random_suffix}"
448+ org_id = "%{org_id}"
449+ billing_account = "%{billing_account}"
450+ deletion_policy = "DELETE"
451+ }
452+ resource "google_project_service" "agent_project" {
453+ project = "${google_project.agent_project.id}"
454+ service = "dialogflow.googleapis.com"
455+ disable_dependent_services = false
456+ }
457+
458+ resource "google_service_account" "dialogflow_service_account" {
459+ account_id = "tf-test-dialogflow-%{random_suffix}"
460+ }
461+
462+ resource "google_project_iam_member" "agent_create" {
463+ project = "${google_project.agent_project.id}"
464+ role = "roles/dialogflow.admin"
465+ member = "serviceAccount:${google_service_account.dialogflow_service_account.email}"
466+ }
467+
468+ resource "google_dialogflow_agent" "agent" {
469+ display_name = "tf-test-agent-%{random_suffix}"
470+ default_language_code = "en-us"
471+ time_zone = "America/New_York"
472+ project = google_project.agent_project.name
473+ }
474+
475+ resource "google_pubsub_topic" "topic_diff" {
476+ name = "tf-test-topic-%{random_suffix}-diff"
477+ project = google_project.agent_project.project_id
478+ depends_on = [google_project.agent_project, time_sleep.wait_120_seconds]
479+ message_retention_duration = "8000s"
480+ }
481+ resource "google_dialogflow_cx_security_settings" "security_setting_diff" {
482+ display_name = "tf-test-setting-%{random_suffix}-diff"
483+ location = "us-central1"
484+ purge_data_types = []
485+ retention_window_days = 7
486+ project = google_project.agent_project.project_id
487+ depends_on = [time_sleep.wait_120_seconds]
488+ }
489+ resource "time_sleep" "wait_120_seconds" {
490+ create_duration = "120s"
491+ depends_on = [google_dialogflow_agent.agent]
492+ }
493+ resource "google_dialogflow_conversation_profile" "profile" {
494+ depends_on = [google_dialogflow_agent.agent, google_dialogflow_cx_security_settings.security_setting_diff, time_sleep.wait_120_seconds]
495+ project = "${google_project.agent_project.name}"
496+ display_name = "tf-test-conversation-profile-%{random_suffix}-new"
497+ location = "us-central1"
498+ language_code = "en-US"
499+ }
500+ ` , context )
501+ }
0 commit comments