Skip to content

Timeouts setting is not respected when InsufficientInstanceCapacity occur #14403

Closed
@jakubkrzykowski

Description

@jakubkrzykowski

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

Terraform CLI and Terraform AWS Provider Version

terraform version - 0.12.24
terraform aws provider version - 2.70.0

Affected Resource(s)

  • aws_instance

Terraform Configuration Files

resource "aws_instance" "x" {
  ami              = "ami-xxx"
  instance_type    = "c4.2xlarge"

  iam_instance_profile   = data.aws_iam_instance_profile.x.name
  placement_group        = data.aws_instance.x.placement_group

  vpc_security_group_ids = "sg-xxx"
  subnet_id              = "subnet-xxx"

  root_block_device {
    volume_type = "gp2"
    volume_size = 16
  }
  timeouts {
    create = "20m"
    update = "20m"
    delete = "20m"
  }
}

Expected Behavior

Terraform should fail after 20m if instance is not in running state.

Actual Behavior

Terraform failed after 50m of not being able to create instance with following error:

aws_instance.x: Still creating... [50m0s elapsed]
aws_instance.x: Still creating... [50m10s elapsed]
aws_instance.x: Still creating... [50m20s elapsed]
aws_instance.x: Still creating... [50m30s elapsed]
aws_instance.x: Still creating... [50m40s elapsed]
aws_instance.x: Still creating... [50m50s elapsed]
Error: Error launching source instance: InsufficientInstanceCapacity: We currently do not have sufficient c4.2xlarge capacity in the Availability Zone you requested (us-east-2a). Our system will be working on provisioning additional capacity. You can currently get c4.2xlarge capacity by not specifying an Availability Zone in your request or choosing us-east-2b, us-east-2c.
status code: 500, request id: c828e7ec-3b08-49d6-b510-374d75f7b2cb

on notebook.tf line 19, in resource "aws_instance" "x":
19: resource "aws_instance" "x" {

Steps to Reproduce

  1. terraform apply

Metadata

Metadata

Assignees

Labels

bugAddresses a defect in current functionality.service/ec2Issues and PRs that pertain to the ec2 service.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions