CDK Action allows only one Input, but I need two

2

Hi all,

my project repository setup is like this: . ./lambda ./infrastructure

I am using CDK with Java and I have a maven build both in the "lambda" sub-folder (which contains my lambda code) and in the "infrastructure" folder (which contains my CDK code). In my CodeCatalyst workflow, I was planning to execute my "mvn package" (which builds the lambda jar file) and save this artifact. Then, this artifact needs to be used in the "cdk deploy" action. But as the "cdk deploy" action also needs the "source" input, I would need two inputs.

CodeCatalyst denies that with an error message: Action InfrastructureDeployment declares 2 input artifacts which is more than the maximum count (1)

Does anyone have an idea on how to resolve that?

Thanks! Johannes

  BaseInfrastructureDeployment:
    Identifier: aws/cdk-deploy@v1
    Configuration:
      CdkRootPath: infrastructure
      Region: eu-central-1
      StackName: BaseStack
    Compute:
      Type: Lambda
    Environment:
      Connections:
        - Role: CodeCatalystPreviewDevelopmentAdministrator-z4s5g1
          Name: "916032256060"
      Name: alpha
    DependsOn:
      - Build
    Inputs:
      Variables:
        - Name: CODEBUILD_SRC_DIR_LambdaBuildOutput
          Value: /artifacts/BaseInfrastructureDeployment/lambda_build/lambda/target/lambda-1.0.0-jar-with-dependencies.jar
        - Name: xxx
          Value: test
      Artifacts:
        - lambda_build
      Sources:
        - WorkflowSource
4 個答案
0
已接受的答案

Hi Johannes,

We have removed the restriction on the CDK deploy action to have both input source and artifacts. Let us know if you are able to build and deploy your Lambda application?

profile pictureAWS
專家
Ranjith
已回答 1 年前
profile picture
專家
已審閱 1 個月前
profile pictureAWS
專家
已審閱 10 個月前
  • HI Ranjith

    Thanks, this works now and I am able to move on!

    Great stuff! Thanks again for your support!

0

Hi Johannes,

We are working on a fix for this issue and will post an update as soon as we have the fix deployed. You should be able to define multiple inputs - only one in the Sources section, but up to 2 in the Artifacts section. Additionally, we are also working on the ability to catch these types of constraints when you commit the workflow instead of waiting till the workflow is run.

profile pictureAWS
專家
Ranjith
已回答 1 年前
  • Hi Ranjith

    Thanks for the feedback! Is there an ETA on this? It blocks me from moving my personal project over :-)

    Working with "monorepos" (Where infrastructure, application code, UI code are in one repository) seems to be challenging in CodeCatalyst - or is there a best practice on how to set up projects "correctly"?

  • Any updates on this one, @Ranjith?

0

Hi Johannes,

On the CDK issue, we'll get back to you with a timeline early next week.

Regarding monorepos, can you elaborate what you are trying to achieve? You can have a workflow per service in your monorepo by configuring the FilesChanged attribute in the Trigger section to start a workflow run on changes in specific folders. Let us know if the Examples section helps you.

profile pictureAWS
專家
Ranjith
已回答 1 年前
  • Well, essentially if you use a monorepo you neeed to do a lot of "changing directories" in CodeCatalyst today as I see it - going from one to another directory to execute parts of the deployments and stuff like that. I am not sure that my comment is making sense and it might come down to the "project setup" (and the used build tool) to resolve this to be honest. The idea to have a specific workflow triggered for "FilesChanged" -- will look at that and see if it makes things easier for me.

0

Johannes, thanks for the quick response. I'm glad to hear that you were able to get your workflow to work.

profile pictureAWS
專家
Ranjith
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南