1

So I set up the connection in the pipeline settings and then applied the arn like so:

        const pipeline = new CodePipeline(this,'SettingsPipeline' , {
        pipelineName: 'SettingsPipeline',
        synth: new CodeBuildStep('SynthStep', {
            input: CodePipelineSource.connection('adamnjg/CDKSettings', 'main', {
                connectionArn: 'arn:aws:codestar-connections:eu-west-2:682167722541:connection/36ee3cf9-b409-4a94-ba54-b787081492b4'
             }),
            installCommands: [
                'npm install -g aws-cdk'
            ],
            commands: [
                'npm ci',
                'npm run build',
                'npx cdk synth'
            ]
        })
    })

When I manually trigger the pipeline in the console it gets the code from the repo no problem, and the webhook in bitbucket says that it is getting a 200 result.

Anybody got any ideas what I am missing?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • When you run `cdk deploy` do you see any errors in the output? Are you able to view the CloudFormation stack within the AWS Console? Prior to running `cdk deploy`, have you performed a `cdk bootstrap` command providing the --cloudformation-execution-policies flag in order to deploy the pipeline to your AWS account? This typically looks like `cdk deploy --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess` – Norman Jan 15 '22 at 06:38
  • So my bootstrap template shows: Fn::If: - HasCloudFormationExecutionPolicies - Ref: CloudFormationExecutionPolicies - Fn::If: - HasTrustedAccounts - Ref: AWS::NoValue - - Fn::Sub: arn:${AWS::Partition}:iam::aws:policy/AdministratorAccess Which I take to mean it has admin access? – Adam Nathan John Goldsmith Jan 15 '22 at 08:17
  • I do wonder if it is struggling as I was originally using CodeCommit as the repo and there is something left over from that... – Adam Nathan John Goldsmith Jan 15 '22 at 16:55
  • I've got exactly the same error just with a GitHub connection :( – Sandro_V Jan 26 '22 at 07:34

1 Answers1

0

I had the same challenge as code could be downloaded when the Pipeline was triggered manually but pushing new content to the repository, bitbucket in my case, did not trigger the Pipeline.

I solved the issue by providing the repository name in the source action in all lower case - Screenshot

You can get there by following the documentation on how Edit a pipeline (console)

My guess is that there happens some pattern matching between the repository name and the webhook invoke url. As the URL is all lowercase, it does not match and is not executed.

renpen
  • 23
  • 4