Skip to content

Latest commit

 

History

History
259 lines (198 loc) · 12.3 KB

File metadata and controls

259 lines (198 loc) · 12.3 KB
page_title subcategory description
epilot-entitymapping_entity_mapping Resource - terraform-provider-epilot-entitymapping
EntityMapping Resource

epilot-entitymapping_entity_mapping (Resource)

EntityMapping Resource

Example Usage

resource "epilot-entitymapping_entity_mapping" "my_entitymapping" {
  id = "70542580-2b38-4bfc-af8d-bb90102f9f47"
  source = {
    config = {
      entity_ref = {
        entity_id     = "...my_entity_id..."
        entity_schema = "submission"
      }
      journey_ref = {
        journey_id = "...my_journey_id..."
      }
    }
    type = "journey"
  }
  targets = [
    {
      allow_failure               = true
      condition_mode              = "{ \"see\": \"documentation\" }"
      conditions                  = "{ \"see\": \"documentation\" }"
      id                          = "...my_id..."
      linkback_relation_attribute = "...my_linkback_relation_attribute..."
      linkback_relation_tags = [
        "..."
      ]
      loop_config = {
        length      = 8.78
        source_path = "...my_source_path..."
      }
      mapping_attributes = [
        {
          any = "{ \"see\": \"documentation\" }"
          mapping_attribute = {
            append_value_mapper = {
              mode   = "copy_if_exists"
              source = "...my_source..."
              target = "...my_target..."
              target_unique = [
                "..."
              ]
              value_json = "...my_value_json..."
            }
            copy_value_mapper = {
              mode   = "copy_if_exists"
              source = "...my_source..."
              target = "...my_target..."
            }
            set_value_mapper = {
              mode   = "set_value"
              target = "...my_target..."
              value  = "{ \"see\": \"documentation\" }"
            }
          }
        }
      ]
      name = "...my_name..."
      relation_attributes = [
        {
          mode   = "prepend"
          origin = "entity_updating_system_recommendation"
          related_to = {
            "see" : jsonencode("documentation"),
          }
          source_filter = {
            attribute    = "...my_attribute..."
            limit        = 5
            relation_tag = "...my_relation_tag..."
            schema       = "...my_schema..."
            self         = false
            tag          = "...my_tag..."
          }
          target = "...my_target..."
          target_tags = [
            "..."
          ]
          target_tags_include_source = false
        }
      ]
      target_schema = "...my_target_schema..."
      target_unique = [
        "..."
      ]
    }
  ]
}

Schema

Required

  • id (String) Mapping Config Id. Requires replacement if changed.
  • source (Attributes) Requires replacement if changed. (see below for nested schema)
  • targets (Attributes List) Requires replacement if changed. (see below for nested schema)

Read-Only

  • version (Number)

Nested Schema for source

Optional:

  • config (Attributes) Requires replacement if changed. (see below for nested schema)
  • type (String) must be one of ["journey", "entity"]; Requires replacement if changed.

Nested Schema for source.config

Optional:

Nested Schema for source.config.entity_ref

Optional:

  • entity_id (String) id of the source entity to be mapped. Not Null; Requires replacement if changed.
  • entity_schema (String) schema of the source entity. Requires replacement if changed.

Nested Schema for source.config.journey_ref

Optional:

  • journey_id (String) Requires replacement if changed.

Nested Schema for targets

Optional:

  • allow_failure (Boolean) Pass it as true, when you don't want failures to interrupt the mapping process. Requires replacement if changed.
  • condition_mode (String) Requires replacement if changed.; Parsed as JSON.
  • conditions (String) Requires replacement if changed.; Parsed as JSON.
  • id (String) Identifier for target configuration. Useful for later usages when trying to identify which target config to map to. Requires replacement if changed.
  • linkback_relation_attribute (String) Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback. Default: "mapped_entities"; Requires replacement if changed.
  • linkback_relation_tags (List of String) Relation tags (labels) to include in main entity linkback relation attribute. Requires replacement if changed.
  • loop_config (Attributes) contains config in case of running in loop mode. Requires replacement if changed. (see below for nested schema)
  • mapping_attributes (Attributes List) Attribute mappings. Not Null; Requires replacement if changed. (see below for nested schema)
  • name (String) A name for this configuration. Requires replacement if changed.
  • relation_attributes (Attributes List) Relation mappings. Requires replacement if changed. (see below for nested schema)
  • target_schema (String) Schema of target entity. Not Null; Requires replacement if changed.
  • target_unique (List of String) Unique key for target entity (see upsertEntity of Entity API). Requires replacement if changed.

Nested Schema for targets.loop_config

Optional:

  • length (Number) a hard limit of how many times the loop is allowed to run. Requires replacement if changed.
  • source_path (String) path to the array from the entity payload. Requires replacement if changed.

Nested Schema for targets.mapping_attributes

Optional:

  • any (String) Requires replacement if changed.; Parsed as JSON.
  • mapping_attribute (Attributes) Requires replacement if changed. (see below for nested schema)

Nested Schema for targets.mapping_attributes.mapping_attribute

Optional:

Nested Schema for targets.mapping_attributes.mapping_attribute.append_value_mapper

Optional:

  • mode (String) - copy_if_exists - it replaces the target attribute with the source value - append_if_exists - it currently replaces target attribute with array like values. Useful when you have multiple values to be added into one attribute. - set_value - it sets a value to a predefined value. Must be used together with value property. Not Null; must be one of ["copy_if_exists", "append_if_exists", "set_value"]; Requires replacement if changed.
  • source (String) JSON source path for the value to be extracted from the main entity. Eg: steps[1].['Product Info'].price. Requires replacement if changed.
  • target (String) JSON like target path for the attribute. Eg. last_name. Not Null; Requires replacement if changed.
  • target_unique (List of String) Array of keys which should be used when checking for uniqueness. Eg: [country, city, postal_code]. Requires replacement if changed.
  • value_json (String) To be provided only when mapping json objects into a target attribute. Eg array of addresses. Not Null; Requires replacement if changed.

Nested Schema for targets.mapping_attributes.mapping_attribute.copy_value_mapper

Optional:

  • mode (String) - copy_if_exists - it replaces the target attribute with the source value - append_if_exists - it currently replaces target attribute with array like values. Useful when you have multiple values to be added into one attribute. - set_value - it sets a value to a predefined value. Must be used together with value property. Not Null; must be one of ["copy_if_exists", "append_if_exists", "set_value"]; Requires replacement if changed.
  • source (String) JSON source path for the value to be extracted from the main entity. Eg: steps[1].['Product Info'].price. Not Null; Requires replacement if changed.
  • target (String) JSON like target path for the attribute. Eg. last_name. Not Null; Requires replacement if changed.

Nested Schema for targets.mapping_attributes.mapping_attribute.set_value_mapper

Optional:

  • mode (String) - copy_if_exists - it replaces the target attribute with the source value - append_if_exists - it currently replaces target attribute with array like values. Useful when you have multiple values to be added into one attribute. - set_value - it sets a value to a predefined value. Must be used together with value property. Not Null; must be one of ["copy_if_exists", "append_if_exists", "set_value"]; Requires replacement if changed.
  • target (String) JSON like target path for the attribute. Eg. last_name. Not Null; Requires replacement if changed.
  • value (String) Any value to be set: string, number, string[], number[], JSON object, etc. It will override existing values, if any. Not Null; Requires replacement if changed.; Parsed as JSON.

Nested Schema for targets.relation_attributes

Optional:

  • mode (String) Not Null; must be one of ["append", "prepend", "set"]; Requires replacement if changed.
  • origin (String) Origin of an attribute. must be one of ["system_recommendation", "user_manually", "entity_updating_system_recommendation"]; Requires replacement if changed.
  • related_to (Map of String) Requires replacement if changed.
  • source_filter (Attributes) A filter to identify which source entities to pick as relations from main entity. Requires replacement if changed. (see below for nested schema)
  • target (String) Target attribute to store the relation in. Not Null; Requires replacement if changed.
  • target_tags (List of String) Relation tags (labels) to set for the stored relations. Requires replacement if changed.
  • target_tags_include_source (Boolean) Include all relation tags (labels) present on the main entity relation. Default: false; Requires replacement if changed.

Nested Schema for targets.relation_attributes.source_filter

Optional:

  • attribute (String) Filter by a specific relation attribute on the main entity. Requires replacement if changed.
  • limit (Number) Limit relations to maximum number (default, all matched relations). Requires replacement if changed.
  • relation_tag (String) Filter by relation tag (label) on the main entity. Requires replacement if changed.
  • schema (String) Filter by specific schema. Requires replacement if changed.
  • self (Boolean) Picks main entity as relation (overrides other filters). Default: false; Requires replacement if changed.
  • tag (String) Filter by a specific tag on the related entity. Requires replacement if changed.

Import

Import is supported using the following syntax:

terraform import epilot-entitymapping_entity_mapping.my_epilot-entitymapping_entity_mapping "70542580-2b38-4bfc-af8d-bb90102f9f47"