https://pulumi.com logo
Title
e

early-boots-60919

09/15/2021, 9:32 PM
Hi there! I’m trying to setup AWS cost budgets with tag filters, but can’t get what’s the expected format for the
CostFilters
map.
_, err = budgets.NewBudget(ctx, "test-budget", &budgets.BudgetArgs{
    BudgetType: pulumi.String("COST"),
    CostFilters: pulumi.StringMap{
        "TagKeyValue": pulumi.String(`["stack$test"]`),
    },
    LimitAmount: pulumi.String(budgetAmount),
    LimitUnit:   pulumi.String("USD"),
    TimeUnit:    pulumi.String("MONTHLY"),
})
Diagnostics:
  aws:budgets:Budget (test-budget):
    error: aws:budgets/budget:Budget resource 'test-budget' has a problem: Attribute should be a list. Examine values at 'Budget.CostFilters'.
Tried the example in the docs: https://www.pulumi.com/docs/reference/pkg/aws/budgets/budget/#example-usage, but just get a compilation error:
Invalid composite literal type: String
Missing key in the map literal
Anyone has a working example?
Hi all, sorry for bumping up this question. Anyone have any tips on how to setup an AWS budget cost filter with Pulumi’s latest version?
The documented example doesn’t seem to work (https://www.pulumi.com/docs/reference/pkg/aws/budgets/budget/#example-usage):
CostFilters: pulumi.StringMap{
    pulumi.String{
        Name: "Service",
        Values: []string{
            "Amazon Elastic Compute Cloud - Compute",
        },
    },
},
Compilation errors:
Invalid composite literal type: String

Missing key in the map literal