使用 CodePipeline - 将 CloudFormation 堆栈部署到另一个帐户
Using CodePipeline - deploy a CloudFormation stack to another account
我正在帐户 00000000000 中配置 CodePipeline。
我想部署 CloudFormation 堆栈
- 通过 CodePipeline 执行 CloudFromation 模板
- 但不在帐户 123456789123 中,也不在 00000000000 中
问题
如何配置 "Deploy" 类型的 CodePipeline 操作来执行此操作?
特别是如何将其指向帐户 123456789123?
到目前为止我做了什么
我假设它通过角色工作。123456789123。
我在账户 123456789123 中创建了一个 IAM 角色,
信任帐户 00000000000,
信任服务 cloudformation。
我把它命名为arn:aws:iam::123456789123:role/CFDep
下面是我的CodePipeline-Action的配置。
我遇到错误 The role name is invalid. Check that the specified role exists and can be assumed by AWS CloudFormation.
为什么?
来自docs:
You cannot use the AWS CodePipeline console to create or edit a
pipeline that uses resources associated with another AWS account.
However, you can use the console to create the general structure of
the pipeline, and then use the AWS CLI to edit the pipeline and add
those resources. Alternatively, you can use the structure of an
existing pipeline and manually add the resources to it.
您可以执行以下两项操作之一:
使用aws codepipeline cli编辑管道
aws codepipeline update-pipeline --cli-input-json file://pipeline.json
或
使用 cloudformation 创建管道本身
您可以使用 aws 跨账户管道参考架构中的 this pipeline definition 作为模板的起点。
我正在帐户 00000000000 中配置 CodePipeline。
我想部署 CloudFormation 堆栈
- 通过 CodePipeline 执行 CloudFromation 模板
- 但不在帐户 123456789123 中,也不在 00000000000 中
问题
如何配置 "Deploy" 类型的 CodePipeline 操作来执行此操作?
特别是如何将其指向帐户 123456789123?
到目前为止我做了什么
我假设它通过角色工作。123456789123。
我在账户 123456789123 中创建了一个 IAM 角色,
信任帐户 00000000000,
信任服务 cloudformation。
我把它命名为arn:aws:iam::123456789123:role/CFDep
下面是我的CodePipeline-Action的配置。
我遇到错误 The role name is invalid. Check that the specified role exists and can be assumed by AWS CloudFormation.
为什么?
来自docs:
You cannot use the AWS CodePipeline console to create or edit a pipeline that uses resources associated with another AWS account. However, you can use the console to create the general structure of the pipeline, and then use the AWS CLI to edit the pipeline and add those resources. Alternatively, you can use the structure of an existing pipeline and manually add the resources to it.
您可以执行以下两项操作之一:
使用aws codepipeline cli编辑管道
aws codepipeline update-pipeline --cli-input-json file://pipeline.json
或
使用 cloudformation 创建管道本身
您可以使用 aws 跨账户管道参考架构中的 this pipeline definition 作为模板的起点。