Skip to content
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

fix(aws-lambda): jsii use no long requires 'sourceAccount' #728

Merged
merged 1 commit into from
Sep 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/lib/lambda-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export abstract class FunctionRef extends cdk.Construct
const permissionId = `AllowBucketNotificationsFrom${bucketId}`;
if (!this.tryFindChild(permissionId)) {
this.addPermission(permissionId, {
sourceAccount: new cdk.AwsAccountId(),
sourceAccount: new cdk.AwsAccountId().toString(),
principal: new cdk.ServicePrincipal('s3.amazonaws.com'),
sourceArn: bucketArn,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/lib/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface Permission {
* bucket owner's account ID. You can use this property to ensure that all
* source principals are owned by a specific account.
*/
sourceAccount?: any;
sourceAccount?: string;

/**
* The ARN of a resource that is invoking your function. When granting
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/test/test.lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export = {
fn.addPermission('S3Permission', {
action: 'lambda:*',
principal: new cdk.ServicePrincipal('s3.amazonaws.com'),
sourceAccount: new cdk.AwsAccountId(),
sourceAccount: new cdk.AwsAccountId().toString(),
sourceArn: new cdk.Arn('arn:aws:s3:::my_bucket')
});

Expand Down