diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index 3a8cecbbfd2e2..a11565634aea6 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -9,7 +9,7 @@ import perms = require('./perms'); import { CommonPipelineSourceProps, PipelineSource } from './pipeline-action'; import { LifecycleRule } from './rule'; import { BucketArn, BucketDomainName, BucketDualStackDomainName, BucketName, cloudformation } from './s3.generated'; -import { parseBucketArn, parseBucketName, validateBucketName } from './util'; +import { parseBucketArn, parseBucketName } from './util'; /** * A reference to a bucket. The easiest way to instantiate is to call @@ -367,8 +367,6 @@ export class Bucket extends BucketRef { constructor(parent: cdk.Construct, name: string, props: BucketProps = {}) { super(parent, name); - validateBucketName(props && props.bucketName); - const { bucketEncryption, encryptionKey } = this.parseEncryption(props); const resource = new cloudformation.BucketResource(this, 'Resource', { diff --git a/packages/@aws-cdk/aws-s3/lib/util.ts b/packages/@aws-cdk/aws-s3/lib/util.ts index 13783c94bee11..830f51a349fc7 100644 --- a/packages/@aws-cdk/aws-s3/lib/util.ts +++ b/packages/@aws-cdk/aws-s3/lib/util.ts @@ -1,16 +1,6 @@ import { Arn } from '@aws-cdk/cdk'; import { BucketRefProps } from './bucket'; -export function validateBucketName(bucketName?: string) { - if (!bucketName) { - return; - } - - if (bucketName.search(/[^a-z0-9.-]/g) !== -1) { - throw new Error('Bucket name contains invalid characters: ' + bucketName); - } -} - export function parseBucketArn(props: BucketRefProps) { // if we have an explicit bucket ARN, use it.