From 09d66a0cbd339e5cbbf4b0461e5842ea83080dc9 Mon Sep 17 00:00:00 2001 From: Sean Schofield Date: Wed, 1 May 2019 02:07:25 -0400 Subject: [PATCH] chore(aws-s3): fixed broken documentation example (#2401) fixes #2384 --- packages/@aws-cdk/aws-s3/lib/bucket.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index a671d0ee43a26..898a6f68a0b62 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -147,12 +147,12 @@ export interface IBucket extends IResource { * Without arguments, this method will grant read ("s3:GetObject") access to * all objects ("*") in the bucket. * - * The method returns the `iam.PolicyStatement` object, which can then be modified + * The method returns the `iam.Grant` object, which can then be modified * as needed. For example, you can add a condition that will restrict access only * to an IPv4 range like this: * - * const statement = bucket.grantPublicAccess(); - * statement.addCondition('IpAddress', { "aws:SourceIp": "54.240.143.0/24" }); + * const grant = bucket.grantPublicAccess(); + * grant.resourceStatement!.addCondition(‘IpAddress’, { “aws:SourceIp”: “54.240.143.0/24” }); * * * @param keyPrefix the prefix of S3 object keys (e.g. `home/*`). Default is "*". @@ -454,12 +454,12 @@ export abstract class BucketBase extends Resource implements IBucket { * Without arguments, this method will grant read ("s3:GetObject") access to * all objects ("*") in the bucket. * - * The method returns the `iam.PolicyStatement` object, which can then be modified + * The method returns the `iam.Grant` object, which can then be modified * as needed. For example, you can add a condition that will restrict access only * to an IPv4 range like this: * - * const statement = bucket.grantPublicAccess(); - * statement.addCondition('IpAddress', { "aws:SourceIp": "54.240.143.0/24" }); + * const grant = bucket.grantPublicAccess(); + * grant.resourceStatement!.addCondition(‘IpAddress’, { “aws:SourceIp”: “54.240.143.0/24” }); * * * @param keyPrefix the prefix of S3 object keys (e.g. `home/*`). Default is "*".