cloudformation-coverage-roadmap icon indicating copy to clipboard operation
cloudformation-coverage-roadmap copied to clipboard

AWS::Budgets::Budget - NotificationsWithSubscribers-Subscribers

Open OlafConijn opened this issue 5 years ago • 11 comments

AWS::Budgets::Budget does not handle changing attributes like NotificationsWithSubscribers-Subscribers well.

problem: If Subscribers are added/removed from a AWS::Budgets::Budget resource updating the stack fails with an error Resource Budget failed because Error creating budget: my-budget - the budget already exists.

problem might apply to other attributes too.

expected behavior is for the stack not to fail.

test case create a stack with

  Budget:
    Type: AWS::Budgets::Budget
    Properties:
      Budget:
        BudgetName: 'my-budget'
        BudgetLimit:
          Amount: 100
          Unit: USD
        TimeUnit: MONTHLY
        BudgetType: COST
      NotificationsWithSubscribers:
        - Notification:
            NotificationType: FORECASTED
            ComparisonOperator: GREATER_THAN
            Threshold: 1
          Subscribers:
            - SubscriptionType: SNS
              Address: !Ref BudgetAlarmTopic

update stack by adding/changing the NotificationsWithSubscribers-Subscribers

OlafConijn avatar Feb 05 '20 22:02 OlafConijn

this probably depends on https://github.com/aws-cloudformation/aws-cloudformation-resource-schema/pull/86

PatMyron avatar Apr 29 '20 17:04 PatMyron

Similar error while changing threshold percentage.

AWS::Budgets::Budget Budget UPDATE_FAILED (Error creating budget: budgetName - the budget already exists. (Service: AWSBudgets; Status Code: 400; Error Code: DuplicateRecordException; Request ID: caada7f6-3cf6-46d9-8d6a-643e9b5c4c66; Proxy: null))

chinnshan avatar Oct 30 '20 14:10 chinnshan

aws-cloudformation/cloudformation-resource-schema#86 has been merged now. Any update on progress here?

GrahamCampbell avatar Dec 23 '21 15:12 GrahamCampbell

Bumping for an update. Please!

HCrane avatar Feb 23 '23 12:02 HCrane

Just chipping in our vote to say we would really like to see this addressed

rcoundon avatar Mar 23 '23 08:03 rcoundon

+1

ManuelWeiss avatar Jul 27 '23 06:07 ManuelWeiss

Added subscribers to a budget-alert template deployed by control tower. This error sadly still occurs.

Bmiest avatar Aug 08 '23 13:08 Bmiest

Still waiting for a fix.

As a workaround, what seems to work for me is adding a unique string to the name, I'm using a unix timestamp (in millis) and set the time period start date to a fixed date, so that the budget doesn't "move" when you redeploy it.

Denn0 avatar Feb 12 '24 13:02 Denn0

Is there any update on this? or workaround (without having to create a new budgetalert?)

helzahalim avatar Mar 14 '24 00:03 helzahalim

Workaround is simple: do not set a BudgetName This way CF can re-create alarms as they are updated. Budget name will then be something like Budget-eu-west-1-012345678789012-J8OitO03ogC5

The first part is the CloudFormation resource name, so you have a bit of control over the eventual name. As you update your alarms, the last part of the name will be refreshed every time.

yannickvr avatar Jun 07 '24 07:06 yannickvr