I have a new problem now. I change event from schedule to pattern. However I notice the rule name becomes auto-generated, which is not expected because I need a specific name e.g. stage-user-my-function. I tested to add name to eventBridge section, but it doesn’t work. I appreciate any suggestions!
The old configuration with schedule:
my-function:
handler: my_function.lambda_handler
memorySize: 256
timeout: 30
events:
- schedule:
name: stage-user-my-function
description: "Triggers my function"
rate: rate(1 minute)
enabled: false
The new configuration with pattern match:
my-function:
handler: my_function.lambda_handler
memorySize: 256
timeout: 30
events:
- eventBridge:
name: stage-user-my-function # <-------- I want to force to use a specific name, but adding here with name doesn't work
eventBus: arn:aws:events:<region>:<account-id>:event-bus/default
pattern:
account:
- ${self:custom.accountId}