Open FANMixco opened 1 year ago
Hi @FANMixco - thanks for reaching out and sorry to hear about the issue.
I attempted to replicate the issue with the simple code snippet below and wasn't able reproduce the same behavior. According to API docs, the error you're getting indicates that "The input fails to satisfy the constraints specified by an AWS service.".
After deep dive and looking at your code, I suspect the issue might be with ScheduleExpression
expression. Have you tried other expressions besides cron
format?
Here's more on the schedule types and expressions for your reference: https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html
If the issue persists, please share debug logs without any sensitive information by adding boto3.set_stream_logger('')
to your script. That would give us more insights on locating the issue.
Thanks
John
client = boto3.client('scheduler')
response = client.update_schedule(
FlexibleTimeWindow={
'MaximumWindowInMinutes': 123,
'Mode': 'FLEXIBLE'
},
Name='string',
ScheduleExpression='cron({start_api.minute} {start_api.hour} {start_api.day} {start_api.month} ? {start_api.year})',
State='ENABLED',
Target={
'Arn': 'string',
'RoleArn': 'string',
}
)
print(response)
Hi @FANMixco - thanks for reaching out and sorry to hear about the issue.
I attempted to replicate the issue with the simple code snippet below and wasn't able reproduce the same behavior. According to API docs, the error you're getting indicates that "The input fails to satisfy the constraints specified by an AWS service.".
After deep dive and looking at your code, I suspect the issue might be with
ScheduleExpression
expression. Have you tried other expressions besidescron
format?Here's more on the schedule types and expressions for your reference: https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html
If the issue persists, please share debug logs without any sensitive information by adding
boto3.set_stream_logger('')
to your script. That would give us more insights on locating the issue. Thanks Johnclient = boto3.client('scheduler') response = client.update_schedule( FlexibleTimeWindow={ 'MaximumWindowInMinutes': 123, 'Mode': 'FLEXIBLE' }, Name='string', ScheduleExpression='cron({start_api.minute} {start_api.hour} {start_api.day} {start_api.month} ? {start_api.year})', State='ENABLED', Target={ 'Arn': 'string', 'RoleArn': 'string', } ) print(response)
Hi @aBurmeseDev, after a call with the AWS support team, we concluded a couple of things:
I even wrote a tutorial since there are not many examples:
https://dev.to/fanmixco/how-to-update-eventbridge-schedules-with-lambdas-2482
What's more, I suggested to them that there are some values that should be taken by default if you don't provide anything:
These values make sense to be mandatory when you're creating a schedule, not when you're updating one.
Describe the bug
Fellows,
I'm trying to update an event in my EventBridge, but I'm constantly getting this error:
I even provided the admin role permissions to my Role and don't know why I'm getting this error. Any idea what am I doing wrong?
Expected Behavior
It should update the event.
Current Behavior
It's giving this error:
Reproduction Steps
Boto3
to your PC:pip install boto3 -t ./python
.zip -r layer.zip ./python
Boto3
as a layer.Possible Solution
No response
Additional Information/Context
No response
SDK version used
1.26.50
Environment details (OS name and version, etc.)
AWS, Lambda