gpt4 book ai didi

amazon-web-services - AWS Cloudwatch 在动态标签上触发 Codepipeline

转载 作者:行者123 更新时间:2023-12-04 12:10:06 25 4
gpt4 key购买 nike

我想用动态标签标记提交,例如 git tag deploy-$(date +"%Y-%m-%d_%H-%M-%S") ,然后从 cloudwatch 触发 codepipeline。问题是如果我使用以下 cloudwatch 事件模式:

{
"source": [
"aws.codecommit"
],
"detail-type": [
"CodeCommit Repository State Change"
],
"resources": [
"arn:aws:codecommit:region:XXX:someName"
],
"detail": {
"event": [
"referenceCreated",
"referenceUpdated"
],
"repositoryName": [
"someName"
],
"referenceType": [
"tag"
],
"referenceName": [
"deploy"
]
}
}
它只会在特定标签上触发 - “部署”。有没有办法说任何以(包含)deploy 关键字开头的标签?

最佳答案

我在看 Content-based Filtering with Event Patterns文档及其 Prefix Matching .文档中给出的示例是:

{
"time": [ { "prefix": "2017-10-02" } ],
}
根据示例,以下内容似乎适用于您的情况:
{
"source": [
"aws.codecommit"
],
"detail-type": [
"CodeCommit Repository State Change"
],
"resources": [
"arn:aws:codecommit:region:XXX:someName"
],
"detail": {
"event": [
"referenceCreated",
"referenceUpdated"
],
"repositoryName": [
"someName"
],
"referenceType": [
"tag"
],
"referenceName": [
{ "prefix": "deploy" } ]
]
}
}

关于amazon-web-services - AWS Cloudwatch 在动态标签上触发 Codepipeline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63285480/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com