Skip to content

Commit

Permalink
Merge branch 'master' into cfn-include
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jan 20, 2022
2 parents a816c93 + 7babda8 commit 89bf1d9
Show file tree
Hide file tree
Showing 49 changed files with 158 additions and 6,166 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudwatch-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert-internal": "0.0.0",
"@aws-cdk/assertions": "0.0.0",
"@aws-cdk/aws-ec2": "0.0.0",
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/cdk-integ-tools": "0.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@aws-cdk/assert-internal/jest';
import { Template } from '@aws-cdk/assertions';
import * as appscaling from '@aws-cdk/aws-applicationautoscaling';
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
import { Stack } from '@aws-cdk/core';
Expand Down Expand Up @@ -27,7 +27,7 @@ test('can use topic as alarm action', () => {
alarm.addAlarmAction(new actions.ApplicationScalingAction(action));

// THEN
expect(stack).toHaveResource('AWS::CloudWatch::Alarm', {
Template.fromStack(stack).hasResourceProperties('AWS::CloudWatch::Alarm', {
AlarmActions: [
{ Ref: 'Action62AD07C0' },
],
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-cloudwatch-actions/test/ec2.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@aws-cdk/assert-internal/jest';
import { Template } from '@aws-cdk/assertions';
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
import { Stack } from '@aws-cdk/core';
import * as actions from '../lib';
Expand All @@ -22,7 +22,7 @@ test('can use instance reboot as alarm action', () => {
alarm.addAlarmAction(new actions.Ec2Action(actions.Ec2InstanceAction.REBOOT));

// THEN
expect(stack).toHaveResource('AWS::CloudWatch::Alarm', {
Template.fromStack(stack).hasResourceProperties('AWS::CloudWatch::Alarm', {
AlarmActions: [
{
'Fn::Join': [
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-cloudwatch-actions/test/scaling.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@aws-cdk/assert-internal/jest';
import { Template } from '@aws-cdk/assertions';
import * as autoscaling from '@aws-cdk/aws-autoscaling';
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
import * as ec2 from '@aws-cdk/aws-ec2';
Expand Down Expand Up @@ -29,7 +29,7 @@ test('can use topic as alarm action', () => {
alarm.addAlarmAction(new actions.AutoScalingAction(action));

// THEN
expect(stack).toHaveResource('AWS::CloudWatch::Alarm', {
Template.fromStack(stack).hasResourceProperties('AWS::CloudWatch::Alarm', {
AlarmActions: [
{ Ref: 'Action62AD07C0' },
],
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-cloudwatch-actions/test/sns.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@aws-cdk/assert-internal/jest';
import { Template } from '@aws-cdk/assertions';
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
import * as sns from '@aws-cdk/aws-sns';
import { Stack } from '@aws-cdk/core';
Expand All @@ -18,7 +18,7 @@ test('can use topic as alarm action', () => {
alarm.addAlarmAction(new actions.SnsAction(topic));

// THEN
expect(stack).toHaveResource('AWS::CloudWatch::Alarm', {
Template.fromStack(stack).hasResourceProperties('AWS::CloudWatch::Alarm', {
AlarmActions: [
{ Ref: 'TopicBFC7AF6E' },
],
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert-internal": "0.0.0",
"@aws-cdk/assertions": "0.0.0",
"@aws-cdk/aws-events-targets": "0.0.0",
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/cdk-integ-tools": "0.0.0",
Expand Down
14 changes: 7 additions & 7 deletions packages/@aws-cdk/aws-config/test/managed-rules.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@aws-cdk/assert-internal/jest';
import { Template } from '@aws-cdk/assertions';
import * as sns from '@aws-cdk/aws-sns';
import * as cdk from '@aws-cdk/core';
import * as config from '../lib';
Expand All @@ -12,7 +12,7 @@ describe('access keys', () => {
new config.AccessKeysRotated(stack, 'AccessKeys');

// THEN
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
Source: {
Owner: 'AWS',
SourceIdentifier: 'ACCESS_KEYS_ROTATED',
Expand All @@ -30,7 +30,7 @@ describe('access keys', () => {
});

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

// THEN
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
Source: {
Owner: 'AWS',
SourceIdentifier: 'CLOUDFORMATION_STACK_DRIFT_DETECTION_CHECK',
Expand All @@ -71,7 +71,7 @@ describe('cloudformation stack', () => {
},
});

expect(stack).toHaveResource('AWS::IAM::Role', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', {
AssumeRolePolicyDocument: {
Statement: [
{
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('cloudformation stack', () => {
});

// THEN
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
Source: {
Owner: 'AWS',
SourceIdentifier: 'CLOUDFORMATION_STACK_NOTIFICATION_CHECK',
Expand Down Expand Up @@ -157,7 +157,7 @@ describe('ec2 instance', () => {
});

// THEN
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
Source: {
Owner: 'AWS',
SourceIdentifier: config.ManagedRuleIdentifiers.EC2_INSTANCE_PROFILE_ATTACHED,
Expand Down
21 changes: 10 additions & 11 deletions packages/@aws-cdk/aws-config/test/rule.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '@aws-cdk/assert-internal/jest';
import { ResourcePart } from '@aws-cdk/assert-internal';
import { Template } from '@aws-cdk/assertions';
import * as targets from '@aws-cdk/aws-events-targets';
import * as lambda from '@aws-cdk/aws-lambda';
import * as cdk from '@aws-cdk/core';
Expand All @@ -22,7 +21,7 @@ describe('rule', () => {
});

// THEN
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
Source: {
Owner: 'AWS',
SourceIdentifier: 'AWS_SUPER_COOL',
Expand Down Expand Up @@ -59,7 +58,7 @@ describe('rule', () => {
});

// THEN
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
Template.fromStack(stack).hasResource('AWS::Config::ConfigRule', {
Properties: {
Source: {
Owner: 'CUSTOM_LAMBDA',
Expand Down Expand Up @@ -97,16 +96,16 @@ describe('rule', () => {
'Function76856677',
'FunctionServiceRole675BB04A',
],
}, ResourcePart.CompleteDefinition);
});

expect(stack).toHaveResource('AWS::Lambda::Permission', {
Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Permission', {
Principal: 'config.amazonaws.com',
SourceAccount: {
Ref: 'AWS::AccountId',
},
});

expect(stack).toHaveResource('AWS::IAM::Role', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', {
ManagedPolicyArns: [
{
'Fn::Join': [
Expand Down Expand Up @@ -147,7 +146,7 @@ describe('rule', () => {
});

// THEN
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
Scope: {
ComplianceResourceId: 'i-1234',
ComplianceResourceTypes: [
Expand All @@ -168,7 +167,7 @@ describe('rule', () => {
});

// THEN
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
Scope: {
ComplianceResourceTypes: [
'AWS::S3::Bucket',
Expand All @@ -189,7 +188,7 @@ describe('rule', () => {
});

// THEN
expect(stack).toHaveResource('AWS::Config::ConfigRule', {
Template.fromStack(stack).hasResourceProperties('AWS::Config::ConfigRule', {
Scope: {
TagKey: 'key',
TagValue: 'value',
Expand Down Expand Up @@ -247,7 +246,7 @@ describe('rule', () => {
target: new targets.LambdaFunction(fn),
});

expect(stack).toHaveResource('AWS::Events::Rule', {
Template.fromStack(stack).hasResourceProperties('AWS::Events::Rule', {
EventPattern: {
'source': [
'aws.config',
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-docdb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert-internal": "0.0.0",
"@aws-cdk/assertions": "0.0.0",
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/cdk-integ-tools": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
Expand Down
Loading

0 comments on commit 89bf1d9

Please sign in to comment.