AWS CodePipeline报错“Missing required parameter in pipeline.stages[0]: "name""

0

【以下的问题经过翻译处理】 我正在尝试创建我的应用程序的CICD,它可以在Bitbucket上使用。为此,我创建了AWS CodePipeline,它将将此应用程序部署到ECS Cluster。我正在尝试通过AWS CLI完成此操作。以下是我的JSON文件:

{
    "pipeline": {
        "roleArn": "arn:aws:iam::xxxxxxxxxxxx:role/service-role/AWSCodePipelineServiceRole-us-east-1-HubspotConnector",
        "stages": [{
                "Name": "Source",
                "Actions": [{
                    "InputArtifacts": [],
                    "ActionTypeId": {
                        "Version": "1",
                        "Owner": "AWS",
                        "Category": "Source",
                        "Provider": " "
                    },
                    "OutputArtifacts": [{
                        "Name": "SourceArtifact"
                    }],
                    "RunOrder": 1,
                    "Configuration": {
                        "ConnectionArn": "arn:aws:codestar-connections:us-east-1:7xxxxxxxx3930:connection/5bxxxx2-257f-4xxxxx0-xxx3-edfdsfsdf7d672f",
                        "FullRepositoryId": "rxxxxxh/hubspotcctorpipeline",
                        "BranchName": "main",
                        "OutputArtifactFormat": "CODE_ZIP"
                    },
                    "Name": "ApplicationSource"
                }]
            },
            {
                "name": "Build",
                "actions": [{
                    "inputArtifacts": [{
                        "name": "SourceArtifact"
                    }],
                    "name": "Build",
                    "actionTypeId": {
                        "category": "Build",
                        "owner": "AWS",
                        "version": "1",
                        "provider": "CodeBuild"
                    },
                    "outputArtifacts": [{
                        "name": "default"
                    }],
                    "Configuration": {
                        "ProjectName": "cicdCli"
                    },
                    "runOrder": 1
                }]
            },
            {
                "Name": "DeployECS",
                "ActionTypeId": {
                    "Category": "Deploy",
                    "Owner": "AWS",
                    "Provider": "ECS",
                    "Version": "1"
                },
                "RunOrder": 2,
                "Configuration": {
                    "ClusterName": "my-ecs-cluster",
                    "ServiceName": "sample-app-service",
                    "FileName": "imagedefinitions.json",
                    "DeploymentTimeout": "15"
                },
                "OutputArtifacts": [],
                "InputArtifacts": [{
                    "Name": "my-image"
                }]
            }
        ],
        "artifactStore": {
            "type": "S3",
            "location": "codepipeline-us-east-1-1xxx5xxxx29"
        },
        "name": "newPipelineCicd",
        "version": 1
    }
}

有人可以描述我做错了什么吗?我已经搜索了这些错误,但没有从任何地方得到任何帮助。也没有人为此编写任何教程或适当的指南。我找到了 AWS 文档,这是最复杂的文档之一。请在这里指导我。我将非常感激。

1 回答
0

【以下的回答经过翻译处理】 AWS CLI 输入文件中的参数名称区分大小写。

建议您使用--generate-cli-skeleton选项生成包含“正确”参数名称的模板,以避免错误。

aws codepipeline create-pipeline --generate-cli-skeleton

有关 CLI Skeleton 模板,请参阅文档

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则