“由于没有正确的方法使用 cdk 为 aws codepipeline 配置推送过滤器,所以我尝试了以下方法。但是它给了我一个错误,如下所示。尝试了多种方法,但没有一个起作用。任何人都有线索这个?
代码:
const cfnPipeline = pipeline.node.defaultChild as codepipeline.CfnPipeline;
cfnPipeline.addPropertyOverride("Triggers.0.GitConfiguration.Push.0.Branches", {
Includes: ["main", "dev"],
});
错误:
Properties validation failed for resource PipelineABCD5664GGD with message: [#/Triggers/0/GitConfiguration/Push: expected type: JSONArray, found: JSONObject]
似乎缺少
Triggers.0.Gitconfiguration.Push
数组 - 设置整个数组而不是仅第一个元素:
const cfnPipeline = pipeline.node.defaultChild as codepipeline.CfnPipeline;
cfnPipeline.addPropertyOverride("Triggers.0.GitConfiguration.Push", [
{ Branch: { Includes: ["main", "dev"] } },
]);