question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

codepipeline: construct should allow 'disableInboundStageTransitions' to be set

See original GitHub issue

The codepipeline construct doesn’t allow the disableInboundStageTransitions property to be set. This is useful for pipelines you want to run on a schedule or some other event rather than for every source change.

There is a workaround via the CfnPipeline, but it would be great if we could do this through the construct, either in the Pipeline construct, the individual Stage constructs, or both.

Workaround code is:

const cfnPipeline = pipeline.node.findChild('Resource') as codepipeline.CfnPipeline
cfnPipeline.propertyOverrides.disableInboundStageTransitions = [{
    reason: 'Pipeline is triggered by schedule not source changes',
    stageName: 'Source'
}]

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
skinny85commented, Oct 30, 2019

Still relevant.

1reaction
paulrichards-provarcommented, Jun 26, 2021

I’m using cdk version 1.109.0 (build c647e38)

`import { Repository } from ‘@aws-cdk/aws-codecommit’; import { CodeCommitSourceAction } from “@aws-cdk/aws-codepipeline-actions”; import { Artifact, CfnPipeline } from ‘@aws-cdk/aws-codepipeline’; import { Construct, Stack, StackProps } from ‘@aws-cdk/core’; import { CdkPipeline, SimpleSynthAction } from ‘@aws-cdk/pipelines’;

interface PipelineStackProps extends StackProps { env: any }

export class PipelineStack extends Stack { constructor(scope: Construct, id: string, props: PipelineStackProps) { super(scope, id, props);

const cloudAssemblyArtifact = new Artifact();
const sourceArtifact = new Artifact();
const repoArn = `arn:aws:codecommit:${props.env.region}:${props.env.account}:SomeRepo`;


const pipeline = new CdkPipeline(this, "TestPipeline", {
  pipelineName: "TestPipeline",
  cloudAssemblyArtifact,
  sourceAction: new CodeCommitSourceAction({
    actionName: "PipelineSource",
    repository: Repository.fromRepositoryArn(
      this,
      "TestRepo",
      repoArn,
    ),
    branch: "main",
    output: sourceArtifact
  }),
  synthAction: SimpleSynthAction.standardNpmSynth({
    sourceArtifact,
    cloudAssemblyArtifact,
    buildCommand: "npm run build && npm test",
  }),
});

pipeline.node.findChild('Resource') as CfnPipeline;

} } `

Read more comments on GitHub >

github_iconTop Results From Across the Web

CodePipeline::Pipeline StageTransition - AWS CloudFormation
The reason given to the user that a stage is disabled, such as waiting for manual approval or manual tests. This message is...
Read more >
How can I disable transition in codepipeline via CDK?
As of CDK v2.1, the codepipeline.Pipeline class does not expose this property, but the Level1 CfnPipeline class it builds on does (github ...
Read more >
@aws-cdk/aws-codepipeline - npm
Construct an empty Pipeline const pipeline = new codepipeline. ... Actions that don't take an AWS resource will accept an explicit region ...
Read more >
AWS::CodePipeline::Pipeline StageTransition - 亚马逊云科技
The name of the pipeline in which you want to disable the flow of artifacts from one stage to another.
Read more >
awslabs/aws-cdk - Gitter
hey there! is there a way to create a codepipeline pipeline source stage with ... not clear how to combine these with a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found