Difference between revisions of "Terraform resource: aws ebs volume"
Jump to navigation
Jump to search
Line 9: | Line 9: | ||
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 | ||
} | } | ||
} | } |
Revision as of 09:49, 29 May 2023
Examples
Official example
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
- ebs_block_device argument in resource and input in module
aws_volume_attachment
See also
- Terraform EC2 resources:
aws_instance, aws_ebs_volume, aws_volume_attachment, aws_ec2_tag
, Terraform module:ec2-instance
,ebs_block_device
,argument/input
aws ec2 [ describe-volumes | create-volume | modify-volume | detach-volume ]
- Terraform AWS: provider, resources, modules, data sources, VPC, IAM, Net, EC2, S3, Route53, ACM, CloudWatch, SES, RDS, ECS,
awscc, autoscaling, EKS
Advertising: