aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 57 forks source link

AWS::Budgets::Budget - NotificationsWithSubscribers-Subscribers #365

Open OlafConijn opened 4 years ago

OlafConijn commented 4 years ago

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

PatMyron commented 4 years ago

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

chinnshan commented 4 years ago

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))
GrahamCampbell commented 2 years ago

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

HCrane commented 1 year ago

Bumping for an update. Please!

rcoundon commented 1 year ago

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

ManuelWeiss commented 1 year ago

+1

Bmiest commented 1 year ago

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

Denn0 commented 9 months ago

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.

helzahalim commented 8 months ago

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

yannickvr commented 5 months ago

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.

msiuts commented 2 months ago

This is really annoying that one can not update the Threshold via Cloudformation. I do not understand why this is labeled as enhancement and not as a bug.