BOM - AWS EBS

  • Query id: 86571149-eef3-4280-a645-01e60df854b0
  • Query name: BOM - AWS EBS
  • Platform: Terraform
  • Severity: Trace
  • Category: Bill Of Materials
  • URL: Github

Description

A list of EBS resources found. Amazon Elastic Block Store (Amazon EBS) is an easy-to-use, scalable, high-performance block-storage service designed for Amazon Elastic Compute Cloud (Amazon EC2).
Documentation

Code samples

Code samples with security vulnerabilities

Positive test num. 1 - tf file
resource "aws_ebs_volume" "positive1" {
  availability_zone = "us-west-2a"
  size              = 40

  tags = {
    Name = "HelloWorld"
  }
}
Positive test num. 2 - tf file
resource "aws_ebs_volume" "positive2" {
  availability_zone = "us-west-2a"
  size              = 40

  tags = {
    Name = "HelloWorld2"
  }

  encrypted = true
}

Code samples without security vulnerabilities

Negative test num. 1 - tf file
variable "web_type" {
  description = "Size/type of the host."
  default     = "m5.large"
}

module "ebs_optimized" {
  source        = "terraform-aws-modules/ebs-optimized/aws"
  version = "~> 2.0"
  instance_type = var.web_type
}

resource "aws_instance" "web" {
  ami           = data.aws_ami.ubuntu.id
  instance_type = var.web_type
  ebs_optimized = module.ebs_optimized.answer
}