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
답변함 일 년 전
profile picture
전문가
검토됨 한 달 전
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
답변함 일 년 전
  • 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
답변함 일 년 전
  • 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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인