CodePipeline不创建新规则
我正在AWS中创建新管道,而我的来源是CodeCommit。但是,当我单击创建管道时,我会收到一个错误:
在以下Amazon CloudWatch事件操作中失败:Puttargets。以下消息包含例外的详细信息:请求的资源超过允许的最大数字。
我知道我的事件规则具有5/5个目标,并且有一个限制,因此无法添加新目标。 但是,我无法找到与CodePipeline关联的新事件规则添加/链接新事件规则的方法。
任何帮助将不胜感激。 谢谢。
I am creating a new pipeline in AWS and my source is CodeCommit. But when I click on create pipeline, I get an error:
Failed on the following Amazon CloudWatch Events operation: PutTargets. The following message contains details on the exception: The requested resource exceeds the maximum number allowed.
I know my event rule has 5/5 targets and there is a limit so the new target cannot be added.
However, I am unable to find a way to add/link new event rule associated with CodePipeline.
According to this documentation, my rule should be automatically created but I see no pop ups or alerts.
Any help would be appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果默认情况下,您要通过AWS控制台创建新的管道,它将创建一个新的事件规则并将目标添加到该规则。现在,根据您在管道中选择的源类型,它可以具有该规则的多个目标。
正如您已经提到的那样,您将CodeCommit作为管道中的来源,对于一个存储库和一个分支,理想情况下应该为事件规则有一个目标。过去,我经历了类似的问题,即AWS后端以某种方式与分支名称的第一个常见字符匹配,这可能会导致选择一个存储库的多个分支,从而选择多个目标。例如;
您的存储库具有这种结构
如果您仅选择 dev codecommit源中的分支,则可能在您的事件规则中添加3个目标,即 dev,dev1 和 dev2 。我不完全知道这背后的原因,可能是一个错误或有意的原因。我的赌注是在Regex上是罪魁祸首。因此,就您而言,可能是您有5个以上的分支,从名称开头开头,这就是为什么它达到极限的原因,因此给您带来了错误。
因此,这就是您可以尝试的。选择完全唯一的分支或有一些差异。换句话说,选择 dev 以外的任何分支,看看您是否仍然会出现错误。如果有效,则意味着该是时候正确组织您的存储库并为分支机构提供适当的命名约定了。
If you are creating a new pipeline through AWS console, by default, it creates a new event rule and add target(s) to that rule. Now, depending upon the source type you select in your pipeline, it can have multiple targets for that rule.
As you already mentioned, you have CodeCommit as the source in your pipeline and for one repository and one branch, you should ideally have one target for your event rule. I have experienced similar kind of issue in the past where AWS backend somehow matches the first common characters for a branch name which may result selecting multiple branches for a single repository and hence multiple targets. For example;
Your repository has this kind of structure
If you select only DEV branch in your CodeCommit source, it might add 3 targets in your event rule i.e. for DEV, DEV1 and DEV2. I don't exactly know the reason behind this, could be a bug or perhaps intentional. My bet is on regex as the culprit here. So in your case, it could be that you have more than 5 branches that start with the name DEV and that's why it is reaching the limit, hence giving you the error.
So here's what you can try. Select the branch that is either totally unique or has some differences. In other words, select any branch other than DEV and see if you still get the error. If this works, it means that it's time to properly organize your repository and have proper naming convention for the branches.