Skip to content

Commit c552abb

Browse files
authored
Merge branch 'master' into conroy/cpl
2 parents c5669b0 + e913187 commit c552abb

53 files changed

Lines changed: 203 additions & 6195 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/@aws-cdk/aws-cloudwatch-actions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
},
6565
"license": "Apache-2.0",
6666
"devDependencies": {
67-
"@aws-cdk/assert-internal": "0.0.0",
67+
"@aws-cdk/assertions": "0.0.0",
6868
"@aws-cdk/aws-ec2": "0.0.0",
6969
"@aws-cdk/cdk-build-tools": "0.0.0",
7070
"@aws-cdk/cdk-integ-tools": "0.0.0",

packages/@aws-cdk/aws-cloudwatch-actions/test/appscaling.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@aws-cdk/assert-internal/jest';
1+
import { Template } from '@aws-cdk/assertions';
22
import * as appscaling from '@aws-cdk/aws-applicationautoscaling';
33
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
44
import { Stack } from '@aws-cdk/core';
@@ -27,7 +27,7 @@ test('can use topic as alarm action', () => {
2727
alarm.addAlarmAction(new actions.ApplicationScalingAction(action));
2828

2929
// THEN
30-
expect(stack).toHaveResource('AWS::CloudWatch::Alarm', {
30+
Template.fromStack(stack).hasResourceProperties('AWS::CloudWatch::Alarm', {
3131
AlarmActions: [
3232
{ Ref: 'Action62AD07C0' },
3333
],

packages/@aws-cdk/aws-cloudwatch-actions/test/ec2.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@aws-cdk/assert-internal/jest';
1+
import { Template } from '@aws-cdk/assertions';
22
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
33
import { Stack } from '@aws-cdk/core';
44
import * as actions from '../lib';
@@ -22,7 +22,7 @@ test('can use instance reboot as alarm action', () => {
2222
alarm.addAlarmAction(new actions.Ec2Action(actions.Ec2InstanceAction.REBOOT));
2323

2424
// THEN
25-
expect(stack).toHaveResource('AWS::CloudWatch::Alarm', {
25+
Template.fromStack(stack).hasResourceProperties('AWS::CloudWatch::Alarm', {
2626
AlarmActions: [
2727
{
2828
'Fn::Join': [

packages/@aws-cdk/aws-cloudwatch-actions/test/scaling.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@aws-cdk/assert-internal/jest';
1+
import { Template } from '@aws-cdk/assertions';
22
import * as autoscaling from '@aws-cdk/aws-autoscaling';
33
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
44
import * as ec2 from '@aws-cdk/aws-ec2';
@@ -29,7 +29,7 @@ test('can use topic as alarm action', () => {
2929
alarm.addAlarmAction(new actions.AutoScalingAction(action));
3030

3131
// THEN
32-
expect(stack).toHaveResource('AWS::CloudWatch::Alarm', {
32+
Template.fromStack(stack).hasResourceProperties('AWS::CloudWatch::Alarm', {
3333
AlarmActions: [
3434
{ Ref: 'Action62AD07C0' },
3535
],

packages/@aws-cdk/aws-cloudwatch-actions/test/sns.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@aws-cdk/assert-internal/jest';
1+
import { Template } from '@aws-cdk/assertions';
22
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
33
import * as sns from '@aws-cdk/aws-sns';
44
import { Stack } from '@aws-cdk/core';
@@ -18,7 +18,7 @@ test('can use topic as alarm action', () => {
1818
alarm.addAlarmAction(new actions.SnsAction(topic));
1919

2020
// THEN
21-
expect(stack).toHaveResource('AWS::CloudWatch::Alarm', {
21+
Template.fromStack(stack).hasResourceProperties('AWS::CloudWatch::Alarm', {
2222
AlarmActions: [
2323
{ Ref: 'TopicBFC7AF6E' },
2424
],

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
},
8080
"license": "Apache-2.0",
8181
"devDependencies": {
82-
"@aws-cdk/assert-internal": "0.0.0",
82+
"@aws-cdk/assertions": "0.0.0",
8383
"@aws-cdk/aws-events-targets": "0.0.0",
8484
"@aws-cdk/cdk-build-tools": "0.0.0",
8585
"@aws-cdk/cdk-integ-tools": "0.0.0",

packages/@aws-cdk/aws-config/test/managed-rules.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@aws-cdk/assert-internal/jest';
1+
import { Template } from '@aws-cdk/assertions';
22
import * as sns from '@aws-cdk/aws-sns';
33
import * as cdk from '@aws-cdk/core';
44
import * as config from '../lib';
@@ -12,7 +12,7 @@ describe('access keys', () => {
1212
new config.AccessKeysRotated(stack, 'AccessKeys');
1313

1414
// THEN
15-
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
15+
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
1616
Source: {
1717
Owner: 'AWS',
1818
SourceIdentifier: 'ACCESS_KEYS_ROTATED',
@@ -30,7 +30,7 @@ describe('access keys', () => {
3030
});
3131

3232
// THEN
33-
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
33+
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
3434
Source: {
3535
Owner: 'AWS',
3636
SourceIdentifier: 'ACCESS_KEYS_ROTATED',
@@ -51,7 +51,7 @@ describe('cloudformation stack', () => {
5151
new config.CloudFormationStackDriftDetectionCheck(stack, 'Drift');
5252

5353
// THEN
54-
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
54+
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
5555
Source: {
5656
Owner: 'AWS',
5757
SourceIdentifier: 'CLOUDFORMATION_STACK_DRIFT_DETECTION_CHECK',
@@ -71,7 +71,7 @@ describe('cloudformation stack', () => {
7171
},
7272
});
7373

74-
expect(stack).toHaveResource('AWS::IAM::Role', {
74+
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', {
7575
AssumeRolePolicyDocument: {
7676
Statement: [
7777
{
@@ -113,7 +113,7 @@ describe('cloudformation stack', () => {
113113
});
114114

115115
// THEN
116-
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
116+
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
117117
Source: {
118118
Owner: 'AWS',
119119
SourceIdentifier: 'CLOUDFORMATION_STACK_NOTIFICATION_CHECK',
@@ -157,7 +157,7 @@ describe('ec2 instance', () => {
157157
});
158158

159159
// THEN
160-
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
160+
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
161161
Source: {
162162
Owner: 'AWS',
163163
SourceIdentifier: config.ManagedRuleIdentifiers.EC2_INSTANCE_PROFILE_ATTACHED,

packages/@aws-cdk/aws-config/test/rule.test.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import '@aws-cdk/assert-internal/jest';
2-
import { ResourcePart } from '@aws-cdk/assert-internal';
1+
import { Template } from '@aws-cdk/assertions';
32
import * as targets from '@aws-cdk/aws-events-targets';
43
import * as lambda from '@aws-cdk/aws-lambda';
54
import * as cdk from '@aws-cdk/core';
@@ -22,7 +21,7 @@ describe('rule', () => {
2221
});
2322

2423
// THEN
25-
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
24+
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
2625
Source: {
2726
Owner: 'AWS',
2827
SourceIdentifier: 'AWS_SUPER_COOL',
@@ -59,7 +58,7 @@ describe('rule', () => {
5958
});
6059

6160
// THEN
62-
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
61+
Template.fromStack(stack).hasResource('AWS::Config::ConfigRule', {
6362
Properties: {
6463
Source: {
6564
Owner: 'CUSTOM_LAMBDA',
@@ -97,16 +96,16 @@ describe('rule', () => {
9796
'Function76856677',
9897
'FunctionServiceRole675BB04A',
9998
],
100-
}, ResourcePart.CompleteDefinition);
99+
});
101100

102-
expect(stack).toHaveResource('AWS::Lambda::Permission', {
101+
Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Permission', {
103102
Principal: 'config.amazonaws.com',
104103
SourceAccount: {
105104
Ref: 'AWS::AccountId',
106105
},
107106
});
108107

109-
expect(stack).toHaveResource('AWS::IAM::Role', {
108+
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', {
110109
ManagedPolicyArns: [
111110
{
112111
'Fn::Join': [
@@ -147,7 +146,7 @@ describe('rule', () => {
147146
});
148147

149148
// THEN
150-
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
149+
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
151150
Scope: {
152151
ComplianceResourceId: 'i-1234',
153152
ComplianceResourceTypes: [
@@ -168,7 +167,7 @@ describe('rule', () => {
168167
});
169168

170169
// THEN
171-
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
170+
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
172171
Scope: {
173172
ComplianceResourceTypes: [
174173
'AWS::S3::Bucket',
@@ -189,7 +188,7 @@ describe('rule', () => {
189188
});
190189

191190
// THEN
192-
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
191+
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
193192
Scope: {
194193
TagKey: 'key',
195194
TagValue: 'value',
@@ -247,7 +246,7 @@ describe('rule', () => {
247246
target: new targets.LambdaFunction(fn),
248247
});
249248

250-
expect(stack).toHaveResource('AWS::Events::Rule', {
249+
Template.fromStack(stack).hasResourceProperties('AWS::Events::Rule', {
251250
EventPattern: {
252251
'source': [
253252
'aws.config',

packages/@aws-cdk/aws-globalaccelerator-endpoints/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
"license": "Apache-2.0",
7171
"devDependencies": {
72-
"@aws-cdk/assert-internal": "0.0.0",
72+
"@aws-cdk/assertions": "0.0.0",
7373
"@aws-cdk/cdk-build-tools": "0.0.0",
7474
"@aws-cdk/cdk-integ-tools": "0.0.0",
7575
"@aws-cdk/pkglint": "0.0.0",

packages/@aws-cdk/aws-globalaccelerator-endpoints/test/endpoints.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@aws-cdk/assert-internal/jest';
1+
import { Template } from '@aws-cdk/assertions';
22
import * as ec2 from '@aws-cdk/aws-ec2';
33
import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2';
44
import * as ga from '@aws-cdk/aws-globalaccelerator';
@@ -32,7 +32,7 @@ test('Application Load Balancer with all properties', () => {
3232
});
3333

3434
// THEN
35-
expect(stack).toHaveResourceLike('AWS::GlobalAccelerator::EndpointGroup', {
35+
Template.fromStack(stack).hasResourceProperties('AWS::GlobalAccelerator::EndpointGroup', {
3636
EndpointConfigurations: [
3737
{
3838
EndpointId: { Ref: 'ALBAEE750D2' },
@@ -57,7 +57,7 @@ test('Get region from imported ALB', () => {
5757
});
5858

5959
// THEN
60-
expect(stack).toHaveResourceLike('AWS::GlobalAccelerator::EndpointGroup', {
60+
Template.fromStack(stack).hasResourceProperties('AWS::GlobalAccelerator::EndpointGroup', {
6161
EndpointGroupRegion: 'us-west-2',
6262
EndpointConfigurations: [
6363
{
@@ -79,7 +79,7 @@ test('Network Load Balancer with all properties', () => {
7979
});
8080

8181
// THEN
82-
expect(stack).toHaveResourceLike('AWS::GlobalAccelerator::EndpointGroup', {
82+
Template.fromStack(stack).hasResourceProperties('AWS::GlobalAccelerator::EndpointGroup', {
8383
EndpointConfigurations: [
8484
{
8585
EndpointId: { Ref: 'NLB55158F82' },
@@ -102,7 +102,7 @@ test('Get region from imported NLB', () => {
102102
});
103103

104104
// THEN
105-
expect(stack).toHaveResourceLike('AWS::GlobalAccelerator::EndpointGroup', {
105+
Template.fromStack(stack).hasResourceProperties('AWS::GlobalAccelerator::EndpointGroup', {
106106
EndpointGroupRegion: 'us-west-2',
107107
EndpointConfigurations: [
108108
{
@@ -124,7 +124,7 @@ test('CFN EIP with all properties', () => {
124124
});
125125

126126
// THEN
127-
expect(stack).toHaveResourceLike('AWS::GlobalAccelerator::EndpointGroup', {
127+
Template.fromStack(stack).hasResourceProperties('AWS::GlobalAccelerator::EndpointGroup', {
128128
EndpointConfigurations: [
129129
{
130130
EndpointId: { 'Fn::GetAtt': ['ElasticIpAddress', 'AllocationId'] },
@@ -151,7 +151,7 @@ test('EC2 Instance with all properties', () => {
151151
});
152152

153153
// THEN
154-
expect(stack).toHaveResourceLike('AWS::GlobalAccelerator::EndpointGroup', {
154+
Template.fromStack(stack).hasResourceProperties('AWS::GlobalAccelerator::EndpointGroup', {
155155
EndpointConfigurations: [
156156
{
157157
EndpointId: { Ref: 'InstanceC1063A87' },

0 commit comments

Comments
 (0)