Skip to content

Latest commit

 

History

History
175 lines (137 loc) · 3.05 KB

aws_ebs_volume.md

File metadata and controls

175 lines (137 loc) · 3.05 KB

aws_ebs_volume

back

Index

Terraform

terraform {
  required_providers {
    aws = ">= 3.35.0"
  }
}

top

Example Usage

module "aws_ebs_volume" {
  source = "./modules/aws/d/aws_ebs_volume"

  # most_recent - (optional) is a type of bool
  most_recent = null
  # tags - (optional) is a type of map of string
  tags = {}

  filter = [{
    name   = null
    values = []
  }]
}

top

Variables

variable "most_recent" {
  description = "(optional)"
  type        = bool
  default     = null
}

variable "tags" {
  description = "(optional)"
  type        = map(string)
  default     = null
}

variable "filter" {
  description = "nested block: NestingSet, min items: 0, max items: 0"
  type = set(object(
    {
      name   = string
      values = list(string)
    }
  ))
  default = []
}

top

Datasource

data "aws_ebs_volume" "this" {
  # most_recent - (optional) is a type of bool
  most_recent = var.most_recent
  # tags - (optional) is a type of map of string
  tags = var.tags

  dynamic "filter" {
    for_each = var.filter
    content {
      # name - (required) is a type of string
      name = filter.value["name"]
      # values - (required) is a type of list of string
      values = filter.value["values"]
    }
  }

}

top

Outputs

output "arn" {
  description = "returns a string"
  value       = data.aws_ebs_volume.this.arn
}

output "availability_zone" {
  description = "returns a string"
  value       = data.aws_ebs_volume.this.availability_zone
}

output "encrypted" {
  description = "returns a bool"
  value       = data.aws_ebs_volume.this.encrypted
}

output "id" {
  description = "returns a string"
  value       = data.aws_ebs_volume.this.id
}

output "iops" {
  description = "returns a number"
  value       = data.aws_ebs_volume.this.iops
}

output "kms_key_id" {
  description = "returns a string"
  value       = data.aws_ebs_volume.this.kms_key_id
}

output "multi_attach_enabled" {
  description = "returns a bool"
  value       = data.aws_ebs_volume.this.multi_attach_enabled
}

output "outpost_arn" {
  description = "returns a string"
  value       = data.aws_ebs_volume.this.outpost_arn
}

output "size" {
  description = "returns a number"
  value       = data.aws_ebs_volume.this.size
}

output "snapshot_id" {
  description = "returns a string"
  value       = data.aws_ebs_volume.this.snapshot_id
}

output "tags" {
  description = "returns a map of string"
  value       = data.aws_ebs_volume.this.tags
}

output "throughput" {
  description = "returns a number"
  value       = data.aws_ebs_volume.this.throughput
}

output "volume_id" {
  description = "returns a string"
  value       = data.aws_ebs_volume.this.volume_id
}

output "volume_type" {
  description = "returns a string"
  value       = data.aws_ebs_volume.this.volume_type
}

output "this" {
  value = aws_ebs_volume.this
}

top