Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-stepfunctions-tasks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert-internal": "0.0.0",
"@aws-cdk/assertions": "0.0.0",
"@aws-cdk/aws-apigatewayv2": "0.0.0",
"@aws-cdk/aws-apigatewayv2-integrations": "0.0.0",
"@aws-cdk/aws-batch": "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 sfn from '@aws-cdk/aws-stepfunctions';
import * as cdk from '@aws-cdk/core';
import * as tasks from '../../lib';
Expand Down Expand Up @@ -48,7 +48,7 @@ test('CallAwsService task', () => {
},
});

expect(stack).toHaveResource('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
Expand Down Expand Up @@ -94,7 +94,7 @@ test('with custom IAM action', () => {
Parameters: {},
});

expect(stack).toHaveResource('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
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 ec2 from '@aws-cdk/aws-ec2';
import * as ecs from '@aws-cdk/aws-ecs';
import * as sfn from '@aws-cdk/aws-stepfunctions';
Expand Down Expand Up @@ -116,7 +116,7 @@ test('Running a Fargate Task', () => {
Type: 'Task',
});

expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
Expand Down Expand Up @@ -223,7 +223,7 @@ test('Running an EC2 Task with bridge network', () => {
Type: 'Task',
});

expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
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 ec2 from '@aws-cdk/aws-ec2';
import * as ecs from '@aws-cdk/aws-ecs';
import * as sfn from '@aws-cdk/aws-stepfunctions';
Expand Down Expand Up @@ -196,7 +196,7 @@ test('Running a Fargate Task', () => {
Type: 'Task',
});

expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
Expand Down Expand Up @@ -318,7 +318,7 @@ test('Running an EC2 Task with bridge network', () => {
Type: 'Task',
});

expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
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 sfn from '@aws-cdk/aws-stepfunctions';
import * as cdk from '@aws-cdk/core';
import * as tasks from '../../lib';
Expand Down Expand Up @@ -305,7 +305,7 @@ test('task policies are generated', () => {
});

// THEN
expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [{
Action: [
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 sfn from '@aws-cdk/aws-stepfunctions';
import * as cdk from '@aws-cdk/core';
import * as tasks from '../../lib';
Expand Down Expand Up @@ -51,7 +51,7 @@ test('task policies are generated', () => {
});

// THEN
expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
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 iam from '@aws-cdk/aws-iam';
import * as sfn from '@aws-cdk/aws-stepfunctions';
import * as cdk from '@aws-cdk/core';
Expand Down Expand Up @@ -605,7 +605,7 @@ test('Create Cluster without Roles', () => {
},
});

expect(stack).toHaveResourceLike('AWS::IAM::Role', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', {
AssumeRolePolicyDocument: {
Version: '2012-10-17',
Statement: [
Expand All @@ -620,7 +620,7 @@ test('Create Cluster without Roles', () => {

// The stack renders the ec2.amazonaws.com Service principal id with a
// Join to the URLSuffix
expect(stack).toHaveResourceLike('AWS::IAM::Role', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', {
AssumeRolePolicyDocument: {
Version: '2012-10-17',
Statement: [
Expand All @@ -646,7 +646,7 @@ test('Create Cluster without Roles', () => {
},
});

expect(stack).toHaveResourceLike('AWS::IAM::Role', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', {
AssumeRolePolicyDocument: {
Version: '2012-10-17',
Statement: [
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 sfn from '@aws-cdk/aws-stepfunctions';
import * as cdk from '@aws-cdk/core';
import * as tasks from '../../lib';
Expand Down Expand Up @@ -59,7 +59,7 @@ test('task policies are generated', () => {
});

// THEN
expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
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 sfn from '@aws-cdk/aws-stepfunctions';
import * as cdk from '@aws-cdk/core';
import * as tasks from '../../lib';
Expand Down Expand Up @@ -95,7 +95,7 @@ test('task policies are generated', () => {
});

// THEN
expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
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 sfn from '@aws-cdk/aws-stepfunctions';
import * as cdk from '@aws-cdk/core';
import * as tasks from '../../lib';
Expand Down Expand Up @@ -51,7 +51,7 @@ test('task policies are generated', () => {
});

// THEN
expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
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 sfn from '@aws-cdk/aws-stepfunctions';
import * as cdk from '@aws-cdk/core';
import * as tasks from '../../lib';
Expand Down Expand Up @@ -50,7 +50,7 @@ test('task policies are generated', () => {
});

// THEN
expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
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 sfn from '@aws-cdk/aws-stepfunctions';
import { Stack } from '@aws-cdk/core';
import * as tasks from '../lib';
Expand All @@ -18,7 +18,7 @@ test('Eval with Node.js', () => {
});

// THEN
expect(stack).toHaveResource('AWS::StepFunctions::StateMachine', {
Template.fromStack(stack).hasResourceProperties('AWS::StepFunctions::StateMachine', {
DefinitionString: {
'Fn::Join': [
'',
Expand All @@ -33,7 +33,7 @@ test('Eval with Node.js', () => {
},
});

expect(stack).toHaveResource('AWS::Lambda::Function', {
Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', {
Runtime: 'nodejs14.x',
});
});
Expand All @@ -47,7 +47,7 @@ test('expression does not contain paths', () => {
definition: task,
});

expect(stack).toHaveResource('AWS::StepFunctions::StateMachine', {
Template.fromStack(stack).hasResourceProperties('AWS::StepFunctions::StateMachine', {
DefinitionString: {
'Fn::Join': [
'',
Expand All @@ -72,7 +72,7 @@ test('with dash and underscore in path', () => {
definition: task,
});

expect(stack).toHaveResource('AWS::StepFunctions::StateMachine', {
Template.fromStack(stack).hasResourceProperties('AWS::StepFunctions::StateMachine', {
DefinitionString: {
'Fn::Join': [
'',
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 events from '@aws-cdk/aws-events';
import * as sfn from '@aws-cdk/aws-stepfunctions';
import * as cdk from '@aws-cdk/core';
Expand Down Expand Up @@ -238,7 +238,7 @@ describe('Put Events', () => {
new sfn.StateMachine(stack, 'State Machine', { definition: task });

// THEN
expect(stack).toHaveResource('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@aws-cdk/assert-internal/jest';
import { Match, Template } from '@aws-cdk/assertions';
import * as sfn from '@aws-cdk/aws-stepfunctions';
import { Duration, Stack } from '@aws-cdk/core';
import * as tasks from '../../lib';
Expand Down Expand Up @@ -97,11 +97,11 @@ test('permitted role actions limited to start job run if service integration pat
definition: task,
});

expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [{
Statement: [Match.objectLike({
Action: 'glue:StartJobRun',
}],
})],
},
});
});
Expand All @@ -116,16 +116,16 @@ test('permitted role actions include start, get, and stop job run if service int
definition: task,
});

expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [{
Statement: [Match.objectLike({
Action: [
'glue:StartJobRun',
'glue:GetJobRun',
'glue:GetJobRuns',
'glue:BatchStopJobRun',
],
}],
})],
},
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@aws-cdk/assert-internal/jest';
import { Match, Template } from '@aws-cdk/assertions';
import * as sfn from '@aws-cdk/aws-stepfunctions';
import { Duration, Stack } from '@aws-cdk/core';
import * as tasks from '../../lib';
Expand Down Expand Up @@ -129,11 +129,11 @@ test('permitted role actions limited to start job run if service integration pat
definition: task,
});

expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [{
Statement: [Match.objectLike({
Action: 'glue:StartJobRun',
}],
})],
},
});
});
Expand All @@ -148,16 +148,16 @@ test('permitted role actions include start, get, and stop job run if service int
definition: task,
});

expect(stack).toHaveResourceLike('AWS::IAM::Policy', {
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [{
Statement: [Match.objectLike({
Action: [
'glue:StartJobRun',
'glue:GetJobRun',
'glue:GetJobRuns',
'glue:BatchStopJobRun',
],
}],
})],
},
});
});
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 sfn from '@aws-cdk/aws-stepfunctions';
import { Stack } from '@aws-cdk/core';
import * as tasks from '../lib';
Expand All @@ -15,7 +15,7 @@ test('Activity can be used in a Task', () => {
});

// THEN
expect(stack).toHaveResource('AWS::StepFunctions::StateMachine', {
Template.fromStack(stack).hasResourceProperties('AWS::StepFunctions::StateMachine', {
DefinitionString: {
'Fn::Join': ['', [
'{"StartAt":"Task","States":{"Task":{"End":true,"Type":"Task","Resource":"',
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 lambda from '@aws-cdk/aws-lambda';
import * as sfn from '@aws-cdk/aws-stepfunctions';
import { Stack } from '@aws-cdk/core';
Expand All @@ -23,7 +23,7 @@ test('Invoke lambda with function ARN', () => {
});

// THEN
expect(stack).toHaveResource('AWS::StepFunctions::StateMachine', {
Template.fromStack(stack).hasResourceProperties('AWS::StepFunctions::StateMachine', {
DefinitionString: {
'Fn::Join': ['', [
'{"StartAt":"Task","States":{"Task":{"End":true,"Type":"Task","Resource":"',
Expand All @@ -45,7 +45,7 @@ test('Lambda function payload ends up in Parameters', () => {
}),
});

expect(stack).toHaveResource('AWS::StepFunctions::StateMachine', {
Template.fromStack(stack).hasResourceProperties('AWS::StepFunctions::StateMachine', {
DefinitionString: {
'Fn::Join': ['', [
'{"StartAt":"Task","States":{"Task":{"End":true,"Parameters":{"foo.$":"$.bar"},"Type":"Task","Resource":"',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@aws-cdk/assert-internal/jest';
import * as lambda from '@aws-cdk/aws-lambda';
import * as sfn from '@aws-cdk/aws-stepfunctions';
import { Stack } from '@aws-cdk/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@aws-cdk/assert-internal/jest';
import * as lambda from '@aws-cdk/aws-lambda';
import * as sfn from '@aws-cdk/aws-stepfunctions';
import { Stack } from '@aws-cdk/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@aws-cdk/assert-internal/jest';
import * as ec2 from '@aws-cdk/aws-ec2';
import * as kms from '@aws-cdk/aws-kms';
import * as sfn from '@aws-cdk/aws-stepfunctions';
Expand Down
Loading