question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

aws.budgets.Budget costFilters doesn't match documentation

See original GitHub issue

Hello!

  • Vote on this issue by adding a 👍 reaction
  • To contribute a fix for this issue, leave a comment (and link to your pull request, if you’ve opened one already)

Issue details

Steps to reproduce

The documentation indicates that the costFilters attribute of an AWS Budget is a list of objects.

The implementation, however, is simply a key/value map.

This causes an issue with the provider which is expecting a list but isn’t getting one.

To reproduce:

            costFilters: [{
                name: "Service",
                values: ["Amazon Elastic Compute Cloud - Compute"],
            }],

produces this on pulumi preview:

  pulumi:pulumi:Stack (alarms-alarms_dlvr_us-east-1):
    error: Running program '/Users/username/Source/devex/alarms/alarms' failed with an unhandled exception:
    TSError: ⨯ Unable to compile TypeScript:
    index.ts(11,5): error TS2322: Type '{ Service: string; }[]' is not assignable to type '{ [key: string]: Input<string>; } | Promise<{ [key: string]: Input<string>; }> | OutputInstance<{ [key: string]: Input<string>; }> | undefined'.
      Type '{ Service: string; }[]' is not assignable to type '{ [key: string]: Input<string>; }'.
        Index signature is missing in type '{ Service: string; }[]'.

        at createTSError (/Users/matthew.riedel/Source/devex/alarms/alarms/node_modules/ts-node/src/index.ts:261:12)
        at getOutput (/Users/matthew.riedel/Source/devex/alarms/alarms/node_modules/ts-node/src/index.ts:367:40)
        at Object.compile (/Users/matthew.riedel/Source/devex/alarms/alarms/node_modules/ts-node/src/index.ts:558:11)
        at Module.m._compile (/Users/matthew.riedel/Source/devex/alarms/alarms/node_modules/ts-node/src/index.ts:439:43)
        at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
        at Object.require.extensions.<computed> [as .ts] (/Users/matthew.riedel/Source/devex/alarms/alarms/node_modules/ts-node/src/index.ts:442:12)
        at Module.load (internal/modules/cjs/loader.js:950:32)
        at Function.Module._load (internal/modules/cjs/loader.js:790:12)
        at Module.require (internal/modules/cjs/loader.js:974:19)
        at require (internal/modules/cjs/helpers.js:93:18)

If you match the type definition:

    costFilters: {
        Service: "EC2-Other"
    }

You get a different error:

    error: aws:budgets/budget:Budget resource 'budgetName' has a problem: Attribute must be a list. Examine values at 'Budget.CostFilters'.

Expected: Code matches documentation Actual: Exception is raised

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
guineveresaengercommented, Mar 30, 2022

Thank you all for reporting - will get this looked at ASAP!

1reaction
jtriqcommented, Mar 30, 2022

Confirmed also with 5.1.0 version

Read more comments on GitHub >

github_iconTop Results From Across the Web

Budget filters - AWS Cost Management
You can use this filter only for cost, Savings Plans and Reserved Instance (RI) utilization, or Savings Plans and RI coverage budgets. Cost...
Read more >
View your billing reports and cost trends - Google Cloud
This means that the items selectable in your budget scopes might not match up exactly to the items selectable in your cost report...
Read more >
Budgets — Boto3 Docs 1.26.23 documentation - Amazon AWS
The cost filters, such as Region , Service , member account , Tag , or Cost Category , that are applied to a...
Read more >
aws_budgets_budget create and update fail with multilpe ...
As it is currently, it makes the budget resources unusable because it can only ever define budgets with single-value cost filters, which is...
Read more >
Group and filter options in Cost Management - Microsoft Learn
Cost analysis has many grouping and filtering options. ... Limiting to the exact billing period dates won't match the invoice.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found