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

[Resource Type] - [BUG] - CloudFormation fails to rollback AWS::Pinpoint::Campaign resource when previous StartTime configuration is in the past

Open brillian2 opened this issue 1 year ago • 0 comments
trafficstars

Name of the resource

AWS::Pinpoint::Campaign

Resource Name

No response

Issue Description

There seems to be a bug in how AWS CloudFormation handles rollbacks of AWS::Pinpoint::Campaign resources. During the rollback process of a CloudFormation stack containing an AWS::Pinpoint::Campaign resource, CloudFormation attempts to restore the previous configuration of the Amazon Pinpoint campaign. However, if the previous configuration had a StartTime property set to a time in the past, the rollback fails with the error "StartTime must be at least current time".

Expected Behavior

During the rollback process, CloudFormation should handle the restoration of AWS::Pinpoint::Campaign resources in a way that does not violate the validation rules for the StartTime property.

Observed Behavior

During the rollback process, CloudFormation attempts to restore the AWS::Pinpoint::Campaign resource to its previous configuration, including the StartTime property set to the time specified in the initial configuration. If the StartTime is now in the past relative to the current time, Amazon Pinpoint rejects the request to update the campaign with the following error:

StartTime must be at least current time. (Service: AmazonPinpoint; Status Code: 400; Error Code: BadRequestException)

This causes the entire rollback process to fail, leaving the stack in an inconsistent state.

Test Cases

Steps to Reproduce:

  1. Create a CloudFormation stack with an AWS::Pinpoint::Campaign resource, where the StartTime property is set to a future date or time.
  2. Update the CloudFormation stack, making changes to the AWS::Pinpoint::Campaign resource or other resources in the stack.
  3. If the stack update fails, CloudFormation initiates a rollback process.
  4. During the rollback process, CloudFormation attempts to restore the previous configuration of the AWS::Pinpoint::Campaign resource, including the StartTime property set to the future date or time specified in the initial configuration.
  5. Since the StartTime is now in the past relative to the current time, Amazon Pinpoint rejects the request to update the campaign, causing the rollback to fail with the error "StartTime must be at least current time".

Other Details

No response

brillian2 avatar Sep 24 '24 09:09 brillian2