Setting up CI/CD for an AWS CDK app using AWS CodeBuild/Deploy/Pipeline
It may be helpful to look at the different AWS developer services as you are trying to achieve your goal in the wrong services:


Running the specific dotnet testing and publish steps are not done in CodeDeploy.  Rather, they would be done in AWS CodeBuild, in the AWS Pipeline, or directly on your Jenkins Server.
AWS CodeDeploy is for taking your build artifacts and deploying them "to a variety of compute services such as Amazon EC2, AWS Fargate, AWS Lambda, and your on-premises servers".
AWS CodePipeline is for modeling an automated workflow.  This service integrates with Jenkins and GitHub.


With these services in mind I think what you are looking for is to start with a new CodePipeline.  This will allow you to start building a model that specifies where you are running your dotnet tests (Jenkins or on AWS) and what to do with your artifacts (publish through Jenkins or AWS CodeDeploy).  This can be accomplished with AWS CDK.