Creates an AWS CodeArtifact repository within a domain that uses a KMS key for encryption.

Terraform Template

resource "aws_codeartifact_domain" "example" {
  domain = "example"
  encryption_key = aws_kms_key.example.arn
}

resource "aws_codeartifact_repository" "test" {
  domain = aws_codeartifact_domain.example.domain
  repository = "example"
}

resource "aws_kms_key" "example" {
  description = "domain key"
}