Resource: aws_customerprofiles_domain

Terraform resource for managing an Amazon Customer Profiles Domain. See the Create Domain for more information.

Example Usage

resource "aws_customerprofiles_domain" "example" {
  domain_name = "example"
}

With SQS DLQ and KMS set

resource "aws_sqs_queue" "example" {
  name = "example"
  policy = jsonencode({
    Version = "2012-10-17"
    Statement = [
      {
        Sid    = "Customer Profiles SQS policy"
        Effect = "Allow"
        Action = [
          "sqs:SendMessage",
        ],
        Resource = "*"
        Principal = {
          Service = "profile.amazonaws.com"
        }
      },
    ]
  })
}

resource "aws_kms_key" "example" {
  description             = "example"
  deletion_window_in_days = 10
}

resource "aws_s3_bucket" "example" {
  bucket        = "example"
  force_destroy = true
}

resource "aws_s3_bucket_policy" "example" {
  bucket = aws_s3_bucket.example.id
  policy = jsonencode({
    Version = "2012-10-17"
    Statement = [
      {
        Sid    = "Customer Profiles S3 policy"
        Effect = "Allow"
        Action = [
          "s3:GetObject",
          "s3:PutObject",
          "s3:ListBucket",
        ]
        Resource = [
          aws_s3_bucket.example.arn,
          "${aws_s3_bucket.example.arn}/*",
        ]
        Principal = {
          Service = "profile.amazonaws.com"
        }
      },
    ]
  })
}

resource "aws_customerprofiles_domain" "test" {
  domain_name             = example
  dead_letter_queue_url   = aws_sqs_queue.example.id
  default_encryption_key  = aws_kms_key.example.arn
  default_expiration_days = 365
}

Argument Reference

The following arguments are required:

The following arguments are optional:

matching

The matching configuration block supports the following attributes:

rule_based_matching

The rule_based_matching configuration block supports the following attributes:

auto_merging

The auto_merging configuration block supports the following attributes:

conflict_resolution

The conflict_resolution configuration block supports the following attributes:

consolidation

The consolidation configuration block supports the following attributes:

exporting_config

The exporting_config configuration block supports the following attributes:

s3_exporting_config

The s3_exporting_config configuration block supports the following attributes:

job_schedule

The job_schedule configuration block supports the following attributes:

attribute_types_selector

The attribute_types_selector configuration block supports the following attributes:

matching_rules

The matching_rules configuration block supports the following attributes:

Attribute Reference

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

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import Amazon Customer Profiles Domain using the resource id. For example:

import {
  to = aws_customerprofiles_domain.example
  id = "e6f777be-22d0-4b40-b307-5d2720ef16b2"
}

Using terraform import, import Amazon Customer Profiles Domain using the resource id. For example:

% terraform import aws_customerprofiles_domain.example e6f777be-22d0-4b40-b307-5d2720ef16b2