diff --git a/lib/private/handlers/files.ts b/lib/private/handlers/files.ts index a002343..ee28270 100644 --- a/lib/private/handlers/files.ts +++ b/lib/private/handlers/files.ts @@ -89,7 +89,7 @@ export class FileAssetHandler implements IAssetHandler { throw new Error( `❗❗ UNEXPECTED BUCKET OWNER DETECTED ❗❗ - We've detected that the S3 bucket cdk-hnb659fds-assets-${await account()}-${destination.region} was + We've detected that the S3 bucket ${destination.bucketName} was originally created in account ${await account()} as part of the CloudFormation stack CDKToolkit, but now resides in a different AWS account. To prevent cross-account asset bucket access of your deployments, CDK will stop now. diff --git a/test/files.test.ts b/test/files.test.ts index 3f1c970..ba448f2 100644 --- a/test/files.test.ts +++ b/test/files.test.ts @@ -436,9 +436,7 @@ test('fails when cross account is required but not allowed', async () => { return { promise: () => Promise.resolve() }; }); - await expect(pub.publish({ allowCrossAccount: false })).rejects.toThrow( - '❗❗ UNEXPECTED BUCKET OWNER DETECTED ❗❗' - ); + await expect(pub.publish({ allowCrossAccount: false })).rejects.toThrow('❗❗ UNEXPECTED BUCKET OWNER DETECTED ❗❗'); }); test('succeeds when bucket doesnt belong to us but doesnt contain account id - cross account', async () => {