Resource: aws_evidently_launch

Provides a CloudWatch Evidently Launch resource.

Example Usage

Basic

resource "aws_evidently_launch" "example" {
  name    = "example"
  project = aws_evidently_project.example.name

  groups {
    feature   = aws_evidently_feature.example.name
    name      = "Variation1"
    variation = "Variation1"
  }

  scheduled_splits_config {
    steps {
      group_weights = {
        "Variation1" = 0
      }
      start_time = "2024-01-07 01:43:59+00:00"
    }
  }
}

With description

resource "aws_evidently_launch" "example" {
  name        = "example"
  project     = aws_evidently_project.example.name
  description = "example description"

  groups {
    feature   = aws_evidently_feature.example.name
    name      = "Variation1"
    variation = "Variation1"
  }

  scheduled_splits_config {
    steps {
      group_weights = {
        "Variation1" = 0
      }
      start_time = "2024-01-07 01:43:59+00:00"
    }
  }
}

With multiple groups

resource "aws_evidently_launch" "example" {
  name    = "example"
  project = aws_evidently_project.example.name

  groups {
    feature     = aws_evidently_feature.example.name
    name        = "Variation1"
    variation   = "Variation1"
    description = "first-group"
  }

  groups {
    feature     = aws_evidently_feature.example.name
    name        = "Variation2"
    variation   = "Variation2"
    description = "second-group"
  }

  scheduled_splits_config {
    steps {
      group_weights = {
        "Variation1" = 0
        "Variation2" = 0
      }
      start_time = "2024-01-07 01:43:59+00:00"
    }
  }
}

With metric_monitors

resource "aws_evidently_launch" "example" {
  name    = "example"
  project = aws_evidently_project.example.name

  groups {
    feature   = aws_evidently_feature.example.name
    name      = "Variation1"
    variation = "Variation1"
  }

  metric_monitors {
    metric_definition {
      entity_id_key = "entity_id_key1"
      event_pattern = "{\"Price\":[{\"numeric\":[\">\",11,\"<=\",22]}]}"
      name          = "name1"
      unit_label    = "unit_label1"
      value_key     = "value_key1"
    }
  }

  metric_monitors {
    metric_definition {
      entity_id_key = "entity_id_key2"
      event_pattern = "{\"Price\":[{\"numeric\":[\">\",9,\"<=\",19]}]}"
      name          = "name2"
      unit_label    = "unit_label2"
      value_key     = "value_key2"
    }
  }

  scheduled_splits_config {
    steps {
      group_weights = {
        "Variation1" = 0
      }
      start_time = "2024-01-07 01:43:59+00:00"
    }
  }
}

With randomization_salt

resource "aws_evidently_launch" "example" {
  name               = "example"
  project            = aws_evidently_project.example.name
  randomization_salt = "example randomization salt"

  groups {
    feature   = aws_evidently_feature.example.name
    name      = "Variation1"
    variation = "Variation1"
  }

  scheduled_splits_config {
    steps {
      group_weights = {
        "Variation1" = 0
      }
      start_time = "2024-01-07 01:43:59+00:00"
    }
  }
}

With multiple steps

resource "aws_evidently_launch" "example" {
  name    = "example"
  project = aws_evidently_project.example.name

  groups {
    feature   = aws_evidently_feature.example.name
    name      = "Variation1"
    variation = "Variation1"
  }

  groups {
    feature   = aws_evidently_feature.example.name
    name      = "Variation2"
    variation = "Variation2"
  }

  scheduled_splits_config {
    steps {
      group_weights = {
        "Variation1" = 15
        "Variation2" = 10
      }
      start_time = "2024-01-07 01:43:59+00:00"
    }

    steps {
      group_weights = {
        "Variation1" = 20
        "Variation2" = 25
      }
      start_time = "2024-01-08 01:43:59+00:00"
    }
  }
}

With segment overrides

resource "aws_evidently_launch" "example" {
  name    = "example"
  project = aws_evidently_project.example.name

  groups {
    feature   = aws_evidently_feature.example.name
    name      = "Variation1"
    variation = "Variation1"
  }

  groups {
    feature   = aws_evidently_feature.example.name
    name      = "Variation2"
    variation = "Variation2"
  }

  scheduled_splits_config {
    steps {
      group_weights = {
        "Variation1" = 0
        "Variation2" = 0
      }

      segment_overrides {
        evaluation_order = 1
        segment          = aws_evidently_segment.example.name

        weights = {
          "Variation2" = 10000
        }
      }

      segment_overrides {
        evaluation_order = 2
        segment          = aws_evidently_segment.example.name

        weights = {
          "Variation1" = 40000
          "Variation2" = 30000
        }
      }

      start_time = "2024-01-08 01:43:59+00:00"
    }
  }
}

Argument Reference

This resource supports the following arguments:

groups

The groups block supports the following arguments:

metric_monitors

The metric_monitors block supports the following arguments:

metric_definition

The metric_definition block supports the following arguments:

scheduled_splits_config

The scheduled_splits_config block supports the following arguments:

steps

The steps block supports the following arguments:

segment_overrides

Timeouts

Configuration options:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

execution

The execution block supports the following attributes:

Import

In Terraform v1.5.0 and later, use an import block to import CloudWatch Evidently Launch using the name of the launch and name of the project or arn of the hosting CloudWatch Evidently Project separated by a :. For example:

Import using the name of the launch and name of the project separated by a ::

import {
  to = aws_evidently_launch.example
  id = "exampleLaunchName:exampleProjectName"
}

Import using the name of the launch and arn of the project separated by a ::

import {
  to = aws_evidently_launch.example
  id = "exampleLaunchName:arn:aws:evidently:us-east-1:123456789012:project/exampleProjectName"
}

Using terraform import to import CloudWatch Evidently Launch using the name of the launch and name of the project or arn of the hosting CloudWatch Evidently Project separated by a :. For example:

Import using the name of the launch and name of the project separated by a ::

% terraform import aws_evidently_launch.example exampleLaunchName:exampleProjectName

Import using the name of the launch and arn of the project separated by a ::

% terraform import aws_evidently_launch.example exampleLaunchName:arn:aws:evidently:us-east-1:123456789012:project/exampleProjectName