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

tests/service/rds: Remove hardcoded aws_db_instance instance types in EC2-Classic #15182

Closed
bflad opened this issue Sep 16, 2020 · 2 comments · Fixed by #15184
Closed

tests/service/rds: Remove hardcoded aws_db_instance instance types in EC2-Classic #15182

bflad opened this issue Sep 16, 2020 · 2 comments · Fixed by #15184
Assignees
Labels
service/rds Issues and PRs that pertain to the rds service. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Sep 16, 2020

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

Description

Relevant test failures:

=== CONT  TestAccAWSDBInstance_ec2Classic
TestAccAWSDBInstance_ec2Classic: resource_aws_db_instance_test.go:2248: Step 1/1 error: terraform failed: exit status 1
stderr:
Error: Error creating DB Instance: InsufficientDBInstanceCapacity: Cannot create a db.m5.large database instance because there are no availability zones with sufficient capacity for non-VPC and storage type : gp2 for db.m5.large. Please try the request again at a later time.
  status code: 400, request id: 5bc39058-0571-4f63-bb80-c25533285646
--- FAIL: TestAccAWSDBInstance_ec2Classic (5.31s)

=== CONT  TestAccAWSDbInstanceDataSource_ec2Classic
TestAccAWSDbInstanceDataSource_ec2Classic: data_source_aws_db_instance_test.go:51: Step 1/1 error: terraform failed: exit status 1
stderr:
Error: Error creating DB Instance: InsufficientDBInstanceCapacity: Cannot create a db.m5.large database instance because there are no availability zones with sufficient capacity for non-VPC and storage type : gp2 for db.m5.large. Please try the request again at a later time.
  status code: 400, request id: 38414095-00df-4a5d-ba25-241b5c400ef6
--- FAIL: TestAccAWSDbInstanceDataSource_ec2Classic (15.24s)

In our main testing account, the following EC2-Classic instance types are available:

$ aws --region us-east-1 rds describe-orderable-db-instance-options --engine mysql --no-vpc | jq '.OrderableDBInstanceOptions[].DBInstanceClass' | sort -u
"db.m3.2xlarge"
"db.m3.large"
"db.m3.medium"
"db.m3.xlarge"
"db.r3.2xlarge"
"db.r3.4xlarge"
"db.r3.8xlarge"
"db.r3.large"
"db.r3.xlarge"

Switching to the new aws_rds_orderable_db_instance data source should help here, preferring a few of these options.

New or Affected Resource(s)

  • aws_db_instance

Potential Terraform Configuration

data "aws_rds_orderable_db_instance" "test" {
  engine                     = "mysql"
  engine_version             = "5.6.41"
  preferred_instance_classes = ["db.m3.medium", "db.m3.large", "db.r3.large"]
}

resource "aws_db_instance" "bar" {
  # ... other configuration ...

  engine         = data.aws_rds_orderable_db_instance.test.engine
  engine_version = data.aws_rds_orderable_db_instance.test.engine_version
  instance_class = data.aws_rds_orderable_db_instance.test.instance_class
}

References

@bflad bflad added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/rds Issues and PRs that pertain to the rds service. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels Sep 16, 2020
@bflad bflad added this to the v3.7.0 milestone Sep 16, 2020
@bflad bflad self-assigned this Sep 16, 2020
bflad added a commit that referenced this issue Sep 16, 2020
… tests and basic data source test

Reference: #15182

Previously:

```
=== CONT  TestAccAWSDBInstance_ec2Classic
TestAccAWSDBInstance_ec2Classic: resource_aws_db_instance_test.go:2248: Step 1/1 error: terraform failed: exit status 1
stderr:
Error: Error creating DB Instance: InsufficientDBInstanceCapacity: Cannot create a db.m5.large database instance because there are no availability zones with sufficient capacity for non-VPC and storage type : gp2 for db.m5.large. Please try the request again at a later time.
  status code: 400, request id: 5bc39058-0571-4f63-bb80-c25533285646
--- FAIL: TestAccAWSDBInstance_ec2Classic (5.31s)

=== CONT  TestAccAWSDbInstanceDataSource_ec2Classic
TestAccAWSDbInstanceDataSource_ec2Classic: data_source_aws_db_instance_test.go:51: Step 1/1 error: terraform failed: exit status 1
stderr:
Error: Error creating DB Instance: InsufficientDBInstanceCapacity: Cannot create a db.m5.large database instance because there are no availability zones with sufficient capacity for non-VPC and storage type : gp2 for db.m5.large. Please try the request again at a later time.
  status code: 400, request id: 38414095-00df-4a5d-ba25-241b5c400ef6
--- FAIL: TestAccAWSDbInstanceDataSource_ec2Classic (15.24s)
```

Output from acceptance testing:

```
--- PASS: TestAccAWSDbInstanceDataSource_basic (617.92s)
--- PASS: TestAccAWSDbInstanceDataSource_ec2Classic (456.35s)

--- PASS: TestAccAWSDBInstance_ec2Classic (406.18s)
```
@bflad bflad modified the milestones: v3.7.0, v3.8.0 Sep 17, 2020
bflad added a commit that referenced this issue Sep 17, 2020
… tests and basic data source test (#15184)

Reference: #15182

Previously:

```
=== CONT  TestAccAWSDBInstance_ec2Classic
TestAccAWSDBInstance_ec2Classic: resource_aws_db_instance_test.go:2248: Step 1/1 error: terraform failed: exit status 1
stderr:
Error: Error creating DB Instance: InsufficientDBInstanceCapacity: Cannot create a db.m5.large database instance because there are no availability zones with sufficient capacity for non-VPC and storage type : gp2 for db.m5.large. Please try the request again at a later time.
  status code: 400, request id: 5bc39058-0571-4f63-bb80-c25533285646
--- FAIL: TestAccAWSDBInstance_ec2Classic (5.31s)

=== CONT  TestAccAWSDbInstanceDataSource_ec2Classic
TestAccAWSDbInstanceDataSource_ec2Classic: data_source_aws_db_instance_test.go:51: Step 1/1 error: terraform failed: exit status 1
stderr:
Error: Error creating DB Instance: InsufficientDBInstanceCapacity: Cannot create a db.m5.large database instance because there are no availability zones with sufficient capacity for non-VPC and storage type : gp2 for db.m5.large. Please try the request again at a later time.
  status code: 400, request id: 38414095-00df-4a5d-ba25-241b5c400ef6
--- FAIL: TestAccAWSDbInstanceDataSource_ec2Classic (15.24s)
```

Output from acceptance testing:

```
--- PASS: TestAccAWSDbInstanceDataSource_basic (617.92s)
--- PASS: TestAccAWSDbInstanceDataSource_ec2Classic (456.35s)

--- PASS: TestAccAWSDBInstance_ec2Classic (406.18s)
```
@ghost
Copy link

ghost commented Sep 24, 2020

This has been released in version 3.8.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 Oct 18, 2020

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 Oct 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/rds Issues and PRs that pertain to the rds service. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
1 participant