Packaging Java Lamba using CDK is failing in Code Build
I am following this blog - https://aws.amazon.com/blogs/opensource/packaging-and-deploying-aws-lambda-functions-written-in-java-with-aws-cloud-development-kit/ to create the java lambda using CDK. But when I pushed the changes and it is failing in code build with the below error. The "cdk synth" worked in my local machine. Can some one give any insights on this issue ?
Bundling asset TestStack/test/LambdaStack/LambdaFunction/Code/Stage...
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (default-cli) on project test: An exception occured while executing the Java class. Failed to bundle asset TestStack/test/LambdaStack/LambdaFunction/Code/Stage, bundle output is located at /codebuild/output/src940121800/src/cdk.out/asset.593cf75a4cb232e162ae4760eddc8336106322f580119285c2b8f0df0c517874-error: Error: docker exited with status 125
I enabled the privileged option in the environment variable in code build and also added "dockerEnabledForSynth(true)" in CodePipeline construct. Then it ran as expected.
I think the mvn build script is trying to download the maven libraries, but it got failed resulted in error. The moment I enabled the privileged option, it worked. I think, this is nothing to do with Docker but not sure.
Relevant questions
AWS CDK 2: Package subpath './aws-cloudfront/lib/experimental' is not defined by "exports" in xxx/node_modules/aws-cdk-lib/package.json
asked 5 months agoAWS Sns Publish method is not working when application deployed using docker container
asked 2 months agoCfnParameter giving me unresolved tokens error
asked 2 months agoTaskDefinition CDK and LogConfiguration
Accepted Answerasked 5 months agoWatching TypeScript CDK Builds
asked 2 months agoCDK - how to set OpenSearch/Elasticsearch as the destination of a Kinesis Firehose?
asked 2 months agoPackaging Java Lamba using CDK is failing in Code Build
asked 2 months agoChange CodeBuild Image for AWS Lambda Applications
asked 4 months agoCreate API GW-v2 with Lambda using CDK-2.0
asked 2 months agoJava8 for iOS Appium testng test
asked 2 years ago