diff --git a/packages/@aws-cdk/assert-internal/lib/assertions/have-resource-matchers.ts b/packages/@aws-cdk/assert-internal/lib/assertions/have-resource-matchers.ts index d82b59feffea0..05b8197c583a6 100644 --- a/packages/@aws-cdk/assert-internal/lib/assertions/have-resource-matchers.ts +++ b/packages/@aws-cdk/assert-internal/lib/assertions/have-resource-matchers.ts @@ -422,7 +422,7 @@ export function matcherFrom(matcher: any): PropertyMatcher { * would show (in traditional JS fashion) something like '[function Function]', or more * accurately nothing at all since functions cannot be JSONified. * - * We override to JSON() in order to produce a readadable version of the matcher. + * We override to JSON() in order to produce a readable version of the matcher. */ export function annotateMatcher(how: A, matcher: PropertyMatcher): PropertyMatcher { (matcher as any).toJSON = () => how; diff --git a/packages/@aws-cdk/assertions/README.md b/packages/@aws-cdk/assertions/README.md index d2894fafe1df8..48361f66effc8 100644 --- a/packages/@aws-cdk/assertions/README.md +++ b/packages/@aws-cdk/assertions/README.md @@ -594,7 +594,7 @@ Here are the available APIs for `Annotations`: The corresponding `findXxx()` API is complementary to the `hasXxx()` API, except instead of asserting its presence, it returns the set of matching messages. -In addition, this suite of APIs is compatable with `Matchers` for more fine-grained control. +In addition, this suite of APIs is compatible with `Matchers` for more fine-grained control. For example, the following assertion works as well: ```ts diff --git a/packages/@aws-cdk/aws-apigateway/README.md b/packages/@aws-cdk/aws-apigateway/README.md index cfe75be5b0976..511a4239a22b8 100644 --- a/packages/@aws-cdk/aws-apigateway/README.md +++ b/packages/@aws-cdk/aws-apigateway/README.md @@ -313,7 +313,7 @@ A usage plan specifies who can access one or more deployed API stages and method accessed. The plan uses API keys to identify API clients and meters access to the associated API stages for each key. Usage plans also allow configuring throttling limits and quota limits that are enforced on individual client API keys. -The following example shows how to create and asscociate a usage plan and an API key: +The following example shows how to create and associate a usage plan and an API key: ```ts declare const integration: apigateway.LambdaIntegration; diff --git a/packages/@aws-cdk/aws-appmesh/lib/virtual-node-listener.ts b/packages/@aws-cdk/aws-appmesh/lib/virtual-node-listener.ts index 04a6c4af3eb1f..34329141159db 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/virtual-node-listener.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/virtual-node-listener.ts @@ -61,7 +61,7 @@ interface CommonHttpVirtualNodeListenerOptions extends VirtualNodeListenerCommon } /** - * Represent the HTTP Node Listener prorperty + * Represent the HTTP Node Listener property */ export interface HttpVirtualNodeListenerOptions extends CommonHttpVirtualNodeListenerOptions { @@ -74,7 +74,7 @@ export interface HttpVirtualNodeListenerOptions extends CommonHttpVirtualNodeLis } /** - * Represent the HTTP2 Node Listener prorperty + * Represent the HTTP2 Node Listener property */ export interface Http2VirtualNodeListenerOptions extends CommonHttpVirtualNodeListenerOptions { /** @@ -86,7 +86,7 @@ export interface Http2VirtualNodeListenerOptions extends CommonHttpVirtualNodeLi } /** - * Represent the GRPC Node Listener prorperty + * Represent the GRPC Node Listener property */ export interface GrpcVirtualNodeListenerOptions extends VirtualNodeListenerCommonOptions { /** @@ -105,7 +105,7 @@ export interface GrpcVirtualNodeListenerOptions extends VirtualNodeListenerCommo } /** - * Represent the TCP Node Listener prorperty + * Represent the TCP Node Listener property */ export interface TcpVirtualNodeListenerOptions extends VirtualNodeListenerCommonOptions { /** diff --git a/packages/@aws-cdk/aws-codebuild/README.md b/packages/@aws-cdk/aws-codebuild/README.md index 908ec2ea106a8..d22d46bd678a1 100644 --- a/packages/@aws-cdk/aws-codebuild/README.md +++ b/packages/@aws-cdk/aws-codebuild/README.md @@ -104,7 +104,7 @@ const bbSource = codebuild.Source.bitBucket({ ### For all Git sources -For all Git sources, you can fetch submodules while cloing git repo. +For all Git sources, you can fetch submodules while cloning git repo. ```ts const gitHubSource = codebuild.Source.gitHub({ diff --git a/packages/@aws-cdk/aws-codepipeline-actions/README.md b/packages/@aws-cdk/aws-codepipeline-actions/README.md index 3a3c211e46ae7..f5590e83ceb90 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/README.md +++ b/packages/@aws-cdk/aws-codepipeline-actions/README.md @@ -633,7 +633,7 @@ The actions available for updating StackSets are: * **CloudFormationDeployStackSetAction** - Create or update a CloudFormation StackSet directly from the pipeline, optionally immediately create and update Stack Instances as well. -* **CloudFormationDeployStackInstancesAction** - Update outdated Stack Instaces using the current version of the StackSet. +* **CloudFormationDeployStackInstancesAction** - Update outdated Stack Instances using the current version of the StackSet. Here's an example of using both of these actions: diff --git a/packages/@aws-cdk/aws-cognito/README.md b/packages/@aws-cdk/aws-cognito/README.md index 7894124d42dca..75a5e549f9095 100644 --- a/packages/@aws-cdk/aws-cognito/README.md +++ b/packages/@aws-cdk/aws-cognito/README.md @@ -72,7 +72,7 @@ new cognito.UserPool(this, 'myuserpool', { ``` By default, usernames and email addresses in user pools are case sensitive, which means `user@example.com` and `User@example.com` -are considered different. In most situations it is prefered to have usernames and email addresses be case insensitive so that +are considered different. In most situations it is preferred to have usernames and email addresses be case insensitive so that capitalization differences are ignored. As shown above, you can make a user pool case insensitive by setting `signInCaseSensitive` to `false`. The case sensitivity cannot be changed once a user pool is created. diff --git a/packages/@aws-cdk/aws-ec2/README.md b/packages/@aws-cdk/aws-ec2/README.md index cffc515d82698..783ff94728e7e 100644 --- a/packages/@aws-cdk/aws-ec2/README.md +++ b/packages/@aws-cdk/aws-ec2/README.md @@ -675,7 +675,7 @@ const sg = ec2.SecurityGroup.fromSecurityGroupId(this, 'SecurityGroupImport', 's }); ``` -Alternatively, use lookup methods to import security groups if you do not know the ID or the configuration details. Method `SecurityGroup.fromLookupByName` looks up a security group if the secruity group ID is unknown. +Alternatively, use lookup methods to import security groups if you do not know the ID or the configuration details. Method `SecurityGroup.fromLookupByName` looks up a security group if the security group ID is unknown. ```ts fixture=with-vpc const sg = ec2.SecurityGroup.fromLookupByName(this, 'SecurityGroupLookup', 'security-group-name', vpc); @@ -1579,7 +1579,7 @@ For more information see #### Using add*Command on MultipartUserData To use the `add*Command` methods, that are inherited from the `UserData` interface, on `MultipartUserData` you must add a part -to the `MultipartUserData` and designate it as the reciever for these methods. This is accomplished by using the `addUserDataPart()` +to the `MultipartUserData` and designate it as the receiver for these methods. This is accomplished by using the `addUserDataPart()` method on `MultipartUserData` with the `makeDefault` argument set to `true`: ```ts diff --git a/packages/@aws-cdk/aws-ecr/README.md b/packages/@aws-cdk/aws-ecr/README.md index 6e67349024891..7a866e77f7a49 100644 --- a/packages/@aws-cdk/aws-ecr/README.md +++ b/packages/@aws-cdk/aws-ecr/README.md @@ -16,7 +16,7 @@ This package contains constructs for working with Amazon Elastic Container Regis ## Repositories Define a repository by creating a new instance of `Repository`. A repository -holds multiple verions of a single container image. +holds multiple versions of a single container image. ```ts const repository = new ecr.Repository(this, 'Repository'); diff --git a/packages/@aws-cdk/aws-elasticsearch/README.md b/packages/@aws-cdk/aws-elasticsearch/README.md index fab6cc2691548..0628082acb39f 100644 --- a/packages/@aws-cdk/aws-elasticsearch/README.md +++ b/packages/@aws-cdk/aws-elasticsearch/README.md @@ -62,7 +62,7 @@ logging the domain logs and slow search logs. Some cluster configurations (e.g VPC access) require the existence of the [`AWSServiceRoleForAmazonElasticsearchService`](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/slr-es.html) Service-Linked Role. -When performing such operations via the AWS Console, this SLR is created automatically when needed. However, this is not the behavior when using CloudFormation. If an SLR is needed, but doesn't exist, you will encounter a failure message simlar to: +When performing such operations via the AWS Console, this SLR is created automatically when needed. However, this is not the behavior when using CloudFormation. If an SLR is needed, but doesn't exist, you will encounter a failure message similar to: ```console Before you can proceed, you must enable a service-linked role to give Amazon ES... @@ -199,7 +199,7 @@ means anyone can access the domain using the configured master username and password. To enable unsigned basic auth access the domain is configured with an access -policy that allows anyonmous requests, HTTPS required, node to node encryption, +policy that allows anonymous requests, HTTPS required, node to node encryption, encryption at rest and fine grained access control. If the above settings are not set they will be configured as part of enabling diff --git a/packages/@aws-cdk/aws-events/README.md b/packages/@aws-cdk/aws-events/README.md index 456e4b18f9ad1..d2e3417b6367c 100644 --- a/packages/@aws-cdk/aws-events/README.md +++ b/packages/@aws-cdk/aws-events/README.md @@ -114,10 +114,11 @@ const rule = new events.Rule(this, 'rule', { // 'OR' condition 'source-storage-class': events.Match.anyOf( - events.Match.prefix("GLACIER"), + events.Match.prefix("GLACIER"), events.Match.exactString('DEEP_ARCHIVE'), ), }, + 'detail-type': events.Match.equalsIgnoreCase('object created'), // If you prefer, you can use a low level array of strings, as directly consumed by EventBridge source: ['aws.s3'], diff --git a/packages/@aws-cdk/aws-events/lib/event-pattern.ts b/packages/@aws-cdk/aws-events/lib/event-pattern.ts index c9d520a6bb030..494ba76ca7141 100644 --- a/packages/@aws-cdk/aws-events/lib/event-pattern.ts +++ b/packages/@aws-cdk/aws-events/lib/event-pattern.ts @@ -40,21 +40,35 @@ export class Match implements IResolvable { /** * Matches a string, exactly, in the JSON of the event */ - public static exactString(value: string): string [] { + public static exactString(value: string): string[] { return this.fromObjects([value]); } + /** + * Matches a string, regardless of case, in the JSON of the event + */ + public static equalsIgnoreCase(value: string): string[] { + return this.fromObjects([{ 'equals-ignore-case': value }]); + } + /** * Matches strings with the given prefix in the JSON of the event */ - static prefix(value: string): string[] { + public static prefix(value: string): string[] { return this.fromObjects([{ prefix: value }]); } + /** + * Matches strings with the given suffix in the JSON of the event + */ + public static suffix(value: string): string[] { + return this.fromObjects([{ suffix: value }]); + } + /** * Matches IPv4 and IPv6 network addresses using the Classless Inter-Domain Routing (CIDR) format */ - static cidr(range: string): string[] { + public static cidr(range: string): string[] { const ipv4Regex = /^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$/igm; const ipv6Regex = /^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*(\/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))?$/igm; @@ -69,7 +83,7 @@ export class Match implements IResolvable { * Matches IPv4 and IPv6 network addresses using the Classless Inter-Domain Routing (CIDR) format. * Alias of `cidr()`. */ - static ipAddressRange(range: string): string[] { + public static ipAddressRange(range: string): string[] { return Match.cidr(range); } @@ -77,7 +91,7 @@ export class Match implements IResolvable { * Matches anything except what's provided in the rule. The list of provided values must contain * only strings or only numbers. */ - static anythingBut(...values: any[]): string[] { + public static anythingBut(...values: any[]): string[] { if (values.length === 0) { throw new Error('anythingBut matchers must be non-empty lists'); } @@ -95,7 +109,7 @@ export class Match implements IResolvable { /** * Matches any string that doesn't start with the given prefix. */ - static anythingButPrefix(prefix: string): string[] { + public static anythingButPrefix(prefix: string): string[] { return this.fromObjects([{ 'anything-but': { prefix: prefix } }]); } @@ -142,7 +156,7 @@ export class Match implements IResolvable { * @param lower Lower bound (inclusive) * @param upper Upper bound (inclusive) */ - static interval(lower: number, upper: number): string[] { + public static interval(lower: number, upper: number): string[] { if (lower > upper) { throw new Error(`Invalid interval: [${lower}, ${upper}]`); } diff --git a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.assets.json b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.assets.json index 21546707f8b49..0ee3c895dea43 100644 --- a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.assets.json +++ b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.assets.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "21.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/RuleStack.assets.json b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/RuleStack.assets.json index 493c9f680c6b6..21e208bc4a0a6 100644 --- a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/RuleStack.assets.json +++ b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/RuleStack.assets.json @@ -1,7 +1,7 @@ { - "version": "20.0.0", + "version": "21.0.0", "files": { - "f8f3154528da0601b814868afeeb0474f8644916293f783617ff6d56a6d92035": { + "f9728b2d2c64ff638563c8cc4a3e8eb9ddf3074e2ae01d68fde11aeda0968fb1": { "source": { "path": "RuleStack.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "f8f3154528da0601b814868afeeb0474f8644916293f783617ff6d56a6d92035.json", + "objectKey": "f9728b2d2c64ff638563c8cc4a3e8eb9ddf3074e2ae01d68fde11aeda0968fb1.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/RuleStack.template.json b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/RuleStack.template.json index 74e687f119c09..5025f8b2c914b 100644 --- a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/RuleStack.template.json +++ b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/RuleStack.template.json @@ -108,6 +108,16 @@ "prefix": "sensitive-" } } + ], + "suffix": [ + { + "suffix": ".com" + } + ], + "equalsIgnoreCase": [ + { + "equals-ignore-case": "ignore case" + } ] }, "detail-type": [ diff --git a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/cdk.out b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/cdk.out index 588d7b269d34f..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/integ.json b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/integ.json index 26b8dc998323a..3716c914b03f1 100644 --- a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/integ.json @@ -1,11 +1,12 @@ { - "version": "20.0.0", + "version": "21.0.0", "testCases": { "IntegTest-BatchDefaultEnvVarsStack/DefaultTest": { "stacks": [ "RuleStack" ], - "assertionStack": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert" + "assertionStack": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert", + "assertionStackName": "IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/manifest.json b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/manifest.json index dd5bfe14671b1..4117383bdd483 100644 --- a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "21.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "RuleStack.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "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}/f8f3154528da0601b814868afeeb0474f8644916293f783617ff6d56a6d92035.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f9728b2d2c64ff638563c8cc4a3e8eb9ddf3074e2ae01d68fde11aeda0968fb1.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -106,6 +100,12 @@ ] }, "displayName": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/tree.json b/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/tree.json index f7174f4afdd17..f68ebe1fc832e 100644 --- a/packages/@aws-cdk/aws-events/test/integ.rule.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-events/test/integ.rule.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" - } - }, "RuleStack": { "id": "RuleStack", "path": "RuleStack", @@ -131,6 +123,16 @@ "prefix": "sensitive-" } } + ], + "suffix": [ + { + "suffix": ".com" + } + ], + "equalsIgnoreCase": [ + { + "equals-ignore-case": "ignore case" + } ] }, "detail-type": [ @@ -172,11 +174,27 @@ "fqn": "@aws-cdk/aws-events.Rule", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "RuleStack/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "RuleStack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" } }, "IntegTest-BatchDefaultEnvVarsStack": { @@ -192,15 +210,33 @@ "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.154" } }, "DeployAssert": { "id": "DeployAssert", "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" } } }, @@ -214,11 +250,19 @@ "fqn": "@aws-cdk/integ-tests.IntegTest", "version": "0.0.0" } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.154" + } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events/test/integ.rule.ts b/packages/@aws-cdk/aws-events/test/integ.rule.ts index 941d3860ce662..9f84ae6e8e398 100644 --- a/packages/@aws-cdk/aws-events/test/integ.rule.ts +++ b/packages/@aws-cdk/aws-events/test/integ.rule.ts @@ -29,6 +29,8 @@ new Rule(stack, 'MyRule', { state: Match.anythingBut('initializing'), limit: Match.anythingBut(100, 200, 300), notPrefixedBy: Match.anythingButPrefix('sensitive-'), + suffix: Match.suffix('.com'), + equalsIgnoreCase: Match.equalsIgnoreCase('ignore case'), }, detailType: ['detailType1'], id: ['id1', 'id2'], diff --git a/packages/@aws-cdk/aws-events/test/matchers.test.ts b/packages/@aws-cdk/aws-events/test/matchers.test.ts index 4bc5ef8767a69..081452c2e5a2a 100644 --- a/packages/@aws-cdk/aws-events/test/matchers.test.ts +++ b/packages/@aws-cdk/aws-events/test/matchers.test.ts @@ -64,4 +64,22 @@ describe(Match, () => { expect(() => stack.resolve(Match.anyOf())).toThrow(/A list of matchers must contain at least one element/); }); -}); \ No newline at end of file + + test('prefix', () => { + expect(stack.resolve(Match.prefix('foo'))).toEqual([ + { prefix: 'foo' }, + ]); + }); + + test('suffix', () => { + expect(stack.resolve(Match.suffix('foo'))).toEqual([ + { suffix: 'foo' }, + ]); + }); + + test('equalsIgnoreCase', () => { + expect(stack.resolve(Match.equalsIgnoreCase('foo'))).toEqual([ + { 'equals-ignore-case': 'foo' }, + ]); + }); +}); diff --git a/packages/@aws-cdk/aws-gamelift/README.md b/packages/@aws-cdk/aws-gamelift/README.md index 428082be21e87..2528789c4fbad 100644 --- a/packages/@aws-cdk/aws-gamelift/README.md +++ b/packages/@aws-cdk/aws-gamelift/README.md @@ -80,9 +80,12 @@ services. ```ts declare const bucket: s3.Bucket; -new gamelift.Build(this, 'Build', { +const build = new gamelift.Build(this, 'Build', { content: gamelift.Content.fromBucket(bucket, "sample-asset-key") }); + +new CfnOutput(this, 'BuildArn', { value: build.buildArn }); +new CfnOutput(this, 'BuildId', { value: build.buildId }); ``` #### Upload a realtime server Script @@ -286,7 +289,7 @@ fleet.addLocation('ap-southeast-1', 5, 2, 10); Some GameLift features require you to extend limited access to your AWS resources. This is done by creating an AWS IAM role. The GameLift Fleet class automatically created an IAM role with all the minimum necessary permissions -for GameLift to access your ressources. If you wish, you may +for GameLift to access your resources. If you wish, you may specify your own IAM role. ```ts @@ -349,7 +352,7 @@ processes. You can then use CloudWatch alarms to alert you, for example, when matches has been rejected (potential matches that were rejected by at least one player -since the last report) exceed a certain thresold which could means that you may +since the last report) exceed a certain threshold which could means that you may have an issue in your matchmaking rules. CDK provides methods for accessing GameLift Fleet metrics with default configuration, @@ -457,7 +460,7 @@ in the *Amazon GameLift FleetIQ Developer Guide*. The GameLift FleetIQ class automatically creates an IAM role with all the minimum necessary permissions for GameLift to access your Amazon EC2 Auto Scaling groups. If you wish, you may -specify your own IAM role. It must have the correct permissions, or FleetIQ creation or ressource usage may fail. +specify your own IAM role. It must have the correct permissions, or FleetIQ creation or resource usage may fail. ```ts declare const launchTemplate: ec2.ILaunchTemplate; @@ -523,7 +526,7 @@ limited Spot availability. You can then use CloudWatch alarms to alert you, for example, when the portion of game servers that are currently supporting game executions exceed a certain -thresold which could means that your autoscaling policy need to be adjust to +threshold which could means that your autoscaling policy need to be adjust to add more instances to match with player demand. CDK provides a generic `metric` method that can be used diff --git a/packages/@aws-cdk/aws-gamelift/lib/build.ts b/packages/@aws-cdk/aws-gamelift/lib/build.ts index 346ca94618d6d..83fe9ba252a6b 100644 --- a/packages/@aws-cdk/aws-gamelift/lib/build.ts +++ b/packages/@aws-cdk/aws-gamelift/lib/build.ts @@ -23,6 +23,13 @@ export interface IBuild extends cdk.IResource, iam.IGrantable { * @attribute */ readonly buildId: string; + + /** + * The ARN of the build + * + * @attribute + */ + readonly buildArn: string; } /** @@ -33,6 +40,10 @@ export abstract class BuildBase extends cdk.Resource implements IBuild { * The Identifier of the build. */ public abstract readonly buildId: string; + /** + * The ARN of the build. + */ + public abstract readonly buildArn: string; public abstract readonly grantPrincipal: iam.IPrincipal; } @@ -52,12 +63,25 @@ export enum OperatingSystem { */ export interface BuildAttributes { /** - * The identifier of the build + * The ARN of the build + * + * At least one of `buildArn` and `buildId` must be provided. + * + * @default derived from `buildId`. */ - readonly buildId: string; + readonly buildArn?: string; + + /** + * The identifier of the build + * + * At least one of `buildId` and `buildArn` must be provided. + * + * @default derived from `buildArn`. + */ + readonly buildId?: string; /** * The IAM role assumed by GameLift to access server build in S3. - * @default - undefined + * @default the imported fleet cannot be granted access to other resources as an `iam.IGrantable`. */ readonly role?: iam.IRole; } @@ -151,15 +175,45 @@ export class Build extends BuildBase { return this.fromBuildAttributes(scope, id, { buildId }); } + /** + * Import a build into CDK using its ARN + */ + static fromBuildArn(scope: Construct, id: string, buildArn: string): IBuild { + return this.fromBuildAttributes(scope, id, { buildArn }); + } + /** * Import an existing build from its attributes. */ static fromBuildAttributes(scope: Construct, id: string, attrs: BuildAttributes): IBuild { + if (!attrs.buildId && !attrs.buildArn) { + throw new Error('Either buildId or buildArn must be provided in BuildAttributes'); + } + const buildId = attrs.buildId ?? + cdk.Stack.of(scope).splitArn(attrs.buildArn!, cdk.ArnFormat.SLASH_RESOURCE_NAME).resourceName; + + if (!buildId) { + throw new Error(`No build identifier found in ARN: '${attrs.buildArn}'`); + } + + const buildArn = attrs.buildArn ?? cdk.Stack.of(scope).formatArn({ + service: 'gamelift', + resource: 'build', + resourceName: attrs.buildId, + arnFormat: cdk.ArnFormat.SLASH_RESOURCE_NAME, + }); class Import extends BuildBase { - public readonly buildId = attrs.buildId; + public readonly buildId = buildId!; + public readonly buildArn = buildArn; public readonly grantPrincipal = attrs.role ?? new iam.UnknownPrincipal({ resource: this }); - } + public readonly role = attrs.role; + constructor(s: Construct, i: string) { + super(s, i, { + environmentFromArn: buildArn, + }); + } + } return new Import(scope, id); } @@ -168,6 +222,11 @@ export class Build extends BuildBase { */ public readonly buildId: string; + /** + * The ARN of the build. + */ + public readonly buildArn: string; + /** * The IAM role GameLift assumes to acccess server build content. */ @@ -209,7 +268,13 @@ export class Build extends BuildBase { resource.node.addDependency(this.role); - this.buildId = resource.ref; + this.buildId = this.getResourceNameAttribute(resource.ref); + this.buildArn = cdk.Stack.of(scope).formatArn({ + service: 'gamelift', + resource: 'build', + resourceName: this.buildId, + arnFormat: cdk.ArnFormat.SLASH_RESOURCE_NAME, + }); } diff --git a/packages/@aws-cdk/aws-gamelift/rosetta/default.ts-fixture b/packages/@aws-cdk/aws-gamelift/rosetta/default.ts-fixture index a343bb1afbee4..acf0995fb04a8 100644 --- a/packages/@aws-cdk/aws-gamelift/rosetta/default.ts-fixture +++ b/packages/@aws-cdk/aws-gamelift/rosetta/default.ts-fixture @@ -1,6 +1,6 @@ // Fixture with packages imported, but nothing else import { Construct } from 'constructs'; -import { Duration, Size, Stack } from '@aws-cdk/core'; +import { Duration, Size, Stack, CfnOutput } from '@aws-cdk/core'; import * as gamelift from '@aws-cdk/aws-gamelift'; import * as s3 from '@aws-cdk/aws-s3'; import * as ec2 from '@aws-cdk/aws-ec2'; diff --git a/packages/@aws-cdk/aws-gamelift/test/build.test.ts b/packages/@aws-cdk/aws-gamelift/test/build.test.ts index 5ea79a17694c3..3117955d1973e 100644 --- a/packages/@aws-cdk/aws-gamelift/test/build.test.ts +++ b/packages/@aws-cdk/aws-gamelift/test/build.test.ts @@ -7,44 +7,12 @@ import * as cxapi from '@aws-cdk/cx-api'; import * as gamelift from '../lib'; describe('build', () => { - const buildId = 'test-identifier'; - const buildName = 'test-build'; - let stack: cdk.Stack; - - beforeEach(() => { - const app = new cdk.App({ context: { [cxapi.NEW_STYLE_STACK_SYNTHESIS_CONTEXT]: false } }); - stack = new cdk.Stack(app); - }); - - describe('.fromBuildId()', () => { - test('with required fields', () => { - const build = gamelift.Build.fromBuildId(stack, 'ImportedBuild', buildId); - - expect(build.buildId).toEqual(buildId); - expect(build.grantPrincipal).toEqual(new iam.UnknownPrincipal({ resource: build })); - }); - }); - - describe('.fromBuildAttributes()', () => { - test('with required attrs only', () => { - const build = gamelift.Build.fromBuildAttributes(stack, 'ImportedBuild', { buildId }); - - expect(build.buildId).toEqual(buildId); - expect(build.grantPrincipal).toEqual(new iam.UnknownPrincipal({ resource: build })); - }); - - test('with all attrs', () => { - const role = iam.Role.fromRoleArn(stack, 'Role', 'arn:aws:iam::123456789012:role/TestRole'); - const build = gamelift.Build.fromBuildAttributes(stack, 'ImportedBuild', { buildId, role }); - - expect(buildId).toEqual(buildId); - expect(build.grantPrincipal).toEqual(role); - }); - }); describe('new', () => { const localAsset = path.join(__dirname, 'my-game-build'); const contentBucketName = 'bucketname'; + const buildName = 'test-build'; + let stack: cdk.Stack; const contentBucketAccessStatement = { Action: [ 's3:GetObject', @@ -70,6 +38,8 @@ describe('build', () => { let defaultProps: gamelift.BuildProps; beforeEach(() => { + const app = new cdk.App({ context: { [cxapi.NEW_STYLE_STACK_SYNTHESIS_CONTEXT]: false } }); + stack = new cdk.Stack(app); contentBucket = s3.Bucket.fromBucketName(stack, 'ContentBucket', contentBucketName); content = gamelift.Content.fromBucket(contentBucket, 'content'); defaultProps = { @@ -215,6 +185,92 @@ describe('build', () => { }); }); }); + + describe('test import methods', () => { + test('Build.fromBuildArn', () => { + // GIVEN + const stack2 = new cdk.Stack(); + + // WHEN + const imported = gamelift.Build.fromBuildArn(stack2, 'Imported', 'arn:aws:gamelift:us-east-1:123456789012:build/sample-build-id'); + + // THEN + expect(imported.buildArn).toEqual('arn:aws:gamelift:us-east-1:123456789012:build/sample-build-id'); + expect(imported.buildId).toEqual('sample-build-id'); + }); + + test('Build.fromBuildId', () => { + // GIVEN + const stack = new cdk.Stack(); + + // WHEN + const imported = gamelift.Build.fromBuildId(stack, 'Imported', 'sample-build-id'); + + // THEN + expect(stack.resolve(imported.buildArn)).toStrictEqual({ + 'Fn::Join': ['', [ + 'arn:', + { Ref: 'AWS::Partition' }, + ':gamelift:', + { Ref: 'AWS::Region' }, + ':', + { Ref: 'AWS::AccountId' }, + ':build/sample-build-id', + ]], + }); + expect(stack.resolve(imported.buildId)).toStrictEqual('sample-build-id'); + }); + }); + + describe('Build.fromBuildAttributes()', () => { + let stack: cdk.Stack; + const buildId = 'build-test-identifier'; + const buildArn = `arn:aws:gamelift:build-region:123456789012:build/${buildId}`; + + beforeEach(() => { + const app = new cdk.App(); + stack = new cdk.Stack(app, 'Base', { + env: { account: '111111111111', region: 'stack-region' }, + }); + }); + + describe('', () => { + test('with required attrs only', () => { + const importedFleet = gamelift.Build.fromBuildAttributes(stack, 'ImportedBuild', { buildArn }); + + expect(importedFleet.buildId).toEqual(buildId); + expect(importedFleet.buildArn).toEqual(buildArn); + expect(importedFleet.env.account).toEqual('123456789012'); + expect(importedFleet.env.region).toEqual('build-region'); + }); + + test('with missing attrs', () => { + expect(() => gamelift.Build.fromBuildAttributes(stack, 'ImportedBuild', { })) + .toThrow(/Either buildId or buildArn must be provided in BuildAttributes/); + }); + + test('with invalid ARN', () => { + expect(() => gamelift.Build.fromBuildAttributes(stack, 'ImportedBuild', { buildArn: 'arn:aws:gamelift:build-region:123456789012:build' })) + .toThrow(/No build identifier found in ARN: 'arn:aws:gamelift:build-region:123456789012:build'/); + }); + }); + + describe('for an build in a different account and region', () => { + let build: gamelift.IBuild; + + beforeEach(() => { + build = gamelift.Build.fromBuildAttributes(stack, 'ImportedBuild', { buildArn }); + }); + + test("the build's region is taken from the ARN", () => { + expect(build.env.region).toBe('build-region'); + }); + + test("the build's account is taken from the ARN", () => { + expect(build.env.account).toBe('123456789012'); + }); + }); + }); }); diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/asset.6019bfc8ab05a24b0ae9b5d8f4585cbfc7d1c30a23286d0b25ce7066a368a5d7/index.js b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/asset.6019bfc8ab05a24b0ae9b5d8f4585cbfc7d1c30a23286d0b25ce7066a368a5d7/index.js deleted file mode 100644 index 73c02658c48d9..0000000000000 --- a/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/asset.6019bfc8ab05a24b0ae9b5d8f4585cbfc7d1c30a23286d0b25ce7066a368a5d7/index.js +++ /dev/null @@ -1 +0,0 @@ -console.log('Hello World'); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/asset.b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37/TestApplicationServer b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/asset.b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37/TestApplicationServer new file mode 100755 index 0000000000000..a4f885388c109 Binary files /dev/null and b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/asset.b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37/TestApplicationServer differ diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/asset.b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37/install.sh b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/asset.b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37/install.sh new file mode 100755 index 0000000000000..1ef448e39373c --- /dev/null +++ b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/asset.b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37/install.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# make sure the gameserver is executable +/usr/bin/chmod +x /local/game/TestApplicationServer +exit 0 diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/aws-gamelift-build.assets.json b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/aws-gamelift-build.assets.json index 288379fb15a56..e28bd324f7030 100644 --- a/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/aws-gamelift-build.assets.json +++ b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/aws-gamelift-build.assets.json @@ -1,20 +1,20 @@ { "version": "21.0.0", "files": { - "6019bfc8ab05a24b0ae9b5d8f4585cbfc7d1c30a23286d0b25ce7066a368a5d7": { + "b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37": { "source": { - "path": "asset.6019bfc8ab05a24b0ae9b5d8f4585cbfc7d1c30a23286d0b25ce7066a368a5d7", + "path": "asset.b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "6019bfc8ab05a24b0ae9b5d8f4585cbfc7d1c30a23286d0b25ce7066a368a5d7.zip", + "objectKey": "b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "56a977de7626326c13fb108674329fc1a0952d0c525384c951169c7c75812e47": { + "2bd5bde6b8c6af8bf7ca2e03bf58bcf2fbd6a755101d9747a72238d65e0d8230": { "source": { "path": "aws-gamelift-build.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "56a977de7626326c13fb108674329fc1a0952d0c525384c951169c7c75812e47.json", + "objectKey": "2bd5bde6b8c6af8bf7ca2e03bf58bcf2fbd6a755101d9747a72238d65e0d8230.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/aws-gamelift-build.template.json b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/aws-gamelift-build.template.json index ebdf264e941a1..d1e5c0a43f872 100644 --- a/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/aws-gamelift-build.template.json +++ b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/aws-gamelift-build.template.json @@ -40,7 +40,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/6019bfc8ab05a24b0ae9b5d8f4585cbfc7d1c30a23286d0b25ce7066a368a5d7.zip" + "/b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37.zip" ] ] } @@ -59,18 +59,20 @@ "Build45A36621": { "Type": "AWS::GameLift::Build", "Properties": { + "OperatingSystem": "AMAZON_LINUX_2", "StorageLocation": { "Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "Key": "6019bfc8ab05a24b0ae9b5d8f4585cbfc7d1c30a23286d0b25ce7066a368a5d7.zip", + "Key": "b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37.zip", "RoleArn": { "Fn::GetAtt": [ "BuildServiceRole1F57E904", "Arn" ] } - } + }, + "Version": "1.0" }, "DependsOn": [ "BuildServiceRoleDefaultPolicyCB7101C6", @@ -78,6 +80,38 @@ ] } }, + "Outputs": { + "BuildArn": { + "Value": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":gamelift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":build/", + { + "Ref": "Build45A36621" + } + ] + ] + } + }, + "BuildId": { + "Value": { + "Ref": "Build45A36621" + } + } + }, "Parameters": { "BootstrapVersion": { "Type": "AWS::SSM::Parameter::Value", diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/manifest.json b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/manifest.json index c0fe7b2462be3..fef7e9c3c0857 100644 --- a/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { "version": "21.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-gamelift-build.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "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}/56a977de7626326c13fb108674329fc1a0952d0c525384c951169c7c75812e47.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2bd5bde6b8c6af8bf7ca2e03bf58bcf2fbd6a755101d9747a72238d65e0d8230.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -57,6 +51,18 @@ "data": "Build45A36621" } ], + "/aws-gamelift-build/BuildArn": [ + { + "type": "aws:cdk:logicalId", + "data": "BuildArn" + } + ], + "/aws-gamelift-build/BuildId": [ + { + "type": "aws:cdk:logicalId", + "data": "BuildId" + } + ], "/aws-gamelift-build/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -118,6 +124,12 @@ ] }, "displayName": "Build/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/tree.json b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/tree.json index 58798a9740d0c..69e8ae12fa743 100644 --- a/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-gamelift/test/integ.build.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.140" - } - }, "aws-gamelift-build": { "id": "aws-gamelift-build", "path": "aws-gamelift-build", @@ -24,6 +16,14 @@ "id": "ServiceRole", "path": "aws-gamelift-build/Build/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "aws-gamelift-build/Build/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "aws-gamelift-build/Build/ServiceRole/Resource", @@ -79,7 +79,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/6019bfc8ab05a24b0ae9b5d8f4585cbfc7d1c30a23286d0b25ce7066a368a5d7.zip" + "/b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37.zip" ] ] } @@ -152,18 +152,20 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::GameLift::Build", "aws:cdk:cloudformation:props": { + "operatingSystem": "AMAZON_LINUX_2", "storageLocation": { "bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "key": "6019bfc8ab05a24b0ae9b5d8f4585cbfc7d1c30a23286d0b25ce7066a368a5d7.zip", + "key": "b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37.zip", "roleArn": { "Fn::GetAtt": [ "BuildServiceRole1F57E904", "Arn" ] } - } + }, + "version": "1.0" } }, "constructInfo": { @@ -176,6 +178,38 @@ "fqn": "@aws-cdk/aws-gamelift.Build", "version": "0.0.0" } + }, + "BuildArn": { + "id": "BuildArn", + "path": "aws-gamelift-build/BuildArn", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "BuildId": { + "id": "BuildId", + "path": "aws-gamelift-build/BuildId", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-gamelift-build/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-gamelift-build/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { @@ -196,12 +230,30 @@ "path": "Build/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.140" + "version": "10.1.161" } }, "DeployAssert": { "id": "DeployAssert", "path": "Build/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "Build/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "Build/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, "constructInfo": { "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" @@ -218,6 +270,14 @@ "fqn": "@aws-cdk/integ-tests.IntegTest", "version": "0.0.0" } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.161" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.build.ts b/packages/@aws-cdk/aws-gamelift/test/integ.build.ts index 75d260e07c58d..cd58a55109737 100644 --- a/packages/@aws-cdk/aws-gamelift/test/integ.build.ts +++ b/packages/@aws-cdk/aws-gamelift/test/integ.build.ts @@ -1,5 +1,6 @@ import * as path from 'path'; import * as cdk from '@aws-cdk/core'; +import { CfnOutput } from '@aws-cdk/core'; import { IntegTest } from '@aws-cdk/integ-tests'; import { Construct } from 'constructs'; import * as gamelift from '../lib'; @@ -8,9 +9,14 @@ class TestStack extends cdk.Stack { constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props); - new gamelift.Build(this, 'Build', { + const build = new gamelift.Build(this, 'Build', { content: gamelift.Content.fromAsset(path.join(__dirname, 'my-game-build')), + operatingSystem: gamelift.OperatingSystem.AMAZON_LINUX_2, + buildVersion: '1.0', }); + + new CfnOutput(this, 'BuildArn', { value: build.buildArn }); + new CfnOutput(this, 'BuildId', { value: build.buildId }); } } diff --git a/packages/@aws-cdk/aws-iam/README.md b/packages/@aws-cdk/aws-iam/README.md index b63b628a731a3..f7e7d6e16e258 100644 --- a/packages/@aws-cdk/aws-iam/README.md +++ b/packages/@aws-cdk/aws-iam/README.md @@ -45,7 +45,7 @@ declare const table: dynamodb.Table; table.grant(fn, 'dynamodb:PutItem'); ``` -The `grant*` methods accept an `IGrantable` object. This interface is implemented by IAM principlal resources (groups, users and roles) and resources that assume a role such as a Lambda function, EC2 instance or a Codebuild project. +The `grant*` methods accept an `IGrantable` object. This interface is implemented by IAM principal resources (groups, users and roles) and resources that assume a role such as a Lambda function, EC2 instance or a Codebuild project. You can find which `grant*` methods exist for a resource in the [AWS CDK API Reference](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-construct-library.html). @@ -407,7 +407,7 @@ const newPolicy = new iam.Policy(this, 'MyNewPolicy', { [Permissions Boundaries](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) -can be used as a mechanism to prevent privilege esclation by creating new +can be used as a mechanism to prevent privilege escalation by creating new `Role`s. Permissions Boundaries are a Managed Policy, attached to Roles or Users, that represent the *maximum* set of permissions they can have. The effective set of permissions of a Role (or User) will be the intersection of diff --git a/packages/@aws-cdk/aws-iotevents-actions/README.md b/packages/@aws-cdk/aws-iotevents-actions/README.md index c4c9eaa13d96d..0834259e6d63a 100644 --- a/packages/@aws-cdk/aws-iotevents-actions/README.md +++ b/packages/@aws-cdk/aws-iotevents-actions/README.md @@ -25,7 +25,7 @@ AWS IoT Events can trigger actions when it detects a specified event or transiti Currently supported are: - Use timer -- Set variable to detector instanse +- Set variable to detector instance - Invoke a Lambda function ## Use timer @@ -96,9 +96,9 @@ online.transitionTo(offline, { when: iotevents.Expression.timeout('MyTimer') }); offline.transitionTo(online, { when: iotevents.Expression.currentInput(input) }); ``` -## Set variable to detector instanse +## Set variable to detector instance -The code snippet below creates an Action that set variable to detector instanse +The code snippet below creates an Action that set variable to detector instance when it is triggered. ```ts diff --git a/packages/@aws-cdk/aws-kinesisfirehose/README.md b/packages/@aws-cdk/aws-kinesisfirehose/README.md index bd9f5ab87a941..636f842e9a3b4 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/README.md +++ b/packages/@aws-cdk/aws-kinesisfirehose/README.md @@ -28,7 +28,7 @@ endpoint or third-party services such as Datadog, Dynatrace, LogicMonitor, Mongo Relic, and Sumo Logic. Kinesis Data Firehose delivery streams are distinguished from Kinesis data streams in -their models of consumtpion. Whereas consumers read from a data stream by actively pulling +their models of consumption. Whereas consumers read from a data stream by actively pulling data from the stream, a delivery stream pushes data to its destination on a regular cadence. This means that data streams are intended to have consumers that do on-demand processing, like AWS Lambda or Amazon EC2. On the other hand, delivery streams are diff --git a/packages/@aws-cdk/aws-lambda-go/README.md b/packages/@aws-cdk/aws-lambda-go/README.md index aa805e336b7e0..68c83da46775b 100644 --- a/packages/@aws-cdk/aws-lambda-go/README.md +++ b/packages/@aws-cdk/aws-lambda-go/README.md @@ -210,7 +210,7 @@ By default this parameter is set to `AssetHashType.OUTPUT` which means that the If you specify `AssetHashType.SOURCE`, the CDK will calculate the asset hash by looking at the folder that contains your `go.mod` file. If you are deploying a single Lambda function, or you want to redeploy -all of your functions if anything changes, then `AssetHashType.SOURCE` will probaby work. +all of your functions if anything changes, then `AssetHashType.SOURCE` will probably work. For example, if my app looked like this: @@ -232,7 +232,7 @@ will determine that the protect root is `lambda-app` (it contains the `go.mod` f Since I only have a single Lambda function, and any update to files within the `lambda-app` directory should trigger a new deploy, I could specify `AssetHashType.SOURCE`. -On the other hand, if I had a project that deployed mmultiple Lambda functions, for example: +On the other hand, if I had a project that deployed multiple Lambda functions, for example: ```bash lamda-app diff --git a/packages/@aws-cdk/aws-logs/README.md b/packages/@aws-cdk/aws-logs/README.md index c10a095920c65..369819dba45b1 100644 --- a/packages/@aws-cdk/aws-logs/README.md +++ b/packages/@aws-cdk/aws-logs/README.md @@ -73,7 +73,7 @@ logGroup.grantWrite(new iam.ServicePrincipal('es.amazonaws.com')); Be aware that any ARNs or tokenized values passed to the resource policy will be converted into AWS Account IDs. This is because CloudWatch Logs Resource Policies do not accept ARNs as principals, but they do accept -Account ID strings. Non-ARN principals, like Service principals or Any princpals, are accepted by CloudWatch. +Account ID strings. Non-ARN principals, like Service principals or Any principals, are accepted by CloudWatch. ## Encrypting Log Groups @@ -146,7 +146,7 @@ declare const logGroup: logs.LogGroup; logGroup.extractMetric('$.jsonField', 'Namespace', 'MetricName'); ``` -Will extract the value of `jsonField` wherever it occurs in JSON-structed +Will extract the value of `jsonField` wherever it occurs in JSON-structured log records in the LogGroup, and emit them to CloudWatch Metrics under the name `Namespace/MetricName`. diff --git a/packages/@aws-cdk/aws-opensearchservice/README.md b/packages/@aws-cdk/aws-opensearchservice/README.md index 04153b1fc7a48..0e372d1eebdc1 100644 --- a/packages/@aws-cdk/aws-opensearchservice/README.md +++ b/packages/@aws-cdk/aws-opensearchservice/README.md @@ -75,7 +75,7 @@ logging the domain logs and slow search logs. Some cluster configurations (e.g VPC access) require the existence of the [`AWSServiceRoleForAmazonElasticsearchService`](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/slr.html) Service-Linked Role. -When performing such operations via the AWS Console, this SLR is created automatically when needed. However, this is not the behavior when using CloudFormation. If an SLR is needed, but doesn't exist, you will encounter a failure message simlar to: +When performing such operations via the AWS Console, this SLR is created automatically when needed. However, this is not the behavior when using CloudFormation. If an SLR is needed, but doesn't exist, you will encounter a failure message similar to: ```console Before you can proceed, you must enable a service-linked role to give Amazon OpenSearch Service... @@ -228,7 +228,7 @@ means anyone can access the domain using the configured master username and password. To enable unsigned basic auth access the domain is configured with an access -policy that allows anyonmous requests, HTTPS required, node to node encryption, +policy that allows anonymous requests, HTTPS required, node to node encryption, encryption at rest and fine grained access control. If the above settings are not set they will be configured as part of enabling diff --git a/packages/@aws-cdk/aws-secretsmanager/README.md b/packages/@aws-cdk/aws-secretsmanager/README.md index 0a86cc2ee2082..c169590edbb1b 100644 --- a/packages/@aws-cdk/aws-secretsmanager/README.md +++ b/packages/@aws-cdk/aws-secretsmanager/README.md @@ -218,7 +218,7 @@ credentials generation and rotation is integrated. ## Importing Secrets Existing secrets can be imported by ARN, name, and other attributes (including the KMS key used to encrypt the secret). -Secrets imported by name should use the short-form of the name (without the SecretsManager-provided suffx); +Secrets imported by name should use the short-form of the name (without the SecretsManager-provided suffix); the secret name must exist in the same account and region as the stack. Importing by name makes it easier to reference secrets created in different regions, each with their own suffix and ARN. diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/README.md b/packages/@aws-cdk/aws-servicecatalogappregistry/README.md index 9361d65c8b76a..10985d4839557 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/README.md +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/README.md @@ -22,7 +22,7 @@ [AWS Service Catalog App Registry](https://docs.aws.amazon.com/servicecatalog/latest/adminguide/appregistry.html) -enables organizations to create and manage repositores of applications and associated resources. +enables organizations to create and manage repositories of applications and associated resources. ## Table Of Contents @@ -140,7 +140,7 @@ const cdkPipeline = new ApplicationPipelineStack(app, 'CDKApplicationPipelineSta ## Attribute Group An AppRegistry attribute group acts as a container for user-defined attributes for an application. -Metadata is attached in a machine-readble format to integrate with automated workflows and tools. +Metadata is attached in a machine-readable format to integrate with automated workflows and tools. ```ts const attributeGroup = new appreg.AttributeGroup(this, 'MyFirstAttributeGroup', { diff --git a/packages/@aws-cdk/cfnspec/lib/canned-metrics/README.md b/packages/@aws-cdk/cfnspec/lib/canned-metrics/README.md index 85efc3d041c3f..10295540c4ba8 100644 --- a/packages/@aws-cdk/cfnspec/lib/canned-metrics/README.md +++ b/packages/@aws-cdk/cfnspec/lib/canned-metrics/README.md @@ -56,7 +56,7 @@ HTTP code (ELB or backend), the metric name itself comes from an ENUM. public metricHttpCodeTarget(code: HttpCodeTarget, props?: cloudwatch.MetricOptions) { ``` -NetworkLoadBalancer: get rid of underscores and recapitalize abbrevations +NetworkLoadBalancer: get rid of underscores and recapitalize abbreviations ```js metricTcpClientResetCount => 'TCP_Client_Reset_Count' diff --git a/packages/@aws-cdk/cloud-assembly-schema/CONTRIBUTING.md b/packages/@aws-cdk/cloud-assembly-schema/CONTRIBUTING.md index 1047e61261058..0a96c52f7ca1a 100644 --- a/packages/@aws-cdk/cloud-assembly-schema/CONTRIBUTING.md +++ b/packages/@aws-cdk/cloud-assembly-schema/CONTRIBUTING.md @@ -20,7 +20,7 @@ There are two main things to understand about the files in this module: - [`lib/schema`](./schema/) - This directory contains the generated json [schema](./schema/cloud-assembly.schema.json) from the aformentioned + This directory contains the generated json [schema](./schema/cloud-assembly.schema.json) from the aforementioned typescript code. It also contains a [version](./schema/cloud-assembly.version.json) file that holds the current version of the schema. These files are **not** intended for manual editing. Keep reading to understand how they change and when. @@ -31,7 +31,7 @@ an updated json schema to [`cloud-assembly.schema.json`](./schema/cloud-assembly In addition, this command also performs a `major` version bump on the [version](./schema/cloud-assembly.version.json) file. Note that it is not generated as part of the build, this is to ensure developers will be intentional when making -changes to the schema. If changes to the code are perfomed, without generating a new schema, the tests will fail: +changes to the schema. If changes to the code are performed, without generating a new schema, the tests will fail: ```console $ yarn test @@ -58,7 +58,7 @@ This means that breaking changes will be rejected. These include: - Adding a required property. (same as changing from *optional* to *required*) - Changing the type of the property. -In addition, the interfaces defined here are programatically exposed to users, via the `manifest` +In addition, the interfaces defined here are programmatically exposed to users, via the `manifest` property of the [`CloudAssembly`](../cx-api/lib/cloud-assembly.ts) class. This means that the following are also considered breaking changes: diff --git a/packages/@aws-cdk/core/README.md b/packages/@aws-cdk/core/README.md index 162b60efac881..da983bbf62ca5 100644 --- a/packages/@aws-cdk/core/README.md +++ b/packages/@aws-cdk/core/README.md @@ -1,23 +1,54 @@ -# AWS Cloud Development Kit Core Library - +# AWS Cloud Development Kit Library ---- +The AWS CDK construct library provides APIs to define your CDK application and add +CDK constructs to the application. -![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge) +## Usage -![cdk-constructs: Stable](https://img.shields.io/badge/cdk--constructs-stable-success.svg?style=for-the-badge) +### Upgrade from CDK 1.x ---- +When upgrading from CDK 1.x, remove all dependencies to individual CDK packages +from your dependencies file and follow the rest of the sections. - +### Installation -This library includes the basic building blocks of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) (AWS CDK). It defines the core classes that are used in the rest of the -AWS Construct Library. +To use this package, you need to declare this package and the `constructs` package as +dependencies. -See the [AWS CDK Developer -Guide](https://docs.aws.amazon.com/cdk/latest/guide/home.html) for -information of most of the capabilities of this library. The rest of this -README will only cover topics not already covered in the Developer Guide. +According to the kind of project you are developing: + +- For projects that are CDK libraries, declare them both under the `devDependencies` + **and** `peerDependencies` sections. +- For CDK apps, declare them under the `dependencies` section only. + +### Use in your code + +#### Classic import + +You can use a classic import to get access to each service namespaces: + +```ts +import { Stack, App, aws_s3 as s3 } from 'aws-cdk-lib'; + +const app = new App(); +const stack = new Stack(app, 'TestStack'); + +new s3.Bucket(stack, 'TestBucket'); +``` + +#### Barrel import + +Alternatively, you can use "barrel" imports: + +```ts +import { App, Stack } from 'aws-cdk-lib'; +import { Bucket } from 'aws-cdk-lib/aws-s3'; + +const app = new App(); +const stack = new Stack(app, 'TestStack'); + +new Bucket(stack, 'TestBucket'); +``` diff --git a/packages/@aws-cdk/pipelines/ORIGINAL_API.md b/packages/@aws-cdk/pipelines/ORIGINAL_API.md index cba9e7476669a..37bce5a2e2f42 100644 --- a/packages/@aws-cdk/pipelines/ORIGINAL_API.md +++ b/packages/@aws-cdk/pipelines/ORIGINAL_API.md @@ -200,7 +200,7 @@ See the section [**Arbitrary CodePipeline actions** in the main `README`](https://github.com/aws/aws-cdk/blob/main/packages/@aws-cdk/pipelines/README.md#arbitrary-codepipeline-actions) for an example of how to inject arbitrary CodeBuild Actions. -## Definining the pipeline +## Defining the pipeline In the original API, you have to import the `aws-codepipeline` construct library and create `Artifact` objects for the source and Cloud Assembly diff --git a/packages/@aws-cdk/pipelines/README.md b/packages/@aws-cdk/pipelines/README.md index 4ff39f12c03fa..410f501077d5c 100644 --- a/packages/@aws-cdk/pipelines/README.md +++ b/packages/@aws-cdk/pipelines/README.md @@ -212,7 +212,7 @@ const originalPipeline = new pipelines.CdkPipeline(this, 'Pipeline', { }); ``` -## Definining the pipeline +## Defining the pipeline This section of the documentation describes the AWS CodePipeline engine, which comes with this library. If you want to use a different deployment @@ -1006,7 +1006,7 @@ For authenticating to Docker registries that require a username and password com (like DockerHub), create a Secrets Manager Secret with fields named `username` and `secret`, and import it (the field names change be customized). -Authentication to ECR repostories is done using the execution role of the +Authentication to ECR repositories is done using the execution role of the relevant CodeBuild job. Both types of credentials can be provided with an optional role to assume before requesting the credentials. @@ -1113,7 +1113,7 @@ These command lines explained: trusted account, only allowing it to look up values such as availability zones, EC2 images and VPCs. `--trust-for-lookup` does not give permissions to modify anything in the account. Note that `--trust` implies `--trust-for-lookup`, so you don't need to specify - the same acocunt twice. + the same account twice. - `aws://222222222222/us-east-2`: the account and region we're bootstrapping. > Be aware that anyone who has access to the trusted Accounts **effectively has all diff --git a/packages/aws-cdk/CONTRIBUTING.md b/packages/aws-cdk/CONTRIBUTING.md index 1df34c8fe7985..d5fcde7315794 100644 --- a/packages/aws-cdk/CONTRIBUTING.md +++ b/packages/aws-cdk/CONTRIBUTING.md @@ -140,7 +140,7 @@ Before diving into it, we establish a few key concepts: - `CANDIDATE_VERSION` - This is the version of the code that is being built in the pipeline, and its value is stored in the `build.json` file of the packaged artifact of the repo. - `PREVIOUS_VERSION` - This is the version previous to the `CANDIDATE_VERSION`. - `CLI_VERSION` - This is the version of the CLI we are testing. It is **always** the same as the `CANDIDATE_VERSION` since we want to test the latest CLI code. -- `FRAMEWORK_VERSION` - This is the version of the framework we are testing. It varries between the two variation of the regression suites. +- `FRAMEWORK_VERSION` - This is the version of the framework we are testing. It varies between the two variation of the regression suites. Its value can either be that of `CANDIDATE_VERSION` (for testing against the latest framework code), or `PREVIOUS_VERSION` (for testing against the previously published version of the framework code). Following are the steps involved in running these tests: @@ -160,7 +160,7 @@ Following are the steps involved in running these tests: - [Install the CLI](./test/integ/run-against-dist#L30) using the `CANDIDATE_VERSION` version `CANDIDATE_VERSION` env variable. - Execute the given script. -6. Both cli regression test scripts run the same [`run_regression_against_framework_version`](./test/integ/test-cli-regression.bash#L22) function. This function accepts which framework version should the regression run against, it can be either `CANDIDATE_VERSION` or `PREVIOUS_VERSION`. Note that the argument is not the actual value of the version, but instead is just an [indirection indentifier](./test/integ/test-cli-regression.bash#L81). The function will: +6. Both cli regression test scripts run the same [`run_regression_against_framework_version`](./test/integ/test-cli-regression.bash#L22) function. This function accepts which framework version should the regression run against, it can be either `CANDIDATE_VERSION` or `PREVIOUS_VERSION`. Note that the argument is not the actual value of the version, but instead is just an [indirection identifier](./test/integ/test-cli-regression.bash#L81). The function will: - Calculate the actual value of the previous version based on the candidate version. (fetches from github) - Download the previous version tarball from npm and extract the integration tests. diff --git a/packages/aws-cdk/README.md b/packages/aws-cdk/README.md index e46213b4d2c7e..646d7676b68e3 100644 --- a/packages/aws-cdk/README.md +++ b/packages/aws-cdk/README.md @@ -552,7 +552,7 @@ $ cdk destroy --app='node bin/main.js' MyStackName ### `cdk bootstrap` Deploys a `CDKToolkit` CloudFormation stack into the specified environment(s), that provides an S3 bucket -and ECR reposity that `cdk deploy` will use to store synthesized templates and the related assets, before +and ECR repository that `cdk deploy` will use to store synthesized templates and the related assets, before triggering a CloudFormation stack update. The name of the deployed stack can be configured using the `--toolkit-stack-name` argument. The S3 Bucket Public Access Block Configuration can be configured using the `--public-access-block-configuration` argument. ECR uses immutable tags for images. @@ -659,7 +659,7 @@ You can suppress warnings in a variety of ways: } ``` -- acknowleding individual notices via `cdk acknowledge` (see below). +- acknowledging individual notices via `cdk acknowledge` (see below). ### `cdk acknowledge` diff --git a/packages/aws-cdk/lib/assets.ts b/packages/aws-cdk/lib/assets.ts index cb343db5282f1..6f96e6af2c6aa 100644 --- a/packages/aws-cdk/lib/assets.ts +++ b/packages/aws-cdk/lib/assets.ts @@ -41,7 +41,7 @@ export async function addMetadataAssetsToManifest(stack: cxapi.CloudFormationSta debug(`Preparing asset ${asset.id}: ${JSON.stringify(asset)}`); if (!stack.assembly) { - throw new Error('Unexpected: stack assembly is required in order to find assets in assemly directory'); + throw new Error('Unexpected: stack assembly is required in order to find assets in assembly directory'); } Object.assign(params, await prepareAsset(asset, assetManifest, toolkitInfo));