简体   繁体   English

通过 CloudFormation 将 AWS CodePipeline 操作添加到现有管道

[英]Add AWS CodePipeline action to existing pipeline via CloudFormation

I've made a CodePipeline pipline CloudFormation template and deployed it as a stack.我制作了一个 CodePipeline 管道 CloudFormation 模板并将其部署为堆栈。 I'd like to add an action to this existing pipeline via another CloudFormation stack.我想通过另一个 CloudFormation 堆栈向这个现有管道添加一个操作。

From the documentation I can only see pipeline resources which would allow me to create a whole new stack, not edit an existing one by providing an ARN or something similar.从文档中,我只能看到允许我创建一个全新堆栈的管道资源,而不是通过提供 ARN 或类似的东西来编辑现有堆栈。 There are also no granular resources that provide support for CodePipeline functionality such as actions.也没有粒度资源支持 CodePipeline 功能,例如操作。 See URL below:请参阅下面的 URL:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codepipeline-pipeline.html https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codepipeline-pipeline.html

Does anyone know how I can achieve this?有谁知道我怎么能做到这一点? By the looks of it I'd say I have to update the template for the pipeline, adding the new action.从外观上看,我会说我必须更新管道的模板,添加新操作。 Assuming this is the only way, how could achieve this from another CloudFormation stack?假设这是唯一的方法,如何从另一个 CloudFormation 堆栈实现这一点?

So a template would be configured to add a new action in the pipeline template, and then trigger an update of the pipeline stack.因此,模板将被配置为在管道模板中添加新操作,然后触发管道堆栈的更新。 I'm guessing I'd have to use a CloudFormation macro and keep the pipeline template stored in s3.我猜我必须使用 CloudFormation 宏并将管道模板存储在 s3 中。 I'd then take the template out of s3, add the action, save the change and then what?然后我将模板从 s3 中取出,添加操作,保存更改,然后呢? I've also considered how I might use nested stacks or the Import macro.我还考虑了如何使用嵌套堆栈或 Import 宏。

Thanks for any help!谢谢你的帮助!

@Marcin inspired me to this solutions. @Marcin 启发了我这个解决方案。 Thanks:)谢谢:)

Essentially I did this:基本上我是这样做的:

First I created a "Change" pipeline that took the stack template modified during the build stage, that I originally wanted to deploy across multiple stacks in a deploy action, and wrote it out to the path within an s3 bucket.首先,我创建了一个“更改”管道,该管道采用在构建阶段修改的堆栈模板,我最初想在部署操作中跨多个堆栈部署,并将其写入 s3 存储桶中的路径。

Second I created a "Deploy" pipeline that used the s3 path pointing to the output of the "Change" pipeline.其次,我创建了一个“部署”管道,该管道使用指向“更改”管道的 output 的 s3 路径。 This pipeline contains a deploy action that uses a SourceArtifact of the outputted template.此管道包含使用输出模板的 SourceArtifact 的部署操作。 This is essentially the deploy action I wanted in the "Change" pipeline.这本质上是我在“更改”管道中想要的部署操作。

I have now created a CFN template for the "Deploy" pipeline, allowing me to create any number of "Deploy" pipelines pointing to different stacks.我现在为“部署”管道创建了一个 CFN 模板,允许我创建指向不同堆栈的任意数量的“部署”管道。 When the "Change" pipeline is triggered it's output triggers all the "Deploy" pipelines.当“更改”管道被触发时,它的 output 会触发所有“部署”管道。 My approval and testing process goes into the "Change" pipeline to avoid spam and I can roll back no problem.我的批准和测试过程进入“更改”管道以避免垃圾邮件,我可以毫无问题地回滚。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将参数添加到 AWS CloudFormation / CodePipeline 堆栈 - Add parameter to an AWS CloudFormation / CodePipeline stack AWS CodePipeline:如何将CloudFormation操作的输出传递给CodeBuild操作 - AWS CodePipeline: How to pass output from CloudFormation action to a CodeBuild action 通过Cloudformation,CodeBuild和CodePipeline将python包部署到AWS Lambda - Deploying a python package to AWS Lambda via Cloudformation, CodeBuild and CodePipeline AWS CodePipeline从CloudFormation模板添加Github源 - AWS CodePipeline Add Github Source from CloudFormation Template AWS CloudFormation-将新证书添加到现有侦听器 - AWS CloudFormation - Add New Certificate to an existing listener AWS CodePipeline-在CloudFormation中部署:操作执行失败要求功能:[CAPABILITY_AUTO_EXPAND] - AWS CodePipeline - Deploy in CloudFormation: Action execution failed Requires capabilities : [CAPABILITY_AUTO_EXPAND] 将现有的CodePipeline / CodeBuild项目导出到Cloudformation - Export existing CodePipeline/CodeBuild projects to Cloudformation 如何将现有 CodePipeline 导出到 CloudFormation 模板 - How to export an existing CodePipeline to CloudFormation template 在AWS Codepipeline中,如何分配适当的角色名称以允许通过CloudFormation进行堆栈部署? - In AWS Codepipeline, how do I assign a proper role name to allow a stack deployment via CloudFormation? 如果我通过 CloudFormation 部署 AWS,有什么方法可以阻止 AWS 自动启动 CodePipeline? - Is there any way to stop AWS from starting CodePipeline automatically if I deploy it via CloudFormation?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM