hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.75k stars 9.1k forks source link

aws_fsx_lustre_file_system fails to create resource with "BadRequest: Invalid Lustre deployment configuration: the provided throughput is invalid or does not meet the storage capacity requirement"" #24341

Open Optikx187 opened 2 years ago

Optikx187 commented 2 years ago

Community Note

Terraform CLI and Terraform AWS Provider Version

Affected Resource(s)

Terraform Configuration Files

resource "aws_fsx_lustre_file_system" "fsx" {
  #import_path      = "s3://${aws_s3_bucket.example.bucket}"
  #storage_capacity                  = "${var.fsxl_storage}"
  storage_capacity                  = "1200"
  #subnet_ids                        = [data.terraform_remote_state.vpc.outputs.vpc_private_subnet_id[0],data.terraform_remote_state.vpc.outputs.vpc_private_subnet_id[1],data.terraform_remote_state.vpc.outputs.vpc_private_subnet_id[2]]
  security_group_ids                = [data.terraform_remote_state.sg.outputs.lustre_private]
  subnet_ids                        = [data.terraform_remote_state.vpc.outputs.vpc_private_subnet_id[0]]
  #deployment_type                   = "${var.fsxl_deployment_type}"
  deployment_type                   = "PERSISTENT_2"
  automatic_backup_retention_days   = "${var.fsxl_automatic_backup_retention_days}"
  daily_automatic_backup_start_time = "${var.fsxl_daily_automatic_backup_start_time}"
  #per_unit_storage_throughput       = "${var.fsxl_throughput}"
  per_unit_storage_throughput       = "250"
}

variable "fsxl_storage"{
  description = "Capacity for fsx"
  type        = string
  default     = "2400" 
}
variable "fsxl_deployment_type"{
  description = "lustre deployment type"
  type        = string
  default     = "PERSISTENT_2" 
}
variable "fsxl_automatic_backup_retention_days"{
  description = "retention days"
  type        = string
  default     = "30" 
}
variable "fsxl_daily_automatic_backup_start_time"{
  description = "daily backup "
  type        = string
  default     = "03:00" 
}
variable "fsxl_throughput"{
  description = "throughput"
  type        = string
  default     = "125" 
}

terraform {
 required_providers {
   aws = {
     source  = "hashicorp/aws"
     version = "~> 4.10.0"
   }
 }
}
#requires aws configure and profile
provider "aws" {
 region = local.region
 shared_credentials_file = "/home/ec2-user/.aws/credentials"
 profile = local.profile
}

Debug Output

Panic Output

Expected Behavior

fsx lustr resource created

Actual Behavior

Terraform errors with:

╷
│ Error: error creating FSx Lustre File System: BadRequest: Invalid Lustre deployment configuration: the provided throughput is invalid or does not meet the storage capacity requirement. See documentation https://docs.aws.amazon.com/fsx/latest/LustreGuide/getting-started-step1.html
│ 
│   with aws_fsx_lustre_file_system.fsx,
│   on fsx_lustre.tf line 4, in resource "aws_fsx_lustre_file_system" "fsx":
│    4: resource "aws_fsx_lustre_file_system" "fsx" {
│ 
╵

Steps to Reproduce

  1. terraform apply

Important Factoids

The AWS account is hosted in govcloud-west

References

DrFaust92 commented 2 years ago

Not sure this is a bug, The error comes from the server side from the combination of arguments. but cross referencing this with AWS docs everything looks in order and acceptance tests for PERSISTENT_2 look similar. can you try combo of 1200 for storage capacity and 125 for unit? im curios if this fails for you as well. (as this combo passes in acceptance tests)

tinuzz commented 2 years ago

PERSISTENT_2 is not available in every region, see https://docs.aws.amazon.com/fsx/latest/LustreGuide/using-fsx-lustre.html near the bottom of the page.

If you try to create a PERSISTENT_2 filesystem in an unsupported region, you will get this error, regardless of the configured throughput per unit.

If you use the AWS console to create a Lustre FSx filesystem in a region where PERSISTENT_2 is unsupported and you choose the 'Persistent SSD' option,, you can choose between 50, 100 and 200 MB/s per TB, which are the documented values for PERSISTENT_1.

This screenshot is from the Stockholm (eu-north-1) region, that does not support PERSISTENT_2:

Fsx_lustre_Stockholm

github-actions[bot] commented 1 week ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!