From 857bdc73706f9712f1dfd8ede887503b62a564ad Mon Sep 17 00:00:00 2001 From: Evan K <113387406+evzzk@users.noreply.github.com> Date: Mon, 7 Oct 2024 06:54:02 -1000 Subject: [PATCH] docs: update s3 bucket physical names to use amazon owned s3 buckets (#31576) ### Issue # (if applicable) Closes #. ### Reason for this change By using Amazon owned s3 bucket physical names, we remove the possibility of documenting customer owned buckets in our examples. ### Description of changes Change physical S3 bucket names such as `my-bucket` to Amazon owned ones such as `amzn-s3-demo-bucket`. ### Description of how you validated changes ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- CHANGELOG.md | 6 +- .../aws-servicediscovery-integ.assets.json | 6 +- .../aws-servicediscovery-integ.template.json | 10 +-- .../cdk.out | 2 +- .../integ.json | 2 +- .../manifest.json | 18 ++--- .../tree.json | 68 ++++++++++++------- .../integ.service-with-http-namespace.lit.ts | 2 +- .../app-staging-synthesizer-alpha/README.md | 2 +- .../@aws-cdk/aws-codestar-alpha/README.md | 2 +- .../@aws-cdk/aws-redshift-alpha/README.md | 2 +- packages/@aws-cdk/integ-tests-alpha/README.md | 4 +- packages/aws-cdk-lib/README.md | 6 +- packages/aws-cdk-lib/aws-cloudfront/README.md | 4 +- .../aws-cloudtrail/SAMPLE-EVENTS.md | 8 +-- packages/aws-cdk-lib/aws-codebuild/README.md | 2 +- .../aws-codepipeline-actions/README.md | 2 +- .../aws-cdk-lib/aws-codepipeline/README.md | 2 +- .../aws-lambda-event-sources/README.md | 2 +- packages/aws-cdk-lib/aws-lambda/README.md | 2 +- packages/aws-cdk-lib/aws-s3-assets/README.md | 4 +- packages/aws-cdk-lib/aws-s3/README.md | 36 +++++----- .../aws-cdk-lib/aws-servicecatalog/README.md | 2 +- .../integ.service-with-http-namespace.lit.ts | 2 +- .../aws-stepfunctions-tasks/README.md | 6 +- .../cloudformation-include/README.md | 8 +-- packages/aws-cdk-lib/core/README.md | 2 +- .../core/adr/cross-region-stack-references.md | 16 ++--- .../aws-cdk-lib/custom-resources/README.md | 2 +- packages/aws-cdk-lib/pipelines/README.md | 2 +- packages/aws-cdk/README.md | 20 +++--- 31 files changed, 135 insertions(+), 117 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70e83e6e82302..13b7ef86149c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7484,10 +7484,10 @@ const bucket = new s3.Bucket(this, 'L2Bucket'); const bucketResource = bucket.findChild('Resource') as s3.cloudformation.BucketResource; // strongly-typed overrides -bucketResource.propertyOverrides.bucketName = 'NewBucketName'; +bucketResource.propertyOverrides.bucketName = 'amzn-s3-demo-bucket'; // weakly-typed overrides -bucketResource.addPropertyOverride('BucketName', 'NewerBucketName'); +bucketResource.addPropertyOverride('BucketName', 'amzn-s3-demo-bucket1'); ``` ### Bug Fixes @@ -8289,7 +8289,7 @@ new Pipeline(this, 'MyCoolPipeline', { artifactsBucket: bucket }); You can also import a bucket by just specifying its name: ```typescript -const bucket = Bucket.import({ bucketName: new BucketName('my-bucket') }); +const bucket = Bucket.import({ bucketName: new BucketName('amzn-s3-demo-bucket') }); new Pipeline(this, 'MyCoolPipeline', { artifactsBucket: bucket }); ``` diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/aws-servicediscovery-integ.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/aws-servicediscovery-integ.assets.json index c1fd9cebdaa9b..80e4d9e96f788 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/aws-servicediscovery-integ.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/aws-servicediscovery-integ.assets.json @@ -1,7 +1,7 @@ { - "version": "20.0.0", + "version": "38.0.1", "files": { - "ea42ace1ba66461746ff5ebdce1e1c0fa37f12e32c367e3819aafaa44afe738e": { + "13ad8d0248b0f59b00ee16d1d818d24403ff02a8722a623a96510f74baa0277d": { "source": { "path": "aws-servicediscovery-integ.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ea42ace1ba66461746ff5ebdce1e1c0fa37f12e32c367e3819aafaa44afe738e.json", + "objectKey": "13ad8d0248b0f59b00ee16d1d818d24403ff02a8722a623a96510f74baa0277d.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/aws-servicediscovery-integ.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/aws-servicediscovery-integ.template.json index c7444be33fe10..fba9ee9c9c342 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/aws-servicediscovery-integ.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/aws-servicediscovery-integ.template.json @@ -22,15 +22,15 @@ "Type": "AWS::ServiceDiscovery::Instance", "Properties": { "InstanceAttributes": { - "arn": "arn:aws:s3:::mybucket" + "arn": "arn:aws:s3:::amzn-s3-demo-bucket" }, + "InstanceId": "ervicediscoveryintegMyNamespaceNonIpServiceNonIpInstance45389A2A", "ServiceId": { "Fn::GetAtt": [ "MyNamespaceNonIpService3B425009", "Id" ] - }, - "InstanceId": "ervicediscoveryintegMyNamespaceNonIpServiceNonIpInstance45389A2A" + } } }, "MyNamespaceIpService220F547F": { @@ -57,13 +57,13 @@ "AWS_INSTANCE_IPV4": "54.239.25.192", "AWS_INSTANCE_PORT": "80" }, + "InstanceId": "awsservicediscoveryintegMyNamespaceIpServiceIpInstance56070746", "ServiceId": { "Fn::GetAtt": [ "MyNamespaceIpService220F547F", "Id" ] - }, - "InstanceId": "awsservicediscoveryintegMyNamespaceIpServiceIpInstance56070746" + } } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/cdk.out index 588d7b269d34f..c6e612584e352 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/integ.json index d853015823374..0eeb7558d3c9d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "38.0.1", "testCases": { "integ.service-with-http-namespace.lit": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/manifest.json index 8a557ec39bb8d..cdc16a375ba26 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "38.0.1", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-servicediscovery-integ.assets": { "type": "cdk:asset-manifest", "properties": { @@ -20,10 +14,12 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "aws-servicediscovery-integ.template.json", + "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ea42ace1ba66461746ff5ebdce1e1c0fa37f12e32c367e3819aafaa44afe738e.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/13ad8d0248b0f59b00ee16d1d818d24403ff02a8722a623a96510f74baa0277d.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -83,6 +79,12 @@ ] }, "displayName": "aws-servicediscovery-integ" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/tree.json index 2ad6dbf58d98f..cece23396b998 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "aws-servicediscovery-integ": { "id": "aws-servicediscovery-integ", "path": "aws-servicediscovery-integ", @@ -30,7 +22,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnHttpNamespace", + "fqn": "aws-cdk-lib.aws_servicediscovery.CfnHttpNamespace", "version": "0.0.0" } }, @@ -54,7 +46,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnService", + "fqn": "aws-cdk-lib.aws_servicediscovery.CfnService", "version": "0.0.0" } }, @@ -69,31 +61,31 @@ "aws:cdk:cloudformation:type": "AWS::ServiceDiscovery::Instance", "aws:cdk:cloudformation:props": { "instanceAttributes": { - "arn": "arn:aws:s3:::mybucket" + "arn": "arn:aws:s3:::amzn-s3-demo-bucket" }, + "instanceId": "ervicediscoveryintegMyNamespaceNonIpServiceNonIpInstance45389A2A", "serviceId": { "Fn::GetAtt": [ "MyNamespaceNonIpService3B425009", "Id" ] - }, - "instanceId": "ervicediscoveryintegMyNamespaceNonIpServiceNonIpInstance45389A2A" + } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnInstance", + "fqn": "aws-cdk-lib.aws_servicediscovery.CfnInstance", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.NonIpInstance", + "fqn": "aws-cdk-lib.aws_servicediscovery.NonIpInstance", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.Service", + "fqn": "aws-cdk-lib.aws_servicediscovery.Service", "version": "0.0.0" } }, @@ -122,7 +114,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnService", + "fqn": "aws-cdk-lib.aws_servicediscovery.CfnService", "version": "0.0.0" } }, @@ -140,48 +132,72 @@ "AWS_INSTANCE_IPV4": "54.239.25.192", "AWS_INSTANCE_PORT": "80" }, + "instanceId": "awsservicediscoveryintegMyNamespaceIpServiceIpInstance56070746", "serviceId": { "Fn::GetAtt": [ "MyNamespaceIpService220F547F", "Id" ] - }, - "instanceId": "awsservicediscoveryintegMyNamespaceIpServiceIpInstance56070746" + } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnInstance", + "fqn": "aws-cdk-lib.aws_servicediscovery.CfnInstance", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.IpInstance", + "fqn": "aws-cdk-lib.aws_servicediscovery.IpInstance", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.Service", + "fqn": "aws-cdk-lib.aws_servicediscovery.Service", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.HttpNamespace", + "fqn": "aws-cdk-lib.aws_servicediscovery.HttpNamespace", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-servicediscovery-integ/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-servicediscovery-integ/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" } } }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts index d45cf63409f4d..bf35e004e0b65 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts @@ -13,7 +13,7 @@ const service1 = namespace.createService('NonIpService', { }); service1.registerNonIpInstance('NonIpInstance', { - customAttributes: { arn: 'arn:aws:s3:::mybucket' }, + customAttributes: { arn: 'arn:aws:s3:::amzn-s3-demo-bucket' }, }); const service2 = namespace.createService('IpService', { diff --git a/packages/@aws-cdk/app-staging-synthesizer-alpha/README.md b/packages/@aws-cdk/app-staging-synthesizer-alpha/README.md index 1e45d14d5a2f7..50c4284c6ee6c 100644 --- a/packages/@aws-cdk/app-staging-synthesizer-alpha/README.md +++ b/packages/@aws-cdk/app-staging-synthesizer-alpha/README.md @@ -336,7 +336,7 @@ class CustomStagingStack extends Stack implements IStagingResources { public addFile(asset: FileAssetSource): FileStagingLocation { return { - bucketName: 'myBucket', + bucketName: 'amzn-s3-demo-bucket', assumeRoleArn: 'myArn', dependencyStack: this, }; diff --git a/packages/@aws-cdk/aws-codestar-alpha/README.md b/packages/@aws-cdk/aws-codestar-alpha/README.md index d588bf7760055..b6a2b287b02f4 100644 --- a/packages/@aws-cdk/aws-codestar-alpha/README.md +++ b/packages/@aws-cdk/aws-codestar-alpha/README.md @@ -29,7 +29,7 @@ new codestar.GitHubRepository(this, 'GitHubRepo', { accessToken: SecretValue.secretsManager('my-github-token', { jsonField: 'token', }), - contentsBucket: s3.Bucket.fromBucketName(this, 'Bucket', 'bucket-name'), + contentsBucket: s3.Bucket.fromBucketName(this, 'Bucket', 'amzn-s3-demo-bucket'), contentsKey: 'import.zip', }); ``` diff --git a/packages/@aws-cdk/aws-redshift-alpha/README.md b/packages/@aws-cdk/aws-redshift-alpha/README.md index bd43d96f838f9..04b0d911c963d 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/README.md +++ b/packages/@aws-cdk/aws-redshift-alpha/README.md @@ -62,7 +62,7 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2'; import * as s3 from 'aws-cdk-lib/aws-s3'; const vpc = new ec2.Vpc(this, 'Vpc'); -const bucket = s3.Bucket.fromBucketName(this, 'bucket', 'logging-bucket'); +const bucket = s3.Bucket.fromBucketName(this, 'bucket', 'amzn-s3-demo-bucket'); const cluster = new Cluster(this, 'Redshift', { masterUser: { diff --git a/packages/@aws-cdk/integ-tests-alpha/README.md b/packages/@aws-cdk/integ-tests-alpha/README.md index ff04b1cb477c1..a9e9f7da70031 100644 --- a/packages/@aws-cdk/integ-tests-alpha/README.md +++ b/packages/@aws-cdk/integ-tests-alpha/README.md @@ -500,11 +500,11 @@ need to do is add a dependency between the calls. There is an helper method `nex declare const integ: IntegTest; integ.assertions.awsApiCall('S3', 'putObject', { - Bucket: 'my-bucket', + Bucket: 'amzn-s3-demo-bucket', Key: 'my-key', Body: 'helloWorld', }).next(integ.assertions.awsApiCall('S3', 'getObject', { - Bucket: 'my-bucket', + Bucket: 'amzn-s3-demo-bucket', Key: 'my-key', })); ``` diff --git a/packages/aws-cdk-lib/README.md b/packages/aws-cdk-lib/README.md index 54a158fdc326d..f85534b9c7634 100644 --- a/packages/aws-cdk-lib/README.md +++ b/packages/aws-cdk-lib/README.md @@ -147,7 +147,7 @@ a stack with a synthesizer, pass it as one of its properties: ```ts new MyStack(app, 'MyStack', { synthesizer: new DefaultStackSynthesizer({ - fileAssetsBucketName: 'my-orgs-asset-bucket', + fileAssetsBucketName: 'amzn-s3-demo-bucket', }), }); ``` @@ -1173,7 +1173,7 @@ The `CfnResource` class allows emitting arbitrary entries in the new CfnResource(this, 'ResourceId', { type: 'AWS::S3::Bucket', properties: { - BucketName: 'bucket-name' + BucketName: 'amzn-s3-demo-bucket' }, }); ``` @@ -1197,7 +1197,7 @@ new CfnInclude(this, 'ID', { Bucket: { Type: 'AWS::S3::Bucket', Properties: { - BucketName: 'my-shiny-bucket' + BucketName: 'amzn-s3-demo-bucket' } } } diff --git a/packages/aws-cdk-lib/aws-cloudfront/README.md b/packages/aws-cdk-lib/aws-cloudfront/README.md index f954f7817a78e..69c9dbe1464c2 100644 --- a/packages/aws-cdk-lib/aws-cloudfront/README.md +++ b/packages/aws-cdk-lib/aws-cloudfront/README.md @@ -1124,7 +1124,7 @@ new cloudfront.CloudFrontWebDistribution(this, 'ADistribution', { originConfigs: [ { s3OriginSource: { - s3BucketSource: s3.Bucket.fromBucketName(this, 'aBucket', 'myoriginbucket'), + s3BucketSource: s3.Bucket.fromBucketName(this, 'aBucket', 'amzn-s3-demo-bucket'), originPath: '/', originHeaders: { 'myHeader': '42', @@ -1132,7 +1132,7 @@ new cloudfront.CloudFrontWebDistribution(this, 'ADistribution', { originShieldRegion: 'us-west-2', }, failoverS3OriginSource: { - s3BucketSource: s3.Bucket.fromBucketName(this, 'aBucketFallback', 'myoriginbucketfallback'), + s3BucketSource: s3.Bucket.fromBucketName(this, 'aBucketFallback', 'amzn-s3-demo-bucket1'), originPath: '/somewhere', originHeaders: { 'myHeader2': '21', diff --git a/packages/aws-cdk-lib/aws-cloudtrail/SAMPLE-EVENTS.md b/packages/aws-cdk-lib/aws-cloudtrail/SAMPLE-EVENTS.md index 177c7a13ca0c7..1215ee5e8e408 100644 --- a/packages/aws-cdk-lib/aws-cloudtrail/SAMPLE-EVENTS.md +++ b/packages/aws-cdk-lib/aws-cloudtrail/SAMPLE-EVENTS.md @@ -11,12 +11,12 @@ PutObject "eventSource": "s3.amazonaws.com", "resources": [ { - "ARN": "arn:aws:s3:::BUCKETNAME/OBJECTKEY", + "ARN": "arn:aws:s3:::amzn-s3-demo-bucket/OBJECTKEY", "type": "AWS::S3::Object" }, { "accountId": "123456789012", - "ARN": "arn:aws:s3:::BUCKETNAME", + "ARN": "arn:aws:s3:::amzn-s3-demo-bucket", "type": "AWS::S3::Bucket" } ], @@ -61,8 +61,8 @@ PutObject }, "responseElements": null, "requestParameters": { - "bucketName": "BUCKETNAME", - "Host": "BUCKETNAME.s3.eu-west-1.amazonaws.com", + "bucketName": "amzn-s3-demo-bucket", + "Host": "amzn-s3-demo-bucket.s3.eu-west-1.amazonaws.com", "key": "OBJECTKEY" } } diff --git a/packages/aws-cdk-lib/aws-codebuild/README.md b/packages/aws-cdk-lib/aws-codebuild/README.md index fe7f39ac2e088..303aaf40ff35e 100644 --- a/packages/aws-cdk-lib/aws-codebuild/README.md +++ b/packages/aws-cdk-lib/aws-codebuild/README.md @@ -357,7 +357,7 @@ new codebuild.Project(this, 'Project', { buildImage: codebuild.WindowsBuildImage.fromEcrRepository(ecrRepository, 'v1.0', codebuild.WindowsImageType.SERVER_2019), // optional certificate to include in the build image certificate: { - bucket: s3.Bucket.fromBucketName(this, 'Bucket', 'my-bucket'), + bucket: s3.Bucket.fromBucketName(this, 'Bucket', 'amzn-s3-demo-bucket'), objectKey: 'path/to/cert.pem', }, }, diff --git a/packages/aws-cdk-lib/aws-codepipeline-actions/README.md b/packages/aws-cdk-lib/aws-codepipeline-actions/README.md index 0a18e406b553f..50272a3e57519 100644 --- a/packages/aws-cdk-lib/aws-codepipeline-actions/README.md +++ b/packages/aws-cdk-lib/aws-codepipeline-actions/README.md @@ -278,7 +278,7 @@ you can specify the region explicitly: ```ts const sourceBucket = s3.Bucket.fromBucketAttributes(this, 'SourceBucket', { - bucketName: 'my-bucket', + bucketName: 'amzn-s3-demo-bucket', region: 'ap-southeast-1', }); ``` diff --git a/packages/aws-cdk-lib/aws-codepipeline/README.md b/packages/aws-cdk-lib/aws-codepipeline/README.md index 09a0b90bc1b6a..e0b1a620004bf 100644 --- a/packages/aws-cdk-lib/aws-codepipeline/README.md +++ b/packages/aws-cdk-lib/aws-codepipeline/README.md @@ -294,7 +294,7 @@ const pipeline = new codepipeline.Pipeline(this, 'MyFirstPipeline', { crossRegionReplicationBuckets: { // note that a physical name of the replication Bucket must be known at synthesis time 'us-west-1': s3.Bucket.fromBucketAttributes(this, 'UsWest1ReplicationBucket', { - bucketName: 'my-us-west-1-replication-bucket', + bucketName: 'amzn-s3-demo-bucket', // optional KMS key encryptionKey: kms.Key.fromKeyArn(this, 'UsWest1ReplicationKey', 'arn:aws:kms:us-west-1:123456789012:key/1234-5678-9012' diff --git a/packages/aws-cdk-lib/aws-lambda-event-sources/README.md b/packages/aws-cdk-lib/aws-lambda-event-sources/README.md index 6ad5ebe73df0e..57aa2b3fe3e5c 100644 --- a/packages/aws-cdk-lib/aws-lambda-event-sources/README.md +++ b/packages/aws-cdk-lib/aws-lambda-event-sources/README.md @@ -101,7 +101,7 @@ and is not compliant with `S3EventSource`. If this is the case, please consider import * as s3 from 'aws-cdk-lib/aws-s3'; import { S3EventSourceV2 } from 'aws-cdk-lib/aws-lambda-event-sources'; -const bucket = s3.Bucket.fromBucketName(this, 'Bucket', 'bucket-name'); +const bucket = s3.Bucket.fromBucketName(this, 'Bucket', 'amzn-s3-demo-bucket'); declare const fn: lambda.Function; fn.addEventSource(new S3EventSourceV2(bucket, { diff --git a/packages/aws-cdk-lib/aws-lambda/README.md b/packages/aws-cdk-lib/aws-lambda/README.md index 1b34ddd81bb25..368e99ccd144b 100644 --- a/packages/aws-cdk-lib/aws-lambda/README.md +++ b/packages/aws-cdk-lib/aws-lambda/README.md @@ -288,7 +288,7 @@ resource policy. ```ts declare const fn: lambda.Function; const servicePrincipal = new iam.ServicePrincipal('my-service'); -const sourceArn = 'arn:aws:s3:::my-bucket'; +const sourceArn = 'arn:aws:s3:::amzn-s3-demo-bucket'; const sourceAccount = '111122223333'; const servicePrincipalWithConditions = servicePrincipal.withConditions({ ArnLike: { diff --git a/packages/aws-cdk-lib/aws-s3-assets/README.md b/packages/aws-cdk-lib/aws-s3-assets/README.md index bf66827990d59..1ce9b8bdbf84e 100644 --- a/packages/aws-cdk-lib/aws-s3-assets/README.md +++ b/packages/aws-cdk-lib/aws-s3-assets/README.md @@ -26,8 +26,8 @@ to an S3 bucket during deployment. * `s3BucketName` - the name of the assets S3 bucket. * `s3ObjectKey` - the S3 object key of the asset file (whether it's a file or a zip archive) - * `s3ObjectUrl` - the S3 object URL of the asset (i.e. s3://mybucket/mykey.zip) - * `httpUrl` - the S3 HTTP URL of the asset (i.e. https://s3.us-east-1.amazonaws.com/mybucket/mykey.zip) + * `s3ObjectUrl` - the S3 object URL of the asset (i.e. s3://amzn-s3-demo-bucket/mykey.zip) + * `httpUrl` - the S3 HTTP URL of the asset (i.e. https://s3.us-east-1.amazonaws.com/amzn-s3-demo-bucket/mykey.zip) In the following example, the various asset attributes are exported as stack outputs: diff --git a/packages/aws-cdk-lib/aws-s3/README.md b/packages/aws-cdk-lib/aws-s3/README.md index f1670876e5e4a..3c400997ceba9 100644 --- a/packages/aws-cdk-lib/aws-s3/README.md +++ b/packages/aws-cdk-lib/aws-s3/README.md @@ -10,18 +10,18 @@ const bucket = new s3.Bucket(this, 'MyFirstBucket'); `Bucket` constructs expose the following deploy-time attributes: -- `bucketArn` - the ARN of the bucket (i.e. `arn:aws:s3:::bucket_name`) -- `bucketName` - the name of the bucket (i.e. `bucket_name`) +- `bucketArn` - the ARN of the bucket (i.e. `arn:aws:s3:::amzn-s3-demo-bucket`) +- `bucketName` - the name of the bucket (i.e. `amzn-s3-demo-bucket`) - `bucketWebsiteUrl` - the Website URL of the bucket (i.e. - `http://bucket_name.s3-website-us-west-1.amazonaws.com`) -- `bucketDomainName` - the URL of the bucket (i.e. `bucket_name.s3.amazonaws.com`) + `http://amzn-s3-demo-bucket.s3-website-us-west-1.amazonaws.com`) +- `bucketDomainName` - the URL of the bucket (i.e. `amzn-s3-demo-bucket.s3.amazonaws.com`) - `bucketDualStackDomainName` - the dual-stack URL of the bucket (i.e. - `bucket_name.s3.dualstack.eu-west-1.amazonaws.com`) + `amzn-s3-demo-bucket.s3.dualstack.eu-west-1.amazonaws.com`) - `bucketRegionalDomainName` - the regional URL of the bucket (i.e. - `bucket_name.s3.eu-west-1.amazonaws.com`) + `amzn-s3-demo-bucket.s3.eu-west-1.amazonaws.com`) - `arnForObjects(pattern)` - the ARN of an object or objects within the bucket (i.e. - `arn:aws:s3:::bucket_name/exampleobject.png` or - `arn:aws:s3:::bucket_name/Development/*`) + `arn:aws:s3:::amzn-s3-demo-bucket/exampleobject.png` or + `arn:aws:s3:::amzn-s3-demo-bucket/Development/*`) - `urlForObject(key)` - the HTTP URL of an object within the bucket (i.e. `https://s3.cn-north-1.amazonaws.com.cn/china-bucket/mykey`) - `virtualHostedUrlForObject(key)` - the virtual-hosted style HTTP URL of an object @@ -103,7 +103,7 @@ If you try to add a policy statement to an existing bucket, this method will not do anything: ```ts -const bucket = s3.Bucket.fromBucketName(this, 'existingBucket', 'bucket-name'); +const bucket = s3.Bucket.fromBucketName(this, 'existingBucket', 'amzn-s3-demo-bucket'); // No policy statement will be added to the resource const result = bucket.addToResourcePolicy( @@ -232,7 +232,7 @@ are not allowed in the bucket name. ```ts declare const myLambda: lambda.Function; const bucket = s3.Bucket.fromBucketAttributes(this, 'ImportedBucket', { - bucketArn: 'arn:aws:s3:::my-bucket', + bucketArn: 'arn:aws:s3:::amzn-s3-demo-bucket', }); // now you can just call methods on the bucket @@ -246,8 +246,8 @@ Alternatively, short-hand factories are available as `Bucket.fromBucketName` and name or ARN respectively: ```ts -const byName = s3.Bucket.fromBucketName(this, 'BucketByName', 'my-bucket'); -const byArn = s3.Bucket.fromBucketArn(this, 'BucketByArn', 'arn:aws:s3:::my-bucket'); +const byName = s3.Bucket.fromBucketName(this, 'BucketByName', 'amzn-s3-demo-bucket'); +const byArn = s3.Bucket.fromBucketArn(this, 'BucketByArn', 'arn:aws:s3:::amzn-s3-demo-bucket'); ``` The bucket's region defaults to the current stack's region, but can also be explicitly set in cases where one of the bucket's @@ -255,10 +255,10 @@ regional properties needs to contain the correct values. ```ts const myCrossRegionBucket = s3.Bucket.fromBucketAttributes(this, 'CrossRegionImport', { - bucketArn: 'arn:aws:s3:::my-bucket', + bucketArn: 'arn:aws:s3:::amzn-s3-demo-bucket', region: 'us-east-1', }); -// myCrossRegionBucket.bucketRegionalDomainName === 'my-bucket.s3.us-east-1.amazonaws.com' +// myCrossRegionBucket.bucketRegionalDomainName === 'amzn-s3-demo-bucket.s3.us-east-1.amazonaws.com' ``` ## Bucket Notifications @@ -302,7 +302,7 @@ Adding notifications on existing buckets: ```ts declare const topic: sns.Topic; const bucket = s3.Bucket.fromBucketAttributes(this, 'ImportedBucket', { - bucketArn: 'arn:aws:s3:::my-bucket', + bucketArn: 'arn:aws:s3:::amzn-s3-demo-bucket', }); bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.SnsDestination(topic)); ``` @@ -500,7 +500,7 @@ policy resource using the L1 Construct. Although the mixing of L1 and L2 Constru recommended, there are no mechanisms in place to prevent users from doing this at the moment. ```ts -const bucketName = "my-favorite-bucket-name"; +const bucketName = "amzn-s3-demo-bucket"; const accessLogsBucket = new s3.Bucket(this, 'AccessLogsBucket', { objectOwnership: s3.ObjectOwnership.BUCKET_OWNER_ENFORCED, bucketName, @@ -566,7 +566,7 @@ Alternatively, users can use the L2 Bucket Policy Construct `BucketPolicy.fromCfnBucketPolicy` to wrap around `CfnBucketPolicy` Construct. This will allow the subsequent bucket policy generated by `serverAccessLogsBucket` usage to append to the existing bucket policy instead of overwriting. ```ts -const bucketName = "my-favorite-bucket-name"; +const bucketName = "amzn-s3-demo-bucket"; const accessLogsBucket = new s3.Bucket(this, 'AccessLogsBucket', { objectOwnership: s3.ObjectOwnership.BUCKET_OWNER_ENFORCED, bucketName, @@ -645,7 +645,7 @@ However, if you use an imported bucket (i.e `Bucket.fromXXX()`), you'll have to "Effect": "Allow", "Principal": { "Service": "s3.amazonaws.com" }, "Action": "s3:PutObject", - "Resource": ["arn:aws:s3:::destinationBucket/*"] + "Resource": ["arn:aws:s3:::amzn-s3-demo-destination-bucket/*"] } ] } diff --git a/packages/aws-cdk-lib/aws-servicecatalog/README.md b/packages/aws-cdk-lib/aws-servicecatalog/README.md index b3437393bd089..be9cc06961432 100644 --- a/packages/aws-cdk-lib/aws-servicecatalog/README.md +++ b/packages/aws-cdk-lib/aws-servicecatalog/README.md @@ -196,7 +196,7 @@ class LambdaProduct extends servicecatalog.ProductStack { } const userDefinedBucket = new Bucket(this, `UserDefinedBucket`, { - bucketName: 'user-defined-bucket-for-product-stack-assets', + bucketName: 'amzn-s3-demo-bucket', }); const product = new servicecatalog.CloudFormationProduct(this, 'Product', { diff --git a/packages/aws-cdk-lib/aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts b/packages/aws-cdk-lib/aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts index 640684516f8c4..127cfcdf7420a 100644 --- a/packages/aws-cdk-lib/aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts +++ b/packages/aws-cdk-lib/aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts @@ -13,7 +13,7 @@ const service1 = namespace.createService('NonIpService', { }); service1.registerNonIpInstance('NonIpInstance', { - customAttributes: { arn: 'arn:aws:s3:::mybucket' }, + customAttributes: { arn: 'arn:aws:s3:::amzn-s3-demo-bucket' }, }); const service2 = namespace.createService('IpService', { diff --git a/packages/aws-cdk-lib/aws-stepfunctions-tasks/README.md b/packages/aws-cdk-lib/aws-stepfunctions-tasks/README.md index b03c95b637b2f..9f0a9dc800a48 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions-tasks/README.md +++ b/packages/aws-cdk-lib/aws-stepfunctions-tasks/README.md @@ -239,7 +239,7 @@ const detectLabels = new tasks.CallAwsService(this, 'DetectLabels', { additionalIamStatements: [ new iam.PolicyStatement({ actions: ['s3:getObject'], - resources: ['arn:aws:s3:::my-bucket/*'], + resources: ['arn:aws:s3:::amzn-s3-demo-bucket/*'], }), ], }); @@ -284,7 +284,7 @@ const startQueryExecutionJob = new tasks.AthenaStartQueryExecution(this, 'Start encryptionOption: tasks.EncryptionOption.S3_MANAGED, }, outputLocation: { - bucketName: 'query-results-bucket', + bucketName: 'amzn-s3-demo-bucket', objectKey: 'folder', }, }, @@ -1593,7 +1593,7 @@ new tasks.SageMakerCreateTrainingJob(this, 'TrainSagemaker', { }, }], outputDataConfig: { - s3OutputLocation: tasks.S3Location.fromBucket(s3.Bucket.fromBucketName(this, 'Bucket', 'mybucket'), 'myoutputpath'), + s3OutputLocation: tasks.S3Location.fromBucket(s3.Bucket.fromBucketName(this, 'Bucket', 'amzn-s3-demo-bucket'), 'myoutputpath'), }, resourceConfig: { instanceCount: 1, diff --git a/packages/aws-cdk-lib/cloudformation-include/README.md b/packages/aws-cdk-lib/cloudformation-include/README.md index 754731d7c4439..05cccaaaa3f5d 100644 --- a/packages/aws-cdk-lib/cloudformation-include/README.md +++ b/packages/aws-cdk-lib/cloudformation-include/README.md @@ -18,7 +18,7 @@ It could be in JSON format, in a file `my-template.json`: "Bucket": { "Type": "AWS::S3::Bucket", "Properties": { - "BucketName": "some-bucket-name" + "BucketName": "amzn-s3-demo-bucket" } } } @@ -32,7 +32,7 @@ Resources: Bucket: Type: AWS::S3::Bucket Properties: - BucketName: some-bucket-name + BucketName: amzn-s3-demo-bucket ``` It can be included in a CDK application with the following code: @@ -85,7 +85,7 @@ for example, the name of the bucket can be changed: ```ts declare const cfnTemplate: cfn_inc.CfnInclude; const cfnBucket = cfnTemplate.getResource('Bucket') as s3.CfnBucket; -cfnBucket.bucketName = 'my-bucket-name'; +cfnBucket.bucketName = 'amzn-s3-demo-bucket'; ``` You can also refer to the resource when defining other constructs, @@ -410,7 +410,7 @@ and modify them like any other included template: declare const childTemplate: cfn_inc.CfnInclude; const cfnBucket = childTemplate.getResource('MyBucket') as s3.CfnBucket; -cfnBucket.bucketName = 'my-new-bucket-name'; +cfnBucket.bucketName = 'amzn-s3-demo-bucket1'; const role = new iam.Role(this, 'MyRole', { assumedBy: new iam.AccountRootPrincipal(), diff --git a/packages/aws-cdk-lib/core/README.md b/packages/aws-cdk-lib/core/README.md index e61ca8b0ce6ab..a6402770d6c66 100644 --- a/packages/aws-cdk-lib/core/README.md +++ b/packages/aws-cdk-lib/core/README.md @@ -1256,7 +1256,7 @@ The `CfnResource` class allows emitting arbitrary entries in the new CfnResource(this, 'ResourceId', { type: 'AWS::S3::Bucket', properties: { - BucketName: 'bucket-name' + BucketName: 'amzn-s3-demo-bucket' }, }); ``` diff --git a/packages/aws-cdk-lib/core/adr/cross-region-stack-references.md b/packages/aws-cdk-lib/core/adr/cross-region-stack-references.md index 306497cb15d3b..769f8244f7169 100644 --- a/packages/aws-cdk-lib/core/adr/cross-region-stack-references.md +++ b/packages/aws-cdk-lib/core/adr/cross-region-stack-references.md @@ -143,7 +143,7 @@ between these two resources. ```ts const bucket = new s3.Bucket(stack1, 'Bucket', { - bucketName: 'mybucket', + bucketName: 'amzn-s3-demo-bucket', }); const handler = new lambda.Function(stack2, 'Handler', { environment: { @@ -153,7 +153,7 @@ const handler = new lambda.Function(stack2, 'Handler', { bucket.grantRead(handler); ``` -If I tried to update the bucket, for example changing the name from `mybucket` to `myNewNameBucket` +If I tried to update the bucket, for example changing the name from `amzn-s3-demo-bucket` to `amzn-s3-demo-bucket1` CloudFormation will fail the deployment for stack1 and prevent the bucket from being recreated. This is because it _knows_ that `stack2` is using the bucket. If it allows the bucket to change and the export to change you could end up in an unrecoverable state for `stack2`. @@ -162,20 +162,20 @@ export to change you could end up in an unrecoverable state for `stack2`. sequenceDiagram Note over Stack1,Stack2: Initial Deployment activate Stack2 - Note over Stack1: Create export mybucket - Stack2->>+Stack1: Read export mybucket + Note over Stack1: Create export amzn-s3-demo-bucket + Stack2->>+Stack1: Read export amzn-s3-demo-bucket Note over Stack2: Create Function deactivate Stack2 Note over Stack1,Stack2: Second Deployment activate Stack2 - Note over Stack1: Delete export mybucket - Note over Stack1: Create export myNewNameBucket - Stack2->>+Stack1: Read export myNewNameBucket + Note over Stack1: Delete export amzn-s3-demo-bucket + Note over Stack1: Create export amzn-s3-demo-bucket1 + Stack2->>+Stack1: Read export amzn-s3-demo-bucket1 deactivate Stack2 Note over Stack2: Update Function Failed! Stack2-->>+Stack2: Rollback activate Stack2 - Stack2->>+Stack1: Read export mybucket + Stack2->>+Stack1: Read export amzn-s3-demo-bucket Note right of Stack1: Export doesn't exist! deactivate Stack2 Note over Stack2: Stack rollback failed! diff --git a/packages/aws-cdk-lib/custom-resources/README.md b/packages/aws-cdk-lib/custom-resources/README.md index 68776f0202459..21a9efda9d22e 100644 --- a/packages/aws-cdk-lib/custom-resources/README.md +++ b/packages/aws-cdk-lib/custom-resources/README.md @@ -636,7 +636,7 @@ new cr.AwsCustomResource(this, 'ListObjects', { service: 's3', action: 'ListObjectsV2', parameters: { - Bucket: 'my-bucket', + Bucket: 'amzn-s3-demo-bucket', }, physicalResourceId: cr.PhysicalResourceId.of('id'), outputPaths: ['Contents.0.Key', 'Contents.1.Key'], // Output only the two first keys diff --git a/packages/aws-cdk-lib/pipelines/README.md b/packages/aws-cdk-lib/pipelines/README.md index 40c06136e9dea..1db27d0fbb7ff 100644 --- a/packages/aws-cdk-lib/pipelines/README.md +++ b/packages/aws-cdk-lib/pipelines/README.md @@ -396,7 +396,7 @@ You can use a zip file in S3 as the source of the pipeline. The pipeline will be triggered every time the file in S3 is changed: ```ts -const bucket = s3.Bucket.fromBucketName(this, 'Bucket', 'my-bucket'); +const bucket = s3.Bucket.fromBucketName(this, 'Bucket', 'amzn-s3-demo-bucket'); pipelines.CodePipelineSource.s3(bucket, 'my/source.zip'); ``` diff --git a/packages/aws-cdk/README.md b/packages/aws-cdk/README.md index a5359727e06ad..643880ccbc4ab 100644 --- a/packages/aws-cdk/README.md +++ b/packages/aws-cdk/README.md @@ -780,15 +780,15 @@ In practice this means for any resource in the provided template, for example, "S3Bucket": { "Type": "AWS::S3::Bucket", "Properties": { - "BucketName": "MyBucket", + "BucketName": "amzn-s3-demo-bucket", "AccessControl": "PublicRead", }, "DeletionPolicy": "Retain" } ``` -There must not exist a resource of that type with the same identifier in the desired region. In this example that identfier -would be "MyBucket" +There must not exist a resource of that type with the same identifier in the desired region. In this example that identfier +would be "amzn-s3-demo-bucket" ##### **The provided template is not deployed to CloudFormation in the account/region, and there *is* overlap with existing resources in the account/region** @@ -1057,17 +1057,17 @@ Some of the interesting keys that can be used in the JSON configuration files: ```json5 { - "app": "node bin/main.js", // Command to start the CDK app (--app='node bin/main.js') - "build": "mvn package", // Specify pre-synth build (--build='mvn package') - "context": { // Context entries (--context=key=value) + "app": "node bin/main.js", // Command to start the CDK app (--app='node bin/main.js') + "build": "mvn package", // Specify pre-synth build (--build='mvn package') + "context": { // Context entries (--context=key=value) "key": "value" }, - "toolkitStackName": "foo", // Customize 'bootstrap' stack name (--toolkit-stack-name=foo) + "toolkitStackName": "foo", // Customize 'bootstrap' stack name (--toolkit-stack-name=foo) "toolkitBucket": { - "bucketName": "fooBucket", // Customize 'bootstrap' bucket name (--toolkit-bucket-name=fooBucket) - "kmsKeyId": "fooKMSKey" // Customize 'bootstrap' KMS key id (--bootstrap-kms-key-id=fooKMSKey) + "bucketName": "amzn-s3-demo-bucket", // Customize 'bootstrap' bucket name (--toolkit-bucket-name=amzn-s3-demo-bucket) + "kmsKeyId": "fooKMSKey" // Customize 'bootstrap' KMS key id (--bootstrap-kms-key-id=fooKMSKey) }, - "versionReporting": false, // Opt-out of version reporting (--no-version-reporting) + "versionReporting": false, // Opt-out of version reporting (--no-version-reporting) } ```