This template sets up an AWS KMS Key, a FinSpace Kx environment, an IAM role, and a FinSpace Kx user.

Terraform Template

resource "aws_finspace_kx_environment" "example" {
  kms_key_id = aws_kms_key.example.arn
  name = "my-tf-kx-environment"
}

resource "aws_finspace_kx_user" "example" {
  environment_id = aws_finspace_kx_environment.example.id
  iam_role = aws_iam_role.example.arn
  name = "my-tf-kx-user"
}

resource "aws_iam_role" "example" {
  assume_role_policy = jsonencode({
 Version = "2012-10-17"
 Statement = [
 {
 Action = "sts:AssumeRole"
 Effect = "Allow"
 Sid = ""
 Principal = {
 Service = "ec2.amazonaws.com"
 }
 },
 ]
 })
  name = "example-role"
}

resource "aws_kms_key" "example" {
  deletion_window_in_days = 7
  description = "Example KMS Key"
}