-
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
(aws_cdk.pipelines): ConfirmPermissionsBroadening only diffs on template differences #33061
Comments
@ashishdhingra that looks like a different issue to me. The automatic approval was just working fine in my tests. Thanks, |
@bpauwels Could you test your scenario with GitHub repo (refer #32482 (comment) for reproduction steps) and share if you are getting the same failed log? CodeCommit is not available for new customers anymore, so it might not be feasible to reproduce the issue. Thanks, |
Sure, here you go: import * as cdk from "aws-cdk-lib";
import { Construct } from "constructs";
import { Repository } from "aws-cdk-lib/aws-codecommit";
import {
CodePipeline,
CodePipelineSource,
ConfirmPermissionsBroadening,
ShellStep,
} from "aws-cdk-lib/pipelines";
import { ExampleStack } from "./example-stack";
class MyApplication extends cdk.Stage {
constructor(scope: Construct, id: string, props?: cdk.StageProps) {
super(scope, id, props);
new ExampleStack(this, "ExampleStack");
}
}
export class CdkCrossAccountConfirmPermissionBroadeningStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const pipeline = new CodePipeline(this, "Pipeline", {
pipelineName: "CodeArtifactNPMPipeline",
crossAccountKeys: true,
synth: new ShellStep("Synth", {
input: CodePipelineSource.connection('<<user/repo>>', 'main', {
connectionArn:
'arn:aws:codestar-connections:<<REGION>>:<<ACCOUNT-ID>>:connection/<<GUID>>',
}),
commands: ["npm ci", "npm run build", "npx cdk synth"],
})
});
const stage = new MyApplication(this, "Prod", {
env: { account: "<<TARGET ACCOUNT ID>>>", region: "eu-central-1" },
});
pipeline.addStage(stage, {
pre: [new ConfirmPermissionsBroadening("Check", { stage })],
});
}
} The behaviour of the ConfirmPermissionsBroadening step did not change. |
+1 can confirm this bug. From my understanding the condition on the codebuild service role mentioned by @bpauwels needs to be updated. The tag on the role it tries to assume seems to be "lookup" not "deploy". When i tested a similar setup early Sept. last year everything worked fine. But i can not say exactly when this behavior changed. |
Describe the bug
When using the ConfirmPermissionsBroadening check on a cross account stage, the CodeBuild project lacks permissions to assume neccesary roles in the target account, cannot create a cfn changeset and performs a diff only on template differences.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
A cloudformation changeset is being created in the target account and used as source to evaluate security related changes.
Current Behavior
Changeset cannot be created due to missing permissions on the Codebuild projects
The target account is properly bootstrapped, the trust policy of the file publishing role allows sts assume role from the source account.
The codebuild service role has a condition on the relevant policy that prevents assuming the file publishing role:
Reproduction Steps
Possible Solution
Fix the codebuild role
Additional Information/Context
No response
CDK CLI Version
2.176.0
Framework Version
No response
Node.js Version
v23.4.0
OS
MacOS
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: