An error occurred (InvalidActionDeclarationException) when calling the UpdatePipeline operation: Input Artifact Bundle MyAppBuild in action ExternalDeploy is not declared as Output Artifact Bundle in

0

Hi all, I am trying to create a pipeline in CodePipeline that uses resources from another AWS account. My code pipeline is in DEV account and deployment instances are created through CodeDeploy in PROD account. I made all configurations and updated codepipeline configuration file according this tutorial: https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create-cross-account.html When I tried to save the pipeline.json file, I got the error below: `C:\Users\scguser>aws codepipeline update-pipeline --cli-input-json file://pipeline.json

An error occurred (InvalidActionDeclarationException) when calling the UpdatePipeline operation: Input Artifact Bundle MyAppBuild in action ExternalDeploy is not declared as Output Artifact Bundle in any of the preceding actions`

below is a piece of configuration:

.....
{
                "name": "PROD_Deploy",
                "actions": [
                    {
                        "inputArtifacts": [
                            {
                                "name": "MyAppBuild"
                            }
                        ],
                        "name": "ExternalDeploy",
                        "actionTypeId": {
                            "category": "Deploy",
                            "owner": "AWS",
                            "version": "1",
                            "provider": "CodeDeploy"
                        },
                        "outputArtifacts": [],
                        "configuration": {
                            "ApplicationName": "prod-app-idp",
                            "DeploymentGroupName": "prod-depl-group-idp"
                        },
                        "runOrder": 1,
                        "roleArn": "arn:aws:iam::<prod  iam account>:role/cross-account-role-pipeline"
                    }
                ]
            }

So, what is going wrong in my side? Thank you

profile picture
dimasty
gefragt vor einem Monat108 Aufrufe
1 Antwort
0

Hello ,



greeting for the day . 



I would like to inform you that this issue generally occurs when any input Artifacts defined in an action of a code pipeline is not declared in the preceding action of the same pipeline .

Example for reference :

{
 "pipeline": {
  "roleArn": "arn:aws:iam::111111111111:role/AWS-CodePipeline-Service",
  "stages": [
    {
      "name": "Source",
      "actions": [
        {
          "inputArtifacts": [],
          "name": "Source",
          "actionTypeId": {
            "category": "Source",
            "owner": "AWS",
            "version": "1",
            "provider": "S3"
          },
          "outputArtifacts": [
            {
              "name": "MyApp”.             <<=====Output artifacts is defined with the name MyApp in source action  here . 
            }
          ],
          "configuration": {
            "S3Bucket": "awscodepipeline-demo-bucket2",
            "S3ObjectKey": "aws-codepipeline-s3-aws-codedeploy_linux.zip"
          },
          "runOrder": 1
        }
      ]
    },
    {
      "name": "Beta",
      "actions": [
        {
          "inputArtifacts": [
            {
              "name": "MyApp”.     <============ the same output artifacts MyApp is used as input artifacts here . 
            }
          ],
          "name": "CodePipelineDemoFleet",
          "actionTypeId": {
            "category": "Deploy",
            "owner": "AWS",
            "version": "1",
            "provider": "CodeDeploy"
          },
          "outputArtifacts": [],
          "configuration": {
            "ApplicationName": "CodePipelineDemoApplication",
            "DeploymentGroupName": "CodePipelineDemoFleet"
          },
          "runOrder": 1
        }
      ]
    }
  ],

Please note that in this example the input Artifacts called "MyApp" defined in action name “CodePipelineDemoFleet” is already declared to be available to the output Artifacts of action source .

Now in your example you have shared with us , I can observe that you have defined the input Artifacts : "MyAppBuild" as mentioned below

{
                "name": "PROD_Deploy",
                "actions": [
                    {
                        "inputArtifacts": [
                            {
                                "name": "MyAppBuild”.      
                            }
                        ],

Can you please confirm if this input Artifacts:”MyAppBuild” is passed as output Artifacts in any other action of your pipeline . In order to troubleshoot this issue I would suggest to pass the output Artifacts :””MyAppBuild” from the preceding action of your code pipeline which will help you to resolve this issue

Lastly I hope the above mentioned information sounds good to you and address your query raised . In case you have any further questions then please feel free to reach out to us , we will be always happy to assist you further .

Have a great day ahead .

AWS
SUPPORT-TECHNIKER
beantwortet vor einem Monat
profile picture
EXPERTE
überprüft vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen