Skip to content

Commit

Permalink
Merge branch 'main' into houes/rfc-436-Alias
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehouel authored Nov 25, 2022
2 parents 4f2ba26 + 680a755 commit e334cb3
Show file tree
Hide file tree
Showing 49 changed files with 530 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<A extends object>(how: A, matcher: PropertyMatcher): PropertyMatcher {
(matcher as any).toJSON = () => how;
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assertions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-appmesh/lib/virtual-node-listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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 {
/**
Expand All @@ -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 {
/**
Expand All @@ -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 {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codebuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codepipeline-actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cognito/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ new cognito.UserPool(this, 'myuserpool', {
```

By default, usernames and email addresses in user pools are case sensitive, which means `[email protected]` and `[email protected]`
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.

Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ecr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-events/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
28 changes: 21 additions & 7 deletions packages/@aws-cdk/aws-events/lib/event-pattern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -69,15 +83,15 @@ 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);
}

/**
* 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');
}
Expand All @@ -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 } }]);
}

Expand Down Expand Up @@ -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}]`);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "20.0.0",
"version": "21.0.0",
"files": {
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
"source": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "20.0.0",
"version": "21.0.0",
"files": {
"f8f3154528da0601b814868afeeb0474f8644916293f783617ff6d56a6d92035": {
"f9728b2d2c64ff638563c8cc4a3e8eb9ddf3074e2ae01d68fde11aeda0968fb1": {
"source": {
"path": "RuleStack.template.json",
"packaging": "file"
},
"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}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@
"prefix": "sensitive-"
}
}
],
"suffix": [
{
"suffix": ".com"
}
],
"equalsIgnoreCase": [
{
"equals-ignore-case": "ignore case"
}
]
},
"detail-type": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"20.0.0"}
{"version":"21.0.0"}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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": [
Expand Down Expand Up @@ -106,6 +100,12 @@
]
},
"displayName": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert"
},
"Tree": {
"type": "cdk:tree",
"properties": {
"file": "tree.json"
}
}
}
}
Loading

0 comments on commit e334cb3

Please sign in to comment.