Skip to content

Commit

Permalink
chore(release): 1.151.0 (#19636)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Mar 30, 2022
2 parents 7ca8212 + 51bb924 commit 3434840
Show file tree
Hide file tree
Showing 129 changed files with 6,220 additions and 496 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
}}/upgrade.patch || echo "Empty patch. Skipping."'

- name: Make Pull Request
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v4
with:
# Git commit details
branch: automation/yarn-upgrade
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

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.

## [1.151.0](https://github.com/aws/aws-cdk/compare/v1.150.0...v1.151.0) (2022-03-30)


### Features

* add new integration test runner ([#19529](https://github.com/aws/aws-cdk/issues/19529)) ([e7f43d1](https://github.com/aws/aws-cdk/commit/e7f43d1a3bb52bbf589d7472c9a9b89e3c1cc8c1))
* **aws-ec2:** Enable/disable EC2 "Detailed Monitoring" ([#19437](https://github.com/aws/aws-cdk/issues/19437)) ([94f9d27](https://github.com/aws/aws-cdk/commit/94f9d27e626bced5fc68a6ebbd653fea21c6e21e))
* **cognito:** configure SNS region for UserPool SMS messages ([#19519](https://github.com/aws/aws-cdk/issues/19519)) ([6eb775e](https://github.com/aws/aws-cdk/commit/6eb775e829d62913bff849d43ed7339f9910d8de)), closes [#19434](https://github.com/aws/aws-cdk/issues/19434)


### Bug Fixes

* **aws-cdk:** include nested stacks when building changesets ([#19494](https://github.com/aws/aws-cdk/issues/19494)) ([97cc8e2](https://github.com/aws/aws-cdk/commit/97cc8e29e155b222d553b1fe955a0302036feed5)), closes [#5722](https://github.com/aws/aws-cdk/issues/5722) [#17396](https://github.com/aws/aws-cdk/issues/17396) [#19224](https://github.com/aws/aws-cdk/issues/19224)
* **docdb:** DB Instance ARN uses 'docdb' as the service component instead of 'rds' ([#19555](https://github.com/aws/aws-cdk/issues/19555)) ([6a63924](https://github.com/aws/aws-cdk/commit/6a63924c0b184342befd92903b8867e45b158252)), closes [#19554](https://github.com/aws/aws-cdk/issues/19554)

## [1.150.0](https://github.com/aws/aws-cdk/compare/v1.149.0...v1.150.0) (2022-03-26)


Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assert-internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.1",
"jest": "^27.5.1",
"ts-jest": "^27.1.3"
"ts-jest": "^27.1.4"
},
"dependencies": {
"@aws-cdk/cloud-assembly-schema": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"aws-cdk-migration": "0.0.0",
"constructs": "^3.3.69",
"jest": "^27.3.1",
"ts-jest": "^27.1.3"
"ts-jest": "^27.1.4"
},
"dependencies": {
"@aws-cdk/cloudformation-diff": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assertions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@types/jest": "^27.4.1",
"constructs": "^3.3.69",
"jest": "^27.5.1",
"ts-jest": "^27.1.3"
"ts-jest": "^27.1.4"
},
"dependencies": {
"@aws-cdk/cloud-assembly-schema": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-applicationautoscaling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const handler = new lambda.Function(this, 'MyFunction', {
reservedConcurrentExecutions: 2,
});

const fnVer = handler.addVersion('CDKLambdaVersion', undefined, 'demo alias', 10);
const fnVer = handler.currentVersion;

const target = new appscaling.ScalableTarget(this, 'ScalableTarget', {
serviceNamespace: appscaling.ServiceNamespace.LAMBDA,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
"lambda-tester": "^3.6.0",
"sinon": "^9.2.4",
"nock": "^13.2.4",
"ts-jest": "^27.1.3"
"ts-jest": "^27.1.4"
}
}
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-codedeploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ To create a new CodeDeploy Deployment Group that deploys to a Lambda function:
```ts
declare const myApplication: codedeploy.LambdaApplication;
declare const func: lambda.Function;
const version = func.addVersion('1');
const version = func.currentVersion;
const version1Alias = new lambda.Alias(this, 'alias', {
aliasName: 'prod',
version,
Expand All @@ -222,7 +222,7 @@ const deploymentGroup = new codedeploy.LambdaDeploymentGroup(this, 'BlueGreenDep

In order to deploy a new version of this function:

1. Increment the version, e.g. `const version = func.addVersion('2')`.
1. Reference the version with the latest changes `const version = func.currentVersion`.
2. Re-deploy the stack (this will trigger a deployment).
3. Monitor the CodeDeploy deployment as traffic shifts between the versions.

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 @@ -765,7 +765,7 @@ const func = new lambda.Function(this, 'Lambda', {
runtime: lambda.Runtime.NODEJS_12_X,
});
// used to make sure each CDK synthesis produces a different Version
const version = func.addVersion('NewVersion');
const version = func.currentVersion;
const alias = new lambda.Alias(this, 'LambdaAlias', {
aliasName: 'Prod',
version,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codepipeline-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@aws-cdk/cx-api": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.1",
"@types/lodash": "^4.14.180",
"@types/lodash": "^4.14.181",
"jest": "^27.5.1",
"lodash": "^4.17.21"
},
Expand Down
10 changes: 10 additions & 0 deletions packages/@aws-cdk/aws-cognito/lib/user-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,14 @@ export interface UserPoolProps {
*/
readonly smsRoleExternalId?: string;

/**
* The region to integrate with SNS to send SMS messages
*
* This property will do nothing if SMS configuration is not configured
* @default - The same region as the user pool, with a few exceptions - https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html#user-pool-sms-settings-first-time
*/
readonly snsRegion?: string;

/**
* Setting this would explicitly enable or disable SMS role creation.
* When left unspecified, CDK will determine based on other properties if a role is needed or not.
Expand Down Expand Up @@ -1032,6 +1040,7 @@ export class UserPool extends UserPoolBase {
return {
snsCallerArn: props.smsRole.roleArn,
externalId: props.smsRoleExternalId,
snsRegion: props.snsRegion,
};
}

Expand Down Expand Up @@ -1072,6 +1081,7 @@ export class UserPool extends UserPoolBase {
return {
externalId: smsRoleExternalId,
snsCallerArn: smsRole.roleArn,
snsRegion: props.snsRegion,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,9 @@
"myuserpoolsmsRole0E16FDD9",
"Arn"
]
},
"SnsRegion": {
"Ref": "AWS::Region"
}
},
"SmsVerificationMessage": "verification sms message from the integ test. Code is {####}.",
Expand All @@ -850,7 +853,7 @@
"myuserpoolmyuserpooldomainEE1E11AF": {
"Type": "AWS::Cognito::UserPoolDomain",
"Properties": {
"Domain": "myawesomeapp",
"Domain": "cdkintegrationtestuserpoolexplicitprops",
"UserPoolId": {
"Ref": "myuserpool01998219"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ const userpool = new UserPool(stack, 'myuserpool', {
userMigration: dummyTrigger('userMigration'),
verifyAuthChallengeResponse: dummyTrigger('verifyAuthChallengeResponse'),
},
snsRegion: Stack.of(stack).region,
});

const cognitoDomain = userpool.addDomain('myuserpooldomain', {
cognitoDomain: {
domainPrefix: 'myawesomeapp',
domainPrefix: 'cdkintegrationtestuserpoolexplicitprops',
},
});

Expand Down
22 changes: 22 additions & 0 deletions packages/@aws-cdk/aws-cognito/test/user-pool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,28 @@ describe('User Pool', () => {
});
});

test('snsRegion property is recognized', () => {
// GIVEN
const stack = new Stack();
const role = Role.fromRoleArn(stack, 'smsRole', 'arn:aws:iam::664773442901:role/sms-role');

// WHEN
new UserPool(stack, 'Pool', {
smsRole: role,
smsRoleExternalId: 'test-external-id',
snsRegion: 'test-region-1',
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Cognito::UserPool', {
SmsConfiguration: {
ExternalId: 'test-external-id',
SnsCallerArn: role.roleArn,
SnsRegion: 'test-region-1',
},
});
});

test('import using id', () => {
// GIVEN
const stack = new Stack(undefined, undefined, {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-docdb/lib/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ abstract class DatabaseInstanceBase extends cdk.Resource implements IDatabaseIns
*/
public get instanceArn(): string {
return cdk.Stack.of(this).formatArn({
service: 'docdb',
service: 'rds',
resource: 'db',
arnFormat: ArnFormat.COLON_RESOURCE_NAME,
resourceName: this.instanceIdentifier,
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-docdb/test/instance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('DatabaseInstance', () => {
[
'arn:',
{ Ref: 'AWS::Partition' },
':docdb:us-test-1:12345:db:',
':rds:us-test-1:12345:db:',
{ Ref: 'InstanceC1063A87' },
],
],
Expand Down Expand Up @@ -160,7 +160,7 @@ describe('DatabaseInstance', () => {
[
'arn:',
{ Ref: 'AWS::Partition' },
`:docdb:us-test-1:12345:db:${instanceIdentifier}`,
`:rds:us-test-1:12345:db:${instanceIdentifier}`,
],
],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-dynamodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"aws-sdk-mock": "5.6.0",
"jest": "^27.5.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.3"
"ts-jest": "^27.1.4"
},
"dependencies": {
"@aws-cdk/aws-applicationautoscaling": "0.0.0",
Expand Down
23 changes: 20 additions & 3 deletions packages/@aws-cdk/aws-ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,16 @@ MachineImage.genericLinux({ ... })` and configure the right AMI ID for the
regions you want to deploy to.

By default, the NAT instances will route all traffic. To control what traffic
gets routed, pass `allowAllTraffic: false` and access the
`NatInstanceProvider.connections` member after having passed it to the VPC:
gets routed, pass a custom value for `defaultAllowedTraffic` and access the
`NatInstanceProvider.connections` member after having passed the NAT provider to
the VPC:

```ts
declare const instanceType: ec2.InstanceType;

const provider = ec2.NatProvider.instance({
instanceType,
allowAllTraffic: false,
defaultAllowedTraffic: ec2.NatTrafficDirection.OUTBOUND_ONLY,
});
new ec2.Vpc(this, 'TheVPC', {
natGatewayProvider: provider,
Expand Down Expand Up @@ -1475,3 +1476,19 @@ const template = new ec2.LaunchTemplate(this, 'LaunchTemplate', {
}),
});
```

## Detailed Monitoring

The following demonstrates how to enable [Detailed Monitoring](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch-new.html) for an EC2 instance. Keep in mind that Detailed Monitoring results in [additional charges](http://aws.amazon.com/cloudwatch/pricing/).

```ts
declare const vpc: ec2.Vpc;
declare const instanceType: ec2.InstanceType;

new ec2.Instance(this, 'Instance1', {
vpc,
instanceType,
machineImage: new ec2.AmazonLinuxImage(),
detailedMonitoring: true,
});
```
10 changes: 10 additions & 0 deletions packages/@aws-cdk/aws-ec2/lib/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,15 @@ export interface InstanceProps {
* @default - false
*/
readonly requireImdsv2?: boolean;

/**
* Whether "Detailed Monitoring" is enabled for this instance
* Keep in mind that Detailed Monitoring results in extra charges
*
* @see http://aws.amazon.com/cloudwatch/pricing/
* @default - false
*/
readonly detailedMonitoring?: boolean;
}

/**
Expand Down Expand Up @@ -381,6 +390,7 @@ export class Instance extends Resource implements IInstance {
blockDeviceMappings: props.blockDevices !== undefined ? instanceBlockDeviceMappings(this, props.blockDevices) : undefined,
privateIpAddress: props.privateIpAddress,
propagateTagsToVolumeOnCreation: props.propagateTagsToVolumeOnCreation,
monitoring: props.detailedMonitoring,
});
this.instance.node.addDependency(this.role);

Expand Down
Loading

0 comments on commit 3434840

Please sign in to comment.