AWS X-Ray Encryption Config

This page shows how to write Terraform for X-Ray Encryption Config and write them securely.

aws_xray_encryption_config (Terraform)

The Encryption Config in X-Ray can be configured in Terraform with the resource name aws_xray_encryption_config. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

xray_encryption_config.tf#L4
resource "aws_xray_encryption_config" "xray_encryption_config" {
  count = var.enable_xray_encryption_config ? 1 : 0

  type = var.xray_encryption_config_type

  key_id = var.xray_encryption_config_key_id
xray_encryption_config.tf#L4
resource "aws_xray_encryption_config" "xray_encryption_config" {
  count = var.enable_xray_encryption_config ? 1 : 0

  type = var.xray_encryption_config_type

  key_id = var.xray_encryption_config_key_id
main.tf#L7
resource "aws_xray_encryption_config" "this" {
  key_id = var.key_id
  type   = var.type
}

main.tf#L1
resource "aws_xray_encryption_config" "test" {
  type = "NONE"
}
main.tf#L5
resource "aws_xray_encryption_config" "test" {
  type = "NONE"
}

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

  • id optional computed - string
  • key_id optional - string
  • type required - string

Explanation in Terraform Registry

Creates and manages an AWS XRay Encryption Config.

NOTE: Removing this resource from Terraform has no effect to the encryption configuration within X-Ray.

CloudFormation Example

CloudFormation code does not have the related resource.

Frequently asked questions

What is AWS X-Ray Encryption Config?

AWS X-Ray Encryption Config is a resource for X-Ray of Amazon Web Service. Settings can be wrote in Terraform.

Where can I find the example code for the AWS X-Ray Encryption Config?

For Terraform, the asrkata/SebastianUA-terraform, SebastianUA/terraform and niveklabs/aws source code examples are useful. See the Terraform Example section for further details.

security-icon

Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.