Create a Stack from Zip File

A Stack is a terraform configuration that you can use to provision and manage your OCI resources.

Note: : Ensure that you have added the ChatDataToBeTaggedFromEmoRoberta Report before applying the stack.
  1. Login to OCI tenancy.
  2. Open the navigation menu and click Developer Services. Under Resource Manager, click Stacks.
  3. Select the compartment as root (on the left side of the page).
  4. Click Create stack.

    The Create stack page opens, with the Stack information tab selected.

  5. In the Create stack page, under Choose the origin of the Terraform configuration, select My configuration.
  6. Create a zip of source code:
    1. Download the source code from servicecloud/chat_sentiment
    2. Zip terraform and jobs folders inside above repo
  7. Under Stack configuration:
    1. .Zip file: Drag and drop the .zip file onto the dialog's control or click Browse and navigate to the location of the .zip file you want.
  8. Fill the next fields as suggested in the below table:
    Field Value
    Use custom providers Not selected
    Name Stack name. You can accept the default name provided. Avoid entering confidential information.
    Description Stack description (optional).
    Create in compartment A compartment from the list scope is set by default. (Root compartment)
    Terraform version 1.2x
    Tags No need to update
  9. Click Next.

    The Configure variables panel lists variables from the Terraform configuration.

  10. Update the fields in Configure variables panel as suggested in below table:
    Field Description
    bucket_url Object storage name, you can accept the default name provided.
    compartment Compartment name, you can accept the default name
    domain CX B2C site domain
    dynamic_group

    Dynamic group name, you can accept the default name.

    When you create a dynamic group, rather than adding members explicitly to the group, you instead define a set of matching rules to define the group members

    emotion_ingestion_job_schedule_interval Number of days for which emotion ingestion should happen
    emotion_percentage_for_positive_samples Percentage by which positive samples should be added more than negative samples count
    emotion_percentage_for_neutral_samples Percentage by which neutral samples should be added more than negative samples count
    emotion_threshold Minimum predicted emotion threshold a sample should have to consider it as a valid one for training
    emotions_inactive_chat_status_update_interval Interval in which mark chat to inactive job should run and mark completed chats to inactive
    emotion_num_of_days_data_to_fetch Number of days for which chat data should be pulled from CX DB
    emotions_model_name Name of trained model
    emotions_training_job_schedule_interval Interval in which train job should run
    group

    Group name, you can accept the default name.

    When creating a group, you must provide a unique, unchangeable name for the group. The name must be unique across all groups within your tenancy

    ingestion_job_shape VM Shape for data ingestion job, you can accept the default
    authorization_oauth_cx_rest_api_key Base64 encoded private key pair of the public certificate added in .net console for sso user
    authorization_type The type of authorization needs to use while ingesting the data. (BASIC | OAUTH)
    authorization_basic_b2c_auth Base64 encoded basic auth of api user. Required only if the authorization_type is BASIC
    authorization_oauth_entity OAUTH entity which is a unique id given in .net console as Entity ID in OAUTH tab of SSO configuration.
    authorization_oauth_path OAUTH path is url path in .net console as Custom Audience URL in OAUTH tab of SSO configuration
    authorization_oauth_user Username of user with a profile having SSO login enabled
    network_private_subnet_cidr_block 10.0.1.0/24
    network_public_subnet_cidr_block 10.0.0.0/24
    region Tenancy home region
    tenancy_ocid Tenancy OCID
    vault_id Vault id created in step "Create OCI vault in root compartment"
  11. Review the variables and change as needed.
  12. Click Next.
  13. In the Review panel, verify your stack configuration.
  14. Click Create to create your stack.
  15. The stack is created, and its Stack details page opens.

Run job in Resource Manager

A Job is created when you run a Terraform action on a stack. Use these Terraform actions to plan, apply and destroy your OCI resources according to your configuration.

After creating stack, you can run job in Resource Manager, such as Plan, Apply, Destroy

Running a plan job parses your Terraform configuration and converts it into an execution plan for the associated stack. The execution plan lists the sequence of specific actions planned to provision your Oracle Cloud Infrastructure resources, including actions that are expected after running an apply job.

  1. Navigate to Stack details page.
  2. Click Plan. The plan job is created. The new job is listed under Jobs.

Running an apply job for a stack, terraform provisions the resources and executes the actions defined in your Terraform configuration, applying the execution plan to the associated stack to create (or modify) your Oracle Cloud Infrastructure resources.

  1. Navigate to Stack details page.
  2. Click Apply. The Apply job is created. The new job is listed under Jobs.
Note: The Apply job might take hours to complete depending on the size of Incident data which the Ingestion job has to pull.

Running a destroy job in Resource Manager to release (tear down) resources associated with a stack and clean up the tenancy. Released resources are not deleted.

  1. Navigate to Stack details page.
  2. Click Destroy. The Destroy job is created. The new job is listed under Jobs.
Note: Object storage bucket consists of customer data fetched using ingestion job which should be manually deleted before running destroy job:
  • Vault secrets will be deleted only after a day and Master Encryption Keys will be deleted only after a week. (System defined minimum timeframe)
  • Compartments should be manually deleted after deleting all the resources inside the compartment.

For information on debugging Terraform creation, see Debug Terraform Deployment Logs.