Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Event Schedule Conditional #100

Conversation

tomellis91
Copy link
Contributor

The when calling the AWS events api put-rule and using the rate expression, if the minute is > 1 it requires the expression to be in minutes. On the other side 1 minutes will also fail and is required to be set as 1 minute.

The Below error was seen during a stack update:

{
    "eventSource": "events.amazonaws.com",
    "eventName": "PutRule",
    "sourceIPAddress": "cloudformation.amazonaws.com",
    "userAgent": "cloudformation.amazonaws.com",
    "errorCode": "ValidationException",
    "errorMessage": "Parameter ScheduleExpression is not valid.",
    "requestParameters": {
        "name": "<Obfuscated>",
        "scheduleExpression": "rate(3 minute)"
    }
}

The below commands have been run to confirm:

# Validation Error
aws events put-rule --name "AutoscalingFunctionTimer" --schedule-expression "rate(3 minute)"
# Validation Error
aws events put-rule --name "AutoscalingFunctionTimer" --schedule-expression "rate(1 minutes)"

# successful request
aws events put-rule --name "AutoscalingFunctionTimer" --schedule-expression "rate(2 minutes)"
# successful request
aws events put-rule --name "AutoscalingFunctionTimer" --schedule-expression "rate(1 minute)"

@tomellis91
Copy link
Contributor Author

Hey @triarius,
This should fix some of the issues people have experience when upgrading to v6.

Copy link
Contributor

@triarius triarius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for raising this @tomellis91. We've decided to go with a slightly different route and make uses specify the unit in the parameter value: #102

We also took the opportunity to rename the parameter to EventSchedulePeriod.

I'll hold off from merging that if you want to incorporate those changes into your PR.

@triarius
Copy link
Contributor

@tomellis91 we decided to merge #102 instead of this.

@tomellis91
Copy link
Contributor Author

#102

Sounds great, thanks 🙌

@tomellis91 tomellis91 closed this Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants