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

aws_api_gateway_usage_plan rate_limit does not "take" the first time #2057

Closed
kurron opened this issue Oct 25, 2017 · 3 comments · Fixed by #2076
Closed

aws_api_gateway_usage_plan rate_limit does not "take" the first time #2057

kurron opened this issue Oct 25, 2017 · 3 comments · Fixed by #2076
Labels
bug Addresses a defect in current functionality.

Comments

@kurron
Copy link

kurron commented Oct 25, 2017

Terraform Version

Terraform v0.10.7

Terraform Configuration Files

terraform {
    required_version = ">= 0.10.7"
    backend "s3" {}
}

provider "aws" {
    region = "${var.region}"
}

resource "aws_api_gateway_api_key" "api_key" {
    name = "${var.key_name}"
    description = "${var.key_description}"
    enabled = true
}

resource "aws_api_gateway_usage_plan" "usage_plan" {
    name         = "${var.key_name}"
    description  = "Usage plan specific to the ${var.key_name} API key"
    quota_settings {
        limit  = "${var.quota_limit}"
        period = "${var.quota_period}"
    }
    throttle_settings {
        burst_limit = "${var.burst_limit}"
        rate_limit  = "${var.steady_state_limit}"
    }
    api_stages {
        api_id = "${var.api_gateway_id}"
        stage  = "${var.deployment_stage_name}"
    }
}

resource "aws_api_gateway_usage_plan_key" "usage_plan_key" {
    key_id        = "${aws_api_gateway_api_key.api_key.id}"
    key_type      = "API_KEY"
    usage_plan_id = "${aws_api_gateway_usage_plan.usage_plan.id}"
}

Debug Output

Due to the nature of the reproduction scenario, I've lost my debug file but could try and create it if it is deemed important.

Crash Output

None.

Expected Behavior

The first apply of the module should set the rate_limit attribute to the specified value.

Actual Behavior

The rate_limit attribute is set to 0.

Steps to Reproduce

  1. terraform init
  2. terraform plan
  3. terraform apply
  4. terraform plan
  5. terraform apply

You should notice that the second apply correctly sets the desired value. You have to apply twice in order for the value to take. The other attributes appear to be correctly on the first apply.

Important Factoids

Running on Ubuntu 16.04

References

None found.

@Ninir Ninir added the bug Addresses a defect in current functionality. label Oct 26, 2017
@Ninir
Copy link
Contributor

Ninir commented Oct 26, 2017

Hi @kurron

Just threw a PR for that, sorry for the issue :)

@kurron
Copy link
Author

kurron commented Oct 27, 2017

Thanks for the fix, @Ninir . If I rerun teffaform init will I automatically get the fix or do I have to wait for a release of the AWS provider?

@ghost
Copy link

ghost commented Apr 10, 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 and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants