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

[Bug]: aws_batch_compute_environment in place updates do not work with SPOT_PRICE_CAPACITY_OPTIMIZED allocation_strategy #38695

Open
chrischappell-rgare opened this issue Aug 5, 2024 · 1 comment
Labels
bug Addresses a defect in current functionality. service/batch Issues and PRs that pertain to the batch service.

Comments

@chrischappell-rgare
Copy link

Terraform Core Version

1.6.6

AWS Provider Version

5.61.0

Affected Resource(s)

aws_batch_compute_environment

Expected Behavior

When aws_batch_compute_environment properties such as image_id or instances_types is changed an in-place update of the compute environment should occur. This is not working when allocation_strategy is SPOT_PRICE_CAPACITY_OPTIMIZED. It does work for SPOT_CAPACITY_OPTIMIZED.

Actual Behavior

The plan indicates that the aws_batch_compute_environment must be replaced, which will destroy the compute environment instead.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_batch_compute_environment" "compute_environment" {
    compute_environment_name = var.compute_environment_name
    type = "MANAGED"
    service_role = var.batch_service_role

    compute_resources {
        type = "SPOT"
        spot_iam_fleet_role = var.spot_iam_fleet_role
        allocation_strategy = "SPOT_PRICE_CAPACITY_OPTIMIZED"
        bid_percentage = 100
        max_vcpus = 100
        instance_role = var.ecs_instance_role
        instance_type = var.instance_types
        image_id = var.image_id
        security_group_ids = var.security_groups
        subnets = var.subnets
    }

    update_policy {
        job_execution_timeout_minutes = 30
        terminate_jobs_on_update = false
    }
}

Steps to Reproduce

  1. Create an aws_batch_compute_environment with Terraform. compute_resources type should be SPOT and allocation_strategy should be SPOT_PRICE_CAPACITY_OPTIMIZED. Include an instance_type value, such as ["m7i"].
  2. Plan and apply the Terraform.
  3. Change the instance type to a different value, such as ["r7i"].
  4. Run terraform plan.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@chrischappell-rgare chrischappell-rgare added the bug Addresses a defect in current functionality. label Aug 5, 2024
Copy link

github-actions bot commented Aug 5, 2024

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.

@github-actions github-actions bot added the service/batch Issues and PRs that pertain to the batch service. label Aug 5, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Aug 5, 2024
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/batch Issues and PRs that pertain to the batch service.
Projects
None yet
Development

No branches or pull requests

2 participants