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

[Enhancement]: Option to skip iops validation for unknown ebs volume types #39838

Open
willgorman opened this issue Oct 22, 2024 · 1 comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. needs-triage Waiting for first response or review from a maintainer. service/ebs Issues and PRs that pertain to the ebs service. service/ec2ebs Issues and PRs that pertain to the ec2ebs service.

Comments

@willgorman
Copy link

willgorman commented Oct 22, 2024

Description

The provider currently prevents iops from being set on volume types other than io1, io2, and gp3:

// Iops is required for io1 and io2 volumes.
// The default for gp3 volumes is 3,000 IOPS.
// This parameter is not supported for gp2, st1, sc1, or standard volumes.
// Hard validation in place to return an error if IOPs are provided
// for an unsupported storage type.
// Reference: https://github.com/hashicorp/terraform-provider-aws/issues/12667
switch volumeType {
case awstypes.VolumeTypeIo1, awstypes.VolumeTypeIo2:
if iops == 0 {
return fmt.Errorf("'iops' must be set when 'type' is '%s'", volumeType)
}
case awstypes.VolumeTypeGp3:
default:
if iops != 0 {
return fmt.Errorf("'iops' must not be set when 'type' is '%s'", volumeType)
}
}

This presents a problem when using the provider with alternate backends that support the AWS EBS APIs but offer additional volume types, some of which do allow specifying provisioned iops. The purpose for this issue is to see if there is support for opening a PR that makes it possible to allow iops to be provided for other volume types. The implementation for this PR could be one of the following:

  • Allow iops to be provided for any volume type that is not one of the official AWS volume types
  • Support a flag/option/environment variable that allows a user to provide a list of volume types that support iops
  • Support a flag/option/environment variable that disables the volume type check

This would also be beneficial if AWS adds another new volume type in the future that supports provisioned iops. Currently the provider would have to be updated to allow iops to be used with the new volume type but with this change it would be possible to use the new volume type without upgrading the provider version.

Affected Resource(s) and/or Data Source(s)

  • aws_ebs_volume

Potential Terraform Configuration

resource "aws_ebs_volume" "a-volume" {
  availability_zone = "us-east-1a"
  size              = 50
  type              = "definitely-not-an-aws-volume-type"
  iops              = 5000
}

References

No response

Would you like to implement a fix?

Yes

@willgorman willgorman added the enhancement Requests to existing resources that expand the functionality or scope. label Oct 22, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/ebs Issues and PRs that pertain to the ebs service. service/ec2ebs Issues and PRs that pertain to the ec2ebs service. needs-triage Waiting for first response or review from a maintainer. labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. needs-triage Waiting for first response or review from a maintainer. service/ebs Issues and PRs that pertain to the ebs service. service/ec2ebs Issues and PRs that pertain to the ec2ebs service.
Projects
None yet
Development

No branches or pull requests

1 participant