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

EC2 instance type discovery #10989

Closed
ewbankkit opened this issue Nov 23, 2019 · 4 comments · Fixed by #13124
Closed

EC2 instance type discovery #10989

ewbankkit opened this issue Nov 23, 2019 · 4 comments · Fixed by #13124
Labels
new-data-source Introduces a new data source. service/ec2 Issues and PRs that pertain to the ec2 service.

Comments

@ewbankkit
Copy link
Contributor

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 "me too" comments, 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

Amazon EC2 makes it easier for customers to discover and compare EC2 instance types.
Customers can programmatically access instance type specifications using new APIs: DescribeInstanceTypes and DescribeInstanceTypeOfferings.

New or Affected Resource(s)

  • aws_instance_types
  • aws_instance_type

Potential Terraform Configuration

data "aws_instance_types" "nitro" {
  filter {
    name   = "hypervisor"
    values = ["nitro"]
  }
}

References

Announcement.
User guide.
API references:

Requires AWS SDK v1.25.41:

@ewbankkit ewbankkit added the enhancement Requests to existing resources that expand the functionality or scope. label Nov 23, 2019
@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Nov 23, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 23, 2019
@bflad bflad added new-data-source Introduces a new data source. and removed enhancement Requests to existing resources that expand the functionality or scope. needs-triage Waiting for first response or review from a maintainer. labels Feb 22, 2020
bflad added a commit that referenced this issue Feb 23, 2020
Reference: #10989

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSEc2InstanceTypeOfferingsDataSource_Filter (15.95s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingsDataSource_LocationType (17.38s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAWSEc2InstanceTypeOfferingsDataSource_Filter (21.98s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingsDataSource_LocationType (23.84s)
```
bflad added a commit that referenced this issue Feb 23, 2020
Reference: #10989

Output from acceptance testing:

```
--- PASS: TestAccAWSEc2InstanceTypeOfferingDataSource_PreferredInstanceTypes (15.95s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingDataSource_Filter (17.42s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingDataSource_LocationType (19.22s)
```
@bflad
Copy link
Contributor

bflad commented Feb 23, 2020

Submitted new data sources for EC2 Instance Type Offerings: #12139

bflad added a commit that referenced this issue Mar 4, 2020
…_type_offerings (#12139)

* New Data Source: aws_ec2_instance_type_offerings

Reference: #10989

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSEc2InstanceTypeOfferingsDataSource_Filter (15.95s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingsDataSource_LocationType (17.38s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAWSEc2InstanceTypeOfferingsDataSource_Filter (21.98s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingsDataSource_LocationType (23.84s)
```

* New Data Source: aws_ec2_instance_type_offering

Reference: #10989

Output from acceptance testing:

```
--- PASS: TestAccAWSEc2InstanceTypeOfferingDataSource_PreferredInstanceTypes (15.95s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingDataSource_Filter (17.42s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingDataSource_LocationType (19.22s)
```
@bflad
Copy link
Contributor

bflad commented Mar 4, 2020

Two new data sources:

  • New Data Source: aws_ec2_instance_type_offering
  • New Data Source: aws_ec2_instance_type_offerings

Have been merged and will release with version 2.52.0 of the Terraform AWS Provider, Thursday this week. Leaving this open for aws_ec2_instance_type/aws_ec2_instance_types implementations.

@helgi
Copy link

helgi commented Apr 8, 2020

I noticed in #12139 that the return values are mostly focused on instance_types and does not provide the location and location_type that https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instance-type-offerings.html offers. Was there a particular reason?

It is useful seeing what AZs are available for a given instance type within a region:

M4.xlarge in us-east-1
aws --region us-east-1 ec2 describe-instance-type-offerings --filters "Name=instance-type,Values=m4.xlarge" --location-type availability-zone returns us-east-1a, us-east-1b, us-east-1c, us-east-1d, and us-east-1e

where as M5.xlarge
aws --region us-east-1 ec2 describe-instance-type-offerings --filters "Name=instance-type,Values=m5.xlarge" --location-type availability-zone correctly excludes us-east-1e where it is not available.

One could imagine, through some hop jumping, you can get all AZs in a region, fetch the AZs for your instance type and then find the delta and pass into the blacklist for aws_availability_zones (with any additional filtering you need).

@ghost
Copy link

ghost commented Nov 7, 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 Nov 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-data-source Introduces a new data source. 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