include::../description.adoc[]

include::../ask-yourself.adoc[]

include::../recommended.adoc[]

== Sensitive Code Example

For https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ebs_volume[aws_ebs_volume]:
[source,terraform]
----
resource "aws_ebs_volume" "ebs_volume" {  # Sensitive as encryption is disabled by default
}
----
[source,terraform]
----
resource "aws_ebs_volume" "ebs_volume" {
  encrypted = false  # Sensitive
}
----

For https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ebs_encryption_by_default[aws_ebs_encryption_by_default]:
[source,terraform]
----
resource "aws_ebs_encryption_by_default" "default_encryption" {
  enabled = false  # Sensitive
}
----

For https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/launch_configuration[aws_launch_configuration]:

[source,terraform]
----
resource "aws_launch_configuration" "launch_configuration" {
  root_block_device {  # Sensitive as encryption is disabled by default
  }
  ebs_block_device {  # Sensitive as encryption is disabled by default
  }
}
----

[source,terraform]
----
resource "aws_launch_configuration" "launch_configuration" {
  root_block_device {
    encrypted = false  # Sensitive
  }
  ebs_block_device {
    encrypted = false  # Sensitive
  }
}
----

== Compliant Solution

For https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ebs_volume[aws_ebs_volume]:

[source,terraform]
----
resource "aws_ebs_volume" "ebs_volume" {
  encrypted = true
}
----

For https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ebs_encryption_by_default[aws_ebs_encryption_by_default]:

[source,terraform]
----
resource "aws_ebs_encryption_by_default" "default_encryption" {
  enabled = true  # Optional, default is "true"
}
----

For https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/launch_configuration[aws_launch_configuration]:

[source,terraform]
----
resource "aws_launch_configuration" "launch_configuration" {
  root_block_device {
    encrypted = true
  }
  ebs_block_device {
    encrypted = true
  }
}
----

include::../see.adoc[]

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

endif::env-github,rspecator-view[]