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

resource/aws_servicequotas_service_quota: Check for presence of ErrorReason and Value when checking quota value #19719

Closed
gdavison opened this issue Jun 8, 2021 · 2 comments · Fixed by #19722
Assignees
Labels
bug Addresses a defect in current functionality. service/servicequotas Issues and PRs that pertain to the servicequotas service.
Milestone

Comments

@gdavison
Copy link
Contributor

gdavison commented Jun 8, 2021

Some services, such as Elastic Load Balancing have additional permissions required to read quota values. If the IAM principal accessing trying to read the quota is permitted to read servicequotas:GetServiceQuota but does not have the additional permission, the resource currently updates the current value to 0 rather than failing.

The AWS CLI returns the following with permissions:

$ aws service-quotas get-service-quota --service-code elasticloadbalancing --quota-code L-53DA6B97 --region us-east-1
{
    "Quota": {
        "ServiceCode": "elasticloadbalancing",
        "ServiceName": "Elastic Load Balancing (ELB)",
        "QuotaArn": "arn:aws:servicequotas:us-east-1:123456789012:elasticloadbalancing/L-53DA6B97",
        "QuotaCode": "L-53DA6B97",
        "QuotaName": "Application Load Balancers per Region",
        "Value": 100.0,
        "Unit": "None",
        "Adjustable": true,
        "GlobalQuota": false
    }
}

When the IAM principal does not have access:

$ aws service-quotas get-service-quota --service-code elasticloadbalancing --quota-code L-53DA6B97 --region us-east-1
{
    "Quota": {
        "ServiceCode": "elasticloadbalancing",
        "ServiceName": "Elastic Load Balancing (ELB)",
        "QuotaArn": "arn:aws:servicequotas:us-east-1: 123456789012:elasticloadbalancing/L-53DA6B97",
        "QuotaCode": "L-53DA6B97",
        "QuotaName": "Application Load Balancers per Region",
        "Unit": "None",
        "Adjustable": true,
        "GlobalQuota": false,
        "ErrorReason": {
            "ErrorCode": "DEPENDENCY_ACCESS_DENIED_ERROR",
            "ErrorMessage": "You don’t have access to elasticloadbalancing:DescribeAccountLimits"
        }
    }
}

Affected Resource

  • aws_servicequotas_service_quota
@github-actions github-actions bot added the service/servicequotas Issues and PRs that pertain to the servicequotas service. label Jun 8, 2021
@gdavison gdavison added the bug Addresses a defect in current functionality. label Jun 8, 2021
@gdavison gdavison self-assigned this Jun 8, 2021
@github-actions github-actions bot added this to the v3.45.0 milestone Jun 9, 2021
@github-actions
Copy link

This functionality has been released in v3.45.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 12, 2021
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. service/servicequotas Issues and PRs that pertain to the servicequotas service.
Projects
None yet
1 participant