I am using AWS cdk to deploy codebuild and use BitBucketSourceAction class to build bitbucket source stage in the codepipeline. Below is the code I am using when using cdk v1. But after upgrading to cdk v2, I can't find this class from the library aws-cdk-lib. How can I build a bitbucket source stage from V2?
import * as actions from '@aws-cdk/aws-codepipeline-actions';
...
stageName: 'Source',
actions: [
new actions.BitBucketSourceAction({
actionName: 'SourceAction',
owner: owner,
connectionArn: connectionArn,
branch: branchName,
output:sourceOutput,
repo: bitbucketName,
}),
],
};
CodePudding user response:
According to the docs from the 1.x version You should use CodeStarConnectionsSourceAction instead of BitBucketSourceAction because it is deprecated. The CDK 2.x major version removed all the deprecated packages from the aws-cdk-lib package.
Here the references:
Deprecated properties, methods, and types in AWS CDK v1.x and its Construct Library have been removed completely from the CDK v2 API. In most supported languages, these APIs produce warnings under v1.x, so you may have already migrated to the replacement APIs. A complete list of deprecated APIs in CDK v1.x is available on GitHub.
