Creates a CloudFront public key and a field-level encryption profile using that key, specifically encrypting the 'DateOfBirth' field.

Terraform Template

resource "aws_cloudfront_field_level_encryption_profile" "test" {
  comment = "test comment"
  name = "test profile"
}

resource "aws_cloudfront_public_key" "example" {
  comment = "test public key"
  encoded_key = file("public_key.pem")
  name = "test_key"
}