-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CodeBuild: directly connect with codeStarConnection #32443
Comments
I'm not sure I've fully understood your issue, but does this example match your expectation? import { Stack, type StackProps } from "aws-cdk-lib";
import type { Construct } from "constructs";
import { CfnConnection } from "aws-cdk-lib/aws-codestarconnections";
import { Artifact, Pipeline } from "aws-cdk-lib/aws-codepipeline";
import {
CodeStarConnectionsSourceAction,
CodeBuildAction,
} from "aws-cdk-lib/aws-codepipeline-actions";
import { PipelineProject } from "aws-cdk-lib/aws-codebuild";
export class TestStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
// You can also import the connectionArn from another stack
const { attrConnectionArn: connectionArn } = new CfnConnection(
this,
"Connection",
{ connectionName: "connectionName" }
);
const sourceOutput = new Artifact();
const sourceAction = new CodeStarConnectionsSourceAction({
actionName: "ExampleConnection",
owner: "nmussy",
repo: "aws-cdk",
branch: "main",
output: sourceOutput,
connectionArn,
});
const buildAction = new CodeBuildAction({
actionName: "CodeBuild",
project: new PipelineProject(this, "Project"),
input: sourceOutput,
});
new Pipeline(this, "Pipeline", {
stages: [
{ stageName: "Source", actions: [sourceAction] },
{ stageName: "Build", actions: [buildAction] },
],
});
}
} |
Hi @nmussy Above example work when i creating pipeline as you explain. I am creating pipeline in different way. similar like below code. may be you can have a look. `export class PipelineStack extends Stack{
}` applicaton.ts 'stuffBuildStack.ts
//***************************************** ` |
@vwits-sujit , thanks for reaching out. I assume you are talking about such usage as mentioned here in these docs -
|
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Describe the feature
Codebuild project have property called source it allowed to connect to github/bitbucket/codeCommit by passing token key, can't find anyway to connect external source using existing codeStar connection.
Use Case
When I try to add stage in codePipeline, which have different codebuild I am not able to connect with external source. codePipeline.connection does have option to connect with external source by using codestar connection arn, which is not compartible with ISource in codeBuild.
Proposed Solution
No response
Other Information
No response
Acknowledgements
CDK version used
2.172.0
Environment details (OS name and version, etc.)
ALL
The text was updated successfully, but these errors were encountered: