跨区域代码部署错误。(AWS Codepipeline)

时间:2019-03-14 12:36:42

标签: amazon-web-services aws-codepipeline

我尝试使用AWS CodePipeline从ap-southeast-1跨区域部署到ap-northeast-1。 但是,在部署阶段发生了以下错误。 我将s3设置为对CodeStarWorker-test-ToolChain的完全访问权限。


ReplicationStatus复制工件'test-BuildArtifact'
失败:无法从
复制工件 ap-southeast-1中的source_backet
ap-northeast-1中的dest_backet:检查源和目标
神器桶存在并且
arn:aws:iam :: xxxxxxx:role / CodeStarWorker-test-ToolChain具有
有权访问它。


我在配置下面设置了管道部署。 是否有人有相同的错误并且知道预订?

               {
                 "name": "Deploy", 
                 "actions": [
                     {
                         "region": "ap-northeast-1",
                         "inputArtifacts": [
                             {
                                 "name": "test-BuildArtifact"
                             }
                         ], 
                         "name": "GenerateChangeSet", 
                         "actionTypeId": {
                             "category": "Deploy", 
                             "owner": "AWS", 
                             "version": "1", 
                             "provider": "CloudFormation"
                         }, 
                         "outputArtifacts": [], 
                         "configuration": {
                             "ActionMode": "CHANGE_SET_REPLACE", 
                             "ChangeSetName": "pipeline-changeset", 
                             "RoleArn": "arn:aws:iam:: xxxxxxx:role/CodeStarWorker-test-CloudFormation", 
                             "Capabilities": "CAPABILITY_NAMED_IAM", 
                             "StackName": "awscodestar-test-lambda", 
                             "ParameterOverrides": "{\"ProjectId\":\"test2\",
 \"CodeDeployRole\":\"arn:aws:iam:: xxxxxxx:role/CodeStarWorker-test-CodeDeploy\"}",

                             "TemplateConfiguration": "test-BuildArtifact::template-configuration.json", 
                             "TemplatePath": "test-BuildArtifact::template.yml"
                         }, 
                         "runOrder": 1
                     }, 
                     {
                         "region": "ap-northeast-1",
                         "inputArtifacts": [], 
                         "name": "ExecuteChangeSet", 
                         "actionTypeId": {
                             "category": "Deploy", 
                             "owner": "AWS", 
                             "version": "1", 
                             "provider": "CloudFormation"
                         }, 
                         "outputArtifacts": [], 
                         "configuration": {
                             "StackName": "awscodestar-test-lambda", 
                             "ActionMode": "CHANGE_SET_EXECUTE", 
                             "ChangeSetName": "pipeline-changeset"
                         }, 
                         "runOrder": 2
                     }
                 ]
             }
         ], 
         "artifactStores": {
             "ap-southeast-1": {
                 "type": "S3", 
                 "location": "source_backet"
             },
             "ap-northeast-1": {
                 "type": "S3", 
                 "location": "dest_backet"
             }
         }, 
         "name": "test-Pipeline", 
         "version": 1
     }

1 个答案:

答案 0 :(得分:0)

当我看到此错误时,这是​​两件事之一。

  1. 您没有将S3存储桶复制到第二个区域中正在使用的存储桶。 https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html
  2. 在复制完成之前,您的步骤正在运行。

如果是后者,我总是能够重新运行该步骤,它会成功。 S3复制的移动速度不够快似乎是一个问题。