Difference between revisions of "Terraform resource: aws ebs volume"

From wikieduonline
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
* https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ebs_volume
 
* https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ebs_volume
 +
 +
availability_zone - (Required) The [[AZ]] where the EBS volume will exist.
  
 
== Examples ==
 
== Examples ==
Line 9: Line 11:
 
   tags = {
 
   tags = {
 
     Name = "HelloWorld"
 
     Name = "HelloWorld"
 +
  }
 +
}
 +
 +
 +
 +
resource "aws_ebs_volume" "your_volume_name" {
 +
  [[availability_zone]] = [[aws_instance]].your_instance.availability_zone
 +
  [[size]]              = [[var.]]your_value == "XXXXX" ? 5000 : 4000
 +
 +
  tags = {
 +
    Name = "your-name-${var.env}-ebs"
 +
    Env  = [[var.]]env
 
   }
 
   }
 
  }
 
  }
Line 14: Line 28:
 
== Related ==
 
== Related ==
 
* [[ebs_block_device]] argument in resource and input in module
 
* [[ebs_block_device]] argument in resource and input in module
* <code>[[aws_volume_attachment]]</code>
+
* Terraform resource: <code>[[aws_volume_attachment]]</code>
 +
* [[Terraform resource: aws_ebs_snapshot]]
 +
* [[lsblk]]
  
 
== See also ==
 
== See also ==

Latest revision as of 11:45, 25 October 2024

Examples[edit]

Official example[edit]

resource "aws_ebs_volume" "example" {
  availability_zone = "us-west-2a"
  size              = 40

  tags = {
    Name = "HelloWorld"
  }
}


resource "aws_ebs_volume" "your_volume_name" {
  availability_zone = aws_instance.your_instance.availability_zone
  size              = var.your_value == "XXXXX" ? 5000 : 4000 

  tags = {
    Name = "your-name-${var.env}-ebs"
    Env  = var.env
  }
}

Related[edit]

See also[edit]

Advertising: