aoffpo / dialogflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DialogFlow

This terraforms the autogenerated "Small Talk" IVR in DialogFlow CX

Setup

(1) Create and configure service account under IAM Service Accounts.
(2) Add principal to service account and assign Service Account Token Creator role by clicking Grant Access under Permissions.
(2) Enable IAM and DialogFlow APIs. (3) Activate account:
gcloud auth activate-service-account default@dialogflow-371521.iam.gserviceaccount.com --key-file=svc_account.json

Import existing agent into Terraform

  • Agent
    • terraform import google_dialogflow_cx_agent.default projects/dialogflow-371521/locations/us-east1/agents/71a127f4-46a9-43ee-89b1-a82cdbf942ef or
    • terraform import google_dialogflow_cx_agent.default us-east1/71a127f4-46a9-43ee-89b1-a82cdbf942ef
  • Flow
    • terraform import google_dialogflow_cx_flow.default projects/dialogflow-371521/locations/us-east1/agents/71a127f4-46a9-43ee-89b1-a82cdbf942ef/flows/00000000-0000-0000-0000-000000000000 or
    • terraform import google_dialogflow_cx_flow.default us-east1/71a127f4-46a9-43ee-89b1-a82cdbf942ef/flows/00000000-0000-0000-0000-000000000000
  • Pages
    • terraform import google_dialogflow_cx_page.request projects/dialogflow-371521/locations/us-east1/agents/71a127f4-46a9-43ee-89b1-a82cdbf942ef/flows/00000000-0000-0000-0000-000000000000/pages/df20b17b-91ed-48df-9465-27eb234f21e5
    • Fulfillments (Agent Responses)
    • Routes
    • Route Groups
    • Parameters
    • Event Handlers
    • Transition
  • Intents (User Input)
    • Retrieve intents from imported transition routes and import them.
    • Note, these are built-in intents provided by DialogFlow, so they are just included here for illustration
    • Scoping the intent to the agent by setting the parent property will create these intents under the agent.
    • If this is desired, DO NOT import the global intents as they will be destroyed when you add the parent.
    • terraform import module.dialogflow_intents.google_dialogflow_cx_intent.default_welcome_intent projects/dialogflow-371521/locations/us-east1/agents/71a127f4-46a9-43ee-89b1-a82cdbf942ef/intents/00000000-0000-0000-0000-000000000000
    • terraform import module.dialogflow_intents.google_dialogflow_cx_intent.good_morning projects/dialogflow-371521/locations/us-east1/agents/71a127f4-46a9-43ee-89b1-a82cdbf942ef/intents/deb24824-d38f-43ce-8938-760b4f55ea12
    • terraform import module.dialogflow_intents.google_dialogflow_cx_intent.good_evening projects/dialogflow-371521/locations/us-east1/agents/71a127f4-46a9-43ee-89b1-a82cdbf942ef/intents/b56f10cd-29b4-4b9f-98f5-afb73d1ad913
    • terraform import module.dialogflow_intents.google_dialogflow_cx_intent.hello projects/dialogflow-371521/locations/us-east1/agents/71a127f4-46a9-43ee-89b1-a82cdbf942ef/intents/9832593b-3df1-4702-a763-429550d8fa1c
    • terraform import module.dialogflow_intents.google_dialogflow_cx_intent.thank_you projects/dialogflow-371521/locations/us-east1/agents/71a127f4-46a9-43ee-89b1-a82cdbf942ef/intents/cf62f60f-0348-482e-9e70-170cd27b0fc1
    • terraform import module.dialogflow_intents.google_dialogflow_cx_intent.bye projects/dialogflow-371521/locations/us-east1/agents/71a127f4-46a9-43ee-89b1-a82cdbf942ef/intents/dca73282-4d03-44c2-91c9-a073cb8f172b Update resource definition in main.tf, then terraform plan to test that the configuration matches what is already in DialogFlow.

About


Languages

Language:HCL 61.1%Language:Python 33.7%Language:Shell 5.2%