1 Answer
- Newest
- Most votes
- Most comments
0
CodeBuild build triggers are simply CloudWatch event rules.
When creating build triggers through the console, what is actually being created is a CloudWatch event rule. You can create CloudWatch event rules using the CLI, for example:
aws events put-rule \
--name run-codebuild \
--schedule-expression 'rate(1 hour)' \
--role-arn arn:aws:iam::000000000000:role/service-role/AWS_Events_Invoke_CodeBuild_124052220
aws events put-targets \
--rule run-codebuild \
--targets '
[
{
"Id": "some_id",
"Arn": "arn:aws:codebuild:us-east-1:000000000000:project/some-codebuild-project",
"RoleArn": "arn:aws:iam::000000000000:role/service-role/codebuild-some-codebuild-project-service-role"
}
]
'
If the CW event rule is associated with a CodeBuild project, that event rule will show up under the project's build triggers.
answered 5 years ago
Relevant content
- asked 5 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago