Skip to content

Commit d9e2adf

Browse files
authored
Merge branch 'master' into add-flink-1-13
2 parents 062b587 + 5f7c58b commit d9e2adf

22 files changed

Lines changed: 468 additions & 55 deletions

File tree

.mergify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pull_request_rules:
1010
label:
1111
add: [ contribution/core ]
1212
conditions:
13-
- author~=^(eladb|RomainMuller|garnaat|nija-at|skinny85|rix0rrr|NGL321|Jerry-AWS|MrArnoldPalmer|NetaNir|iliapolo|njlynch|ericzbeard|ccfife|fulghum|pkandasamy91|SoManyHs|uttarasridhar|otaviomacedo|BenChaimberg|madeline-k|BryanPan342|kaizen3031593|comcalvi)$
13+
- author~=^(eladb|RomainMuller|garnaat|nija-at|skinny85|rix0rrr|NGL321|Jerry-AWS|MrArnoldPalmer|NetaNir|iliapolo|njlynch|ericzbeard|ccfife|fulghum|pkandasamy91|SoManyHs|uttarasridhar|otaviomacedo|BenChaimberg|madeline-k|BryanPan342|kaizen3031593|comcalvi|Chriscbr)$
1414
- -label~="contribution/core"
1515
- name: automatic merge
1616
actions:

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [1.129.0](https://github.com/aws/aws-cdk/compare/v1.128.0...v1.129.0) (2021-10-21)
6+
7+
8+
### Features
9+
10+
* **aws-autoscaling:** add flag and aspect to require imdsv2 ([#16052](https://github.com/aws/aws-cdk/issues/16052)) ([ef7e20d](https://github.com/aws/aws-cdk/commit/ef7e20df08b4321f210bfc050afa42d7b4901931))
11+
* **codebuild:** add support for small ARM machine type ([#16635](https://github.com/aws/aws-cdk/issues/16635)) ([55fbc86](https://github.com/aws/aws-cdk/commit/55fbc866ef0195fdfc722206e4d69a1f4469cd40)), closes [#16633](https://github.com/aws/aws-cdk/issues/16633)
12+
* **dynamodb:** add option to skip waiting for global replication to finish ([#16983](https://github.com/aws/aws-cdk/issues/16983)) ([254601f](https://github.com/aws/aws-cdk/commit/254601f477a4da309e81f5384140427f1b958bfd)), closes [#16611](https://github.com/aws/aws-cdk/issues/16611)
13+
* **ec2:** add aspect to require imdsv2 ([#16051](https://github.com/aws/aws-cdk/issues/16051)) ([0947b21](https://github.com/aws/aws-cdk/commit/0947b21c1e3186042324820ec5ab433237246f58))
14+
* **eks:** configure serviceIpv4Cidr on the cluster ([#16957](https://github.com/aws/aws-cdk/issues/16957)) ([72102c7](https://github.com/aws/aws-cdk/commit/72102c750bfd6564cd51c1a5d8abc79b1ba1d3ce)), closes [#16541](https://github.com/aws/aws-cdk/issues/16541)
15+
* **events:** Add DLQ support for SQS target ([#16916](https://github.com/aws/aws-cdk/issues/16916)) ([7fda903](https://github.com/aws/aws-cdk/commit/7fda90318e18b3a5d126b040e35a0146634d5f2d)), closes [#16417](https://github.com/aws/aws-cdk/issues/16417)
16+
* **msk:** add Kafka version 2.8.1 ([#16881](https://github.com/aws/aws-cdk/issues/16881)) ([7db5c8c](https://github.com/aws/aws-cdk/commit/7db5c8cdafe7b9b22b6b40cb25ed8bd1946301f4))
17+
* **stepfunctions-tasks:** add `enableNetworkIsolation` property to `SageMakerCreateTrainingJobProps` ([#16792](https://github.com/aws/aws-cdk/issues/16792)) ([69ac520](https://github.com/aws/aws-cdk/commit/69ac520452b219bf242f2fbb4740f6b1b8b8790f)), closes [#16779](https://github.com/aws/aws-cdk/issues/16779)
18+
19+
20+
### Bug Fixes
21+
22+
* **apigatewayv2:** unable to retrieve domain url for default stage ([#16854](https://github.com/aws/aws-cdk/issues/16854)) ([c6db91e](https://github.com/aws/aws-cdk/commit/c6db91eee2cb658ce347c7ac6d6e3c95bc5977dc)), closes [#16638](https://github.com/aws/aws-cdk/issues/16638)
23+
* **cfn-diff:** correctly handle Date strings in diff ([#16591](https://github.com/aws/aws-cdk/issues/16591)) ([86f2714](https://github.com/aws/aws-cdk/commit/86f2714613f06aaf2bcee27da2f66066c8e863d0)), closes [#16444](https://github.com/aws/aws-cdk/issues/16444)
24+
* **ecs:** imported services don't have account & region set correctly ([#16997](https://github.com/aws/aws-cdk/issues/16997)) ([dc6f743](https://github.com/aws/aws-cdk/commit/dc6f7433f01b9bc2c8206fb03d72ab8404fe4f6a)), closes [#11199](https://github.com/aws/aws-cdk/issues/11199) [#11199](https://github.com/aws/aws-cdk/issues/11199) [#15944](https://github.com/aws/aws-cdk/issues/15944)
25+
* **events:** PhysicalName.GENERATE_IF_NEEDED does not work for EventBus ([#17008](https://github.com/aws/aws-cdk/issues/17008)) ([707fa00](https://github.com/aws/aws-cdk/commit/707fa003a458039878a1ae5173b6665a84c1170b)), closes [#14337](https://github.com/aws/aws-cdk/issues/14337)
26+
* **lambda:** docker image function fails when insightsVersion is specified ([#16781](https://github.com/aws/aws-cdk/issues/16781)) ([d0e15cc](https://github.com/aws/aws-cdk/commit/d0e15ccaca22c5e05b9186aa1a241e744d67c96a)), closes [#16642](https://github.com/aws/aws-cdk/issues/16642)
27+
* **lambda-layer-node-proxy-agent:** Replace use of package.json with Dockerfile command `npm install [package]@[version]` ([#17078](https://github.com/aws/aws-cdk/issues/17078)) ([a129046](https://github.com/aws/aws-cdk/commit/a129046495a926561f94f5ce1f41c34b1df3afde))
28+
* **opensearch:** add validation to domainName property ([#17017](https://github.com/aws/aws-cdk/issues/17017)) ([3ec6832](https://github.com/aws/aws-cdk/commit/3ec683283e96159d588797bd46d33c82ff3076f1)), closes [#17016](https://github.com/aws/aws-cdk/issues/17016)
29+
* **pipelines:** `additionalInputs` fails for deep directory ([#17074](https://github.com/aws/aws-cdk/issues/17074)) ([403d3ce](https://github.com/aws/aws-cdk/commit/403d3ce3bc0f4e30e9694e5c20743f0032009464)), closes [#16936](https://github.com/aws/aws-cdk/issues/16936)
30+
531
## [1.128.0](https://github.com/aws/aws-cdk/compare/v1.127.0...v1.128.0) (2021-10-14)
632

733

packages/@aws-cdk/aws-applicationautoscaling/lib/base-scalable-attribute.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export abstract class BaseScalableAttribute extends CoreConstruct {
8686
}
8787

8888
/**
89-
* Properties for enabling DynamoDB capacity scaling
89+
* Properties for enabling Application Auto Scaling
9090
*/
9191
export interface EnableScalingProps {
9292
/**

packages/@aws-cdk/aws-events-targets/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const queue = new sqs.Queue(this, 'Queue');
6565

6666
rule.addTarget(new targets.LambdaFunction(fn, {
6767
deadLetterQueue: queue, // Optional: add a dead letter queue
68-
maxEventAge: cdk.Duration.hours(2), // Otional: set the maxEventAge retry policy
68+
maxEventAge: cdk.Duration.hours(2), // Optional: set the maxEventAge retry policy
6969
retryAttempts: 2, // Optional: set the max number of retry attempts
7070
}));
7171
```

packages/@aws-cdk/aws-iam/lib/managed-policy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export class ManagedPolicy extends Resource implements IManagedPolicy {
151151
* For this managed policy, you only need to know the name to be able to use it.
152152
*
153153
* Some managed policy names start with "service-role/", some start with
154-
* "job-function/", and some don't start with anything. Do include the
154+
* "job-function/", and some don't start with anything. Include the
155155
* prefix when constructing this object.
156156
*/
157157
public static fromAwsManagedPolicyName(managedPolicyName: string): IManagedPolicy {

packages/@aws-cdk/aws-iot/README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,47 @@
99
>
1010
> [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib
1111
12+
![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)
13+
14+
> The APIs of higher level constructs in this module are experimental and under active development.
15+
> They are subject to non-backward compatible changes or removal in any future version. These are
16+
> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
17+
> announced in the release notes. This means that while you may use them, you may need to update
18+
> your source code when upgrading to a newer version of this package.
19+
1220
---
1321

1422
<!--END STABILITY BANNER-->
1523

16-
This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
24+
AWS IoT Core lets you connect billions of IoT devices and route trillions of
25+
messages to AWS services without managing infrastructure.
26+
27+
## Installation
28+
29+
Install the module:
30+
31+
```console
32+
$ npm i @aws-cdk/aws-iot
33+
```
34+
35+
Import it into your code:
36+
37+
```ts
38+
import * as iot from '@aws-cdk/aws-iot';
39+
```
40+
41+
## `TopicRule`
42+
43+
The `TopicRule` construct defined Rules that give your devices the ability to
44+
interact with AWS services.
45+
46+
For example, to define a rule:
47+
48+
```ts
49+
new iot.TopicRule(stack, 'MyTopicRule', {
50+
topicRuleName: 'MyRuleName', // optional property
51+
sql: iot.IotSql.fromStringAsVer20160323(
52+
"SELECT topic(2) as device_id, temperature FROM 'device/+/data'",
53+
),
54+
});
55+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
export * from './iot-sql';
2+
export * from './topic-rule';
3+
14
// AWS::IoT CloudFormation Resources:
25
export * from './iot.generated';
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import { Construct } from 'constructs';
2+
3+
/**
4+
* The type returned from the `bind()` method in {@link IotSql}.
5+
*/
6+
export interface IotSqlConfig {
7+
/**
8+
* The version of the SQL rules engine to use when evaluating the rule.
9+
*/
10+
readonly awsIotSqlVersion: string;
11+
12+
/**
13+
* The SQL statement used to query the topic.
14+
*/
15+
readonly sql: string;
16+
}
17+
18+
/**
19+
* Defines AWS IoT SQL.
20+
*/
21+
export abstract class IotSql {
22+
/**
23+
* Uses the original SQL version built on 2015-10-08.
24+
*
25+
* @param sql The actual SQL-like syntax query
26+
* @returns Instance of IotSql
27+
*/
28+
public static fromStringAsVer20151008(sql: string): IotSql {
29+
return new IotSqlImpl('2015-10-08', sql);
30+
}
31+
32+
/**
33+
* Uses the SQL version built on 2016-03-23.
34+
*
35+
* @param sql The actual SQL-like syntax query
36+
* @returns Instance of IotSql
37+
*/
38+
public static fromStringAsVer20160323(sql: string): IotSql {
39+
return new IotSqlImpl('2016-03-23', sql);
40+
}
41+
42+
/**
43+
* Uses the most recent beta SQL version. If you use this version, it might
44+
* introduce breaking changes to your rules.
45+
*
46+
* @param sql The actual SQL-like syntax query
47+
* @returns Instance of IotSql
48+
*/
49+
public static fromStringAsVerNewestUnstable(sql: string): IotSql {
50+
return new IotSqlImpl('beta', sql);
51+
}
52+
53+
/**
54+
* Returns the IoT SQL configuration.
55+
*/
56+
public abstract bind(scope: Construct): IotSqlConfig;
57+
}
58+
59+
60+
class IotSqlImpl extends IotSql {
61+
constructor(private readonly version: string, private readonly sql: string) {
62+
super();
63+
64+
if (sql === '') {
65+
throw new Error('IoT SQL string cannot be empty');
66+
}
67+
}
68+
69+
bind(_scope: Construct): IotSqlConfig {
70+
return {
71+
awsIotSqlVersion: this.version,
72+
sql: this.sql,
73+
};
74+
}
75+
}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
import { ArnFormat, Resource, Stack, IResource } from '@aws-cdk/core';
2+
import { Construct } from 'constructs';
3+
import { IotSql } from './iot-sql';
4+
import { CfnTopicRule } from './iot.generated';
5+
6+
/**
7+
* Represents an AWS IoT Rule
8+
*/
9+
export interface ITopicRule extends IResource {
10+
/**
11+
* The value of the topic rule Amazon Resource Name (ARN), such as
12+
* arn:aws:iot:us-east-2:123456789012:rule/rule_name
13+
*
14+
* @attribute
15+
*/
16+
readonly topicRuleArn: string;
17+
18+
/**
19+
* The name topic rule
20+
*
21+
* @attribute
22+
*/
23+
readonly topicRuleName: string;
24+
}
25+
26+
/**
27+
* Properties for defining an AWS IoT Rule
28+
*/
29+
export interface TopicRuleProps {
30+
/**
31+
* The name of the rule.
32+
* @default None
33+
*/
34+
readonly topicRuleName?: string;
35+
36+
/**
37+
* A simplified SQL syntax to filter messages received on an MQTT topic and push the data elsewhere.
38+
*
39+
* @see https://docs.aws.amazon.com/iot/latest/developerguide/iot-sql-reference.html
40+
*/
41+
readonly sql: IotSql;
42+
}
43+
44+
/**
45+
* Defines an AWS IoT Rule in this stack.
46+
*/
47+
export class TopicRule extends Resource implements ITopicRule {
48+
/**
49+
* Import an existing AWS IoT Rule provided an ARN
50+
*
51+
* @param scope The parent creating construct (usually `this`).
52+
* @param id The construct's name.
53+
* @param topicRuleArn AWS IoT Rule ARN (i.e. arn:aws:iot:<region>:<account-id>:rule/MyRule).
54+
*/
55+
public static fromTopicRuleArn(scope: Construct, id: string, topicRuleArn: string): ITopicRule {
56+
const parts = Stack.of(scope).splitArn(topicRuleArn, ArnFormat.SLASH_RESOURCE_NAME);
57+
if (!parts.resourceName) {
58+
throw new Error(`Missing topic rule name in ARN: '${topicRuleArn}'`);
59+
}
60+
const resourceName = parts.resourceName;
61+
62+
class Import extends Resource implements ITopicRule {
63+
public readonly topicRuleArn = topicRuleArn;
64+
public readonly topicRuleName = resourceName;
65+
}
66+
return new Import(scope, id, {
67+
environmentFromArn: topicRuleArn,
68+
});
69+
}
70+
71+
/**
72+
* Arn of this rule
73+
* @attribute
74+
*/
75+
public readonly topicRuleArn: string;
76+
77+
/**
78+
* Name of this rule
79+
* @attribute
80+
*/
81+
public readonly topicRuleName: string;
82+
83+
constructor(scope: Construct, id: string, props: TopicRuleProps) {
84+
super(scope, id, {
85+
physicalName: props.topicRuleName,
86+
});
87+
88+
const sqlConfig = props.sql.bind(this);
89+
90+
const resource = new CfnTopicRule(this, 'Resource', {
91+
ruleName: this.physicalName,
92+
topicRulePayload: {
93+
actions: [],
94+
awsIotSqlVersion: sqlConfig.awsIotSqlVersion,
95+
sql: sqlConfig.sql,
96+
},
97+
});
98+
99+
this.topicRuleArn = this.getResourceArnAttribute(resource.attrArn, {
100+
service: 'iot',
101+
resource: 'rule',
102+
resourceName: this.physicalName,
103+
});
104+
this.topicRuleName = this.getResourceNameAttribute(resource.ref);
105+
}
106+
}

packages/@aws-cdk/aws-iot/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@
7474
"devDependencies": {
7575
"@aws-cdk/assertions": "0.0.0",
7676
"@aws-cdk/cdk-build-tools": "0.0.0",
77+
"@aws-cdk/cdk-integ-tools": "0.0.0",
7778
"@aws-cdk/cfn2ts": "0.0.0",
7879
"@aws-cdk/pkglint": "0.0.0",
79-
"@types/jest": "^26.0.24"
80+
"@types/jest": "^26.0.24",
81+
"jest": "^26.6.3"
8082
},
8183
"dependencies": {
8284
"@aws-cdk/core": "0.0.0",
@@ -91,7 +93,7 @@
9193
"node": ">= 10.13.0 <13 || >=13.7.0"
9294
},
9395
"stability": "experimental",
94-
"maturity": "cfn-only",
96+
"maturity": "experimental",
9597
"awscdkio": {
9698
"announce": false
9799
},

0 commit comments

Comments
 (0)