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

[New Resource]: Add Capacity Block for AWS EC2 Capacity Reservation #35358

Open
prabhavpawar opened this issue Jan 18, 2024 · 2 comments · May be fixed by #37528
Open

[New Resource]: Add Capacity Block for AWS EC2 Capacity Reservation #35358

prabhavpawar opened this issue Jan 18, 2024 · 2 comments · May be fixed by #37528
Labels
new-resource Introduces a new resource. service/ec2 Issues and PRs that pertain to the ec2 service.

Comments

@prabhavpawar
Copy link

prabhavpawar commented Jan 18, 2024

Description

AWS recently launch the p5 generation of instance types, along with a new feature (only supported for p5 so far) to book a 'capacity block' - essentially a forward start date reservation. [currently supported only in Ohio]. Ref

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

Data Source: aws_ec2_describe_capacity_block_offerings
Resource: aws_ec2_purchase_capacity_block_reservation

Potential Terraform Configuration

data "aws_ec2_describe_capacity_block_offerings" "default" {
  instance_type 		= "p5.48xlarge"
  instance_count 		= 16 
  start_date_range 		= "2024-01-14T00:00:00Z"
  end_date_range 		= "2023-03-22-T00:00:00Z" 
  capacity-duration 	        = 48
}

resource "aws_ec2_purchase_capacity_block_reservation" "default" {
  # capacity_block_offering_id = "cbr-0123456789abcdefg" 
  capacity_block_offering_id = data.aws_ec2_describe_capacity_block_offerings.default.id
  instance_platform = "Linux/UNIX"
}

References

API documentation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-blocks-using.html

Would you like to implement a fix?

Yes

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.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 18, 2024
@justinretzolk justinretzolk added new-resource Introduces a new resource. service/ec2 Issues and PRs that pertain to the ec2 service. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 18, 2024
@prabhavpawar
Copy link
Author

Hi Team,
To test the acceptance tests for Capacity Blocks, can we get the reference of the test environment to provision the resource?
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-blocks.html

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-resource Introduces a new resource. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
2 participants