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.87k stars 9.21k forks source link

[New]: Use capacity reservations with EMR instance fleets #30346

Open abhijitvikash opened 1 year ago

abhijitvikash commented 1 year ago

Description

Hi, I am not able to find terraform documentation for the using Capacity Reservation with or without EMR Instance Fleet : https://docs.aws.amazon.com/emr/latest/ManagementGuide/on-demand-capacity-reservations.html

Can you please help with this.

Thanks, Abhijit Vikash

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

aws_emr_cluster aws_ec2_capacity_reservation

Potential Terraform Configuration

resource "aws_ec2_capacity_reservation" "default" {
  instance_type     = "m6gd.16xlarge"
  instance_platform = "Linux/UNIX"
  availability_zone = "us-east-1c"
  instance_count    = var.core_count
}

resource "aws_emr_cluster" "cluster" {
  name          = local.cluster_identifier
  release_label = var.emr_version
  applications  = var.emr_apps
  log_uri       = "s3n://${var.logs_bucket}/"

  termination_protection            = false
  keep_job_flow_alive_when_no_steps = true
  capacity_reservation_id = aws_ec2_capacity_reservation.default.id
.
.
.
}

References

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/emr_cluster.html https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_capacity_reservation https://docs.aws.amazon.com/emr/latest/ManagementGuide/on-demand-capacity-reservations.html

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

abhijitvikash commented 1 year ago

Can anyone please update on this issue. This is blocking our work. Thank you.

AdamTylerLynch commented 1 year ago

Related: #34151 , needs to be addressed when this ticket is worked.

AdamTylerLynch commented 1 year ago

Potential Terraform Config:


"LaunchSpecifications": 
    {"OnDemandSpecification": {
        "AllocationStrategy": "lowest-price",
        "CapacityReservationOptions":
         {
            "UsageStrategy": "use-capacity-reservations-first"
         }
       }
    }
AdamTylerLynch commented 1 year ago

Reference: https://docs.aws.amazon.com/emr/latest/APIReference/API_OnDemandProvisioningSpecification.html#EMR-Type-OnDemandProvisioningSpecification-CapacityReservationOptions