- Newest
- Most votes
- Most comments
Hello!
To begin with, As of the current AWS CodeDeploy functionality, you can indeed specify a custom timeout for a lifecycle hook using the ‘timeout’ parameter in the AppSpec ‘hooks’ section you can refer to this documentation.
You can read more about, "How do I resolve the error that I receive in AWS CodeDeploy when my deployment times out while waiting for a status callback?" in this documentation
However, the default timeout for hooks is 3600 seconds (1 hour), this is the number of seconds to allow the script to execute before it is considered to have failed. 3600 seconds (1 hour) is the maximum amount of time allowed for script execution for each deployment lifecycle event. This means that if you wish to limit your deployment lifecycle event to 15 minutes the value for total timeout should be 900 seconds. You may then decide on how long each script will take, i.e if you have 3 scripts then it can be 900/3 = 300 meaning you will allow each to run for 300 seconds ( 5 min) then after if it timeouts will be considered as failed, you can ensure that CodeDeploy waits long enough for your Lambda function to complete, even if it encounters issues or takes longer than expected to execute.
In case you have additional or follow-up queries regarding AWS CodeDeploy or Lambda, we may require details that are non-public information. Please open a support case with AWS using the following link.
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
I am using a yaml file and have a format as such but this causes a deployment error in codedeploy
hooks: BeforeAllowTraffic: - location: arn:aws:lambda:.... timeout: 700
Looking at the documentation it does not specify a time out when referring to lambda functions - https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#reference-appspec-file-structure-hooks-section-structure:~:text=Hooks%3A%0A%20%20%2D%20BeforeInstall%3A%20%22BeforeInstallHookFunctionName%22
Does this mean timeouts are only allowed for scripts rather than actual lambda functions?