Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.25.0 breaks aws_ebs_volume with size": only one of size,snapshot_id can be specified #17235

Closed
dbgeek opened this issue Jan 22, 2021 · 4 comments · Fixed by #17243
Closed
Assignees
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@dbgeek
Copy link
Contributor

dbgeek commented Jan 22, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

terraform -v
Terraform v0.14.5
+ provider registry.terraform.io/hashicorp/aws v3.25.0

Affected Resource(s)

  • aws_ebs_volume

Terraform Configuration Files

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.0"
    }
  }
  required_version = ">= 0.14"
}

resource "aws_ebs_volume" "ebs_volume" {
  availability_zone = "eu-west-1a"
  size              = 16
  type              = "gp3"
  snapshot_id       = "snap-0fb629cbb0446b995"
  encrypted         = true
}
```

### Actual Behavior

```
Error: ExactlyOne

  on main.tf line 13, in resource "aws_ebs_volume" "ebs_volume":
  13:   size              = 16

"size": only one of `size,snapshot_id` can be specified, but
`size,snapshot_id` were specified.


Error: ExactlyOne

  on main.tf line 15, in resource "aws_ebs_volume" "ebs_volume":
  15:   snapshot_id       = "snap-0fb629cbb0446b995"

"snapshot_id": only one of `size,snapshot_id` can be specified, but
`size,snapshot_id` were specified.
```

### Steps to Reproduce

try to create EBS volume that specifies both size and snapshotid
main.tf 
```
resource "aws_ebs_volume" "ebs_volume" {
  availability_zone = "eu-west-1a"
  size              = 16
  type              = "gp3"
  snapshot_id       = "snap-0fb629cbb0446b995"
  encrypted         = true
}
```

1. `terraform plan`

### References

This change is what breaks it
https://github.com/hashicorp/terraform-provider-aws/blob/master/aws/resource_aws_ebs_volume.go#L68

AWS API supports both size & snapshot. Size should just be equal to or larger than snapshot size
https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html

ping @ewbankkit 
@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Jan 22, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 22, 2021
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 22, 2021
@ewbankkit
Copy link
Contributor

ewbankkit commented Jan 22, 2021

@dbgeek Thanks for raising this issue.
Indeed, that does seem to be the case, which conflicts with the statement in the same paragraph 😭:

You must specify either a snapshot ID or a volume size.

Relates:

@bflad
Copy link
Contributor

bflad commented Jan 26, 2021

The fix for this has been merged and will release with version 3.26.0 of the Terraform AWS Provider, on Thursday. 👍

@ghost
Copy link

ghost commented Jan 28, 2021

This has been released in version 3.26.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Feb 25, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants