konokenj.cdk-api-mcp-server 0.52.0__py3-none-any.whl → 0.54.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cdk_api_mcp_server/__about__.py +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-eks-v2-alpha/README.md +45 -45
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-imagebuilder-alpha/README.md +94 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-lambda-go-alpha/README.md +102 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-sagemaker-alpha/README.md +32 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/mixins-preview/README.md +151 -5
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/README.md/README.md +2 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/README.md +25 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/integ.lambda-permission-consolidation.ts +55 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/README.md +35 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.lambda-permission-consolidation.ts +45 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codebuild/README.md +0 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/README.md +26 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.dynamodb.add-to-resource-policy.ts +17 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.placement-strategies.ts +32 -8
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/README.md +86 -86
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.eks-al2023-nodegroup.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.fargate-cluster.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.runtime.inlinecode.ts +7 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/README.md +65 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-big-response.ts +13 -6
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-cloudfront.ts +20 -18
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-cross-nested-stack-source.ts +7 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-cross-stack-source.ts +6 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-cross-stack-ssm-source.ts +7 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-data.ts +83 -62
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-deployed-bucket.ts +10 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-large-file.ts +20 -12
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-loggroup.ts +7 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-security-groups-efs.ts +77 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-security-groups-empty.ts +69 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-security-groups-multiple.ts +89 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-security-groups-single.ts +77 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-signcontent.ts +11 -7
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-substitution-with-destination-key.ts +15 -8
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-substitution-with-role.ts +29 -14
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-substitution.ts +16 -8
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-vpc-basic.ts +65 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-vpc-config.ts +66 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-vpc-custom-subnets.ts +66 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-vpc-efs.ts +66 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-vpc-security-groups.ts +72 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-vpc-subnet-selection.ts +70 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment.ts +47 -69
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-secretsmanager/integ.secret.dynamic-reference-key.ts +38 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions/integ.sm-jsonpath-with-distributed-map-jsonata.ts +105 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/README.md +14 -3
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.evaluate-expression-arm64.ts +27 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.evaluate-expression-default.ts +25 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.evaluate-expression-mixed-arch.ts +35 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.evaluate-expression-x86.ts +27 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +2 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/interfaces/README.md +33 -0
- {konokenj_cdk_api_mcp_server-0.52.0.dist-info → konokenj_cdk_api_mcp_server-0.54.0.dist-info}/METADATA +2 -2
- {konokenj_cdk_api_mcp_server-0.52.0.dist-info → konokenj_cdk_api_mcp_server-0.54.0.dist-info}/RECORD +58 -38
- {konokenj_cdk_api_mcp_server-0.52.0.dist-info → konokenj_cdk_api_mcp_server-0.54.0.dist-info}/WHEEL +0 -0
- {konokenj_cdk_api_mcp_server-0.52.0.dist-info → konokenj_cdk_api_mcp_server-0.54.0.dist-info}/entry_points.txt +0 -0
- {konokenj_cdk_api_mcp_server-0.52.0.dist-info → konokenj_cdk_api_mcp_server-0.54.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
3
|
+
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
4
|
+
import * as cdk from 'aws-cdk-lib';
|
|
5
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
6
|
+
import { Construct } from 'constructs';
|
|
7
|
+
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Integration test for bucket deployment with VPC and EFS storage:
|
|
11
|
+
* - Lambda function runs in VPC with EFS filesystem mounted
|
|
12
|
+
* - Tests useEfs flag for large file deployments requiring persistent storage
|
|
13
|
+
*/
|
|
14
|
+
class TestBucketDeploymentVpcEfs extends cdk.Stack {
|
|
15
|
+
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
|
|
16
|
+
super(scope, id, props);
|
|
17
|
+
|
|
18
|
+
// VPC with EFS storage enabled
|
|
19
|
+
// Use isolated subnets with S3 VPC endpoint - no NAT Gateway or Elastic IP needed
|
|
20
|
+
const vpc = new ec2.Vpc(this, 'EfsVpc', {
|
|
21
|
+
restrictDefaultSecurityGroup: false,
|
|
22
|
+
natGateways: 0,
|
|
23
|
+
subnetConfiguration: [
|
|
24
|
+
{
|
|
25
|
+
cidrMask: 24,
|
|
26
|
+
name: 'Isolated',
|
|
27
|
+
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Add S3 Gateway endpoint so Lambda can access S3 without NAT Gateway
|
|
33
|
+
vpc.addGatewayEndpoint('S3Endpoint', {
|
|
34
|
+
service: ec2.GatewayVpcEndpointAwsService.S3,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const bucket = new s3.Bucket(this, 'Destination', {
|
|
38
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
39
|
+
autoDeleteObjects: true,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
new s3deploy.BucketDeployment(this, 'DeployWithEfsVpc', {
|
|
43
|
+
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website'))],
|
|
44
|
+
destinationBucket: bucket,
|
|
45
|
+
destinationKeyPrefix: 'efs-vpc/',
|
|
46
|
+
vpc: vpc,
|
|
47
|
+
useEfs: true,
|
|
48
|
+
retainOnDelete: false,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const app = new cdk.App({
|
|
54
|
+
postCliContext: {
|
|
55
|
+
'@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const testCase = new TestBucketDeploymentVpcEfs(app, 'test-bucket-deployment-vpc-efs');
|
|
60
|
+
|
|
61
|
+
new integ.IntegTest(app, 'integ-test-bucket-deployment-vpc-efs', {
|
|
62
|
+
testCases: [testCase],
|
|
63
|
+
diffAssets: false,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
app.synth();
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
3
|
+
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
4
|
+
import * as cdk from 'aws-cdk-lib';
|
|
5
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
6
|
+
import { Construct } from 'constructs';
|
|
7
|
+
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Integration test for bucket deployment with VPC and custom security groups:
|
|
11
|
+
* - Lambda function runs in VPC with custom security group
|
|
12
|
+
* - Security group allows all outbound traffic for S3 access
|
|
13
|
+
*/
|
|
14
|
+
class TestBucketDeploymentVpcSecurityGroups extends cdk.Stack {
|
|
15
|
+
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
|
|
16
|
+
super(scope, id, props);
|
|
17
|
+
|
|
18
|
+
// VPC with specific security groups
|
|
19
|
+
// Use isolated subnets with S3 VPC endpoint - no NAT Gateway or Elastic IP needed
|
|
20
|
+
const vpc = new ec2.Vpc(this, 'SgVpc', {
|
|
21
|
+
restrictDefaultSecurityGroup: false,
|
|
22
|
+
natGateways: 0,
|
|
23
|
+
subnetConfiguration: [
|
|
24
|
+
{
|
|
25
|
+
cidrMask: 24,
|
|
26
|
+
name: 'Isolated',
|
|
27
|
+
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Add S3 Gateway endpoint so Lambda can access S3 without NAT Gateway
|
|
33
|
+
vpc.addGatewayEndpoint('S3Endpoint', {
|
|
34
|
+
service: ec2.GatewayVpcEndpointAwsService.S3,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const securityGroup = new ec2.SecurityGroup(this, 'CustomSecurityGroup', {
|
|
38
|
+
vpc: vpc,
|
|
39
|
+
description: 'Custom security group for bucket deployment',
|
|
40
|
+
allowAllOutbound: true,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const bucket = new s3.Bucket(this, 'Destination', {
|
|
44
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
45
|
+
autoDeleteObjects: true,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
new s3deploy.BucketDeployment(this, 'DeployWithVpcAndSecurityGroup', {
|
|
49
|
+
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website'))],
|
|
50
|
+
destinationBucket: bucket,
|
|
51
|
+
destinationKeyPrefix: 'sg-vpc/',
|
|
52
|
+
vpc: vpc,
|
|
53
|
+
securityGroups: [securityGroup],
|
|
54
|
+
retainOnDelete: false,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const app = new cdk.App({
|
|
60
|
+
postCliContext: {
|
|
61
|
+
'@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const testCase = new TestBucketDeploymentVpcSecurityGroups(app, 'test-bucket-deployment-vpc-security-groups');
|
|
66
|
+
|
|
67
|
+
new integ.IntegTest(app, 'integ-test-bucket-deployment-vpc-security-groups', {
|
|
68
|
+
testCases: [testCase],
|
|
69
|
+
diffAssets: false,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
app.synth();
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
3
|
+
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
4
|
+
import * as cdk from 'aws-cdk-lib';
|
|
5
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
6
|
+
import { Construct } from 'constructs';
|
|
7
|
+
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Integration test for bucket deployment with VPC and explicit subnet selection:
|
|
11
|
+
* - Lambda function runs in VPC with explicit subnet type selection
|
|
12
|
+
* - Tests vpcSubnets property for controlling which subnets Lambda uses
|
|
13
|
+
*/
|
|
14
|
+
class TestBucketDeploymentVpcSubnetSelection extends cdk.Stack {
|
|
15
|
+
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
|
|
16
|
+
super(scope, id, props);
|
|
17
|
+
|
|
18
|
+
// VPC with specific subnets
|
|
19
|
+
// Use isolated subnets with S3 VPC endpoint - no NAT Gateway or Elastic IP needed
|
|
20
|
+
// Use a different CIDR to avoid conflicts with existing stacks
|
|
21
|
+
const vpc = new ec2.Vpc(this, 'SubnetVpc', {
|
|
22
|
+
restrictDefaultSecurityGroup: false,
|
|
23
|
+
natGateways: 0,
|
|
24
|
+
ipAddresses: ec2.IpAddresses.cidr('10.1.0.0/16'),
|
|
25
|
+
subnetConfiguration: [
|
|
26
|
+
{
|
|
27
|
+
cidrMask: 24,
|
|
28
|
+
name: 'Isolated',
|
|
29
|
+
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Add S3 Gateway endpoint so Lambda can access S3 without NAT Gateway
|
|
35
|
+
vpc.addGatewayEndpoint('S3Endpoint', {
|
|
36
|
+
service: ec2.GatewayVpcEndpointAwsService.S3,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const bucket = new s3.Bucket(this, 'Destination', {
|
|
40
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
41
|
+
autoDeleteObjects: true,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
new s3deploy.BucketDeployment(this, 'DeployWithVpcAndSubnets', {
|
|
45
|
+
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website'))],
|
|
46
|
+
destinationBucket: bucket,
|
|
47
|
+
destinationKeyPrefix: 'subnet-vpc/',
|
|
48
|
+
vpc: vpc,
|
|
49
|
+
vpcSubnets: {
|
|
50
|
+
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
|
|
51
|
+
},
|
|
52
|
+
retainOnDelete: false,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const app = new cdk.App({
|
|
58
|
+
postCliContext: {
|
|
59
|
+
'@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const testCase = new TestBucketDeploymentVpcSubnetSelection(app, 'test-bucket-deployment-vpc-subnet-selection');
|
|
64
|
+
|
|
65
|
+
new integ.IntegTest(app, 'integ-test-bucket-deployment-vpc-subnet-selection', {
|
|
66
|
+
testCases: [testCase],
|
|
67
|
+
diffAssets: false,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
app.synth();
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
|
-
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
3
2
|
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
4
3
|
import * as cdk from 'aws-cdk-lib';
|
|
5
4
|
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
@@ -7,115 +6,93 @@ import { Match } from '@aws-cdk/integ-tests-alpha';
|
|
|
7
6
|
import { Construct } from 'constructs';
|
|
8
7
|
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment';
|
|
9
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Integration test for core bucket deployment features:
|
|
11
|
+
* - Basic deployment functionality
|
|
12
|
+
* - Prune behavior (deleting files not in source)
|
|
13
|
+
* - Exclude filters
|
|
14
|
+
* - Extract behavior (extracting vs keeping zip files)
|
|
15
|
+
* - addSource() method for dynamically adding sources
|
|
16
|
+
* - objectKeys output property and outputObjectKeys flag
|
|
17
|
+
*/
|
|
10
18
|
class TestBucketDeployment extends cdk.Stack {
|
|
11
|
-
public readonly
|
|
19
|
+
public readonly bucketWithAddSource: s3.IBucket;
|
|
12
20
|
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
|
|
13
21
|
super(scope, id, props);
|
|
14
22
|
|
|
15
|
-
const
|
|
16
|
-
websiteIndexDocument: 'index.html',
|
|
17
|
-
publicReadAccess: false,
|
|
23
|
+
const commonBucketProps = {
|
|
18
24
|
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
19
25
|
autoDeleteObjects: true, // needed for integration test cleanup
|
|
20
|
-
}
|
|
26
|
+
};
|
|
21
27
|
|
|
22
|
-
new
|
|
23
|
-
|
|
24
|
-
destinationBucket,
|
|
25
|
-
retainOnDelete: false, // default is true, which will block the integration test cleanup
|
|
28
|
+
const destinationBucket = new s3.Bucket(this, 'Destination', {
|
|
29
|
+
...commonBucketProps,
|
|
26
30
|
});
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
// Test basic deployment functionality
|
|
33
|
+
new s3deploy.BucketDeployment(this, 'DeployWithBasic', {
|
|
29
34
|
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website'))],
|
|
30
35
|
destinationBucket,
|
|
31
|
-
|
|
32
|
-
useEfs: true,
|
|
33
|
-
vpc: new ec2.Vpc(this, 'InlineVpc', { restrictDefaultSecurityGroup: false }),
|
|
34
|
-
retainOnDelete: false, // default is true, which will block the integration test cleanup
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
const bucket2 = new s3.Bucket(this, 'Destination2', {
|
|
38
|
-
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
39
|
-
autoDeleteObjects: true, // needed for integration test cleanup
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
new s3deploy.BucketDeployment(this, 'DeployWithPrefix', {
|
|
43
|
-
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website'))],
|
|
44
|
-
destinationBucket: bucket2,
|
|
45
|
-
destinationKeyPrefix: 'deploy/here/',
|
|
46
|
-
retainOnDelete: false, // default is true, which will block the integration test cleanup
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const bucket3 = new s3.Bucket(this, 'Destination3', {
|
|
50
|
-
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
51
|
-
autoDeleteObjects: true, // needed for integration test cleanup
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
new s3deploy.BucketDeployment(this, 'DeployWithMetadata', {
|
|
55
|
-
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website'))],
|
|
56
|
-
destinationBucket: bucket3,
|
|
57
|
-
retainOnDelete: false, // default is true, which will block the integration test cleanup
|
|
58
|
-
cacheControl: [s3deploy.CacheControl.setPublic(), s3deploy.CacheControl.maxAge(cdk.Duration.minutes(1))],
|
|
59
|
-
contentType: 'text/html',
|
|
60
|
-
metadata: { A: 'aaa', B: 'bbb', C: 'ccc' },
|
|
36
|
+
retainOnDelete: false,
|
|
61
37
|
});
|
|
62
38
|
|
|
63
|
-
|
|
39
|
+
// Test that files not in source are preserved when prune is disabled
|
|
40
|
+
new s3deploy.BucketDeployment(this, 'DeployWithPruneDisabled', {
|
|
64
41
|
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website'))],
|
|
65
42
|
destinationBucket,
|
|
66
43
|
prune: false,
|
|
67
44
|
retainOnDelete: false,
|
|
68
45
|
});
|
|
69
46
|
|
|
70
|
-
|
|
47
|
+
// Test exclude filters to skip certain files from deployment
|
|
48
|
+
new s3deploy.BucketDeployment(this, 'DeployWithExclude', {
|
|
71
49
|
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website'))],
|
|
72
50
|
destinationBucket,
|
|
73
51
|
exclude: ['*.gif'],
|
|
74
52
|
retainOnDelete: false,
|
|
75
53
|
});
|
|
76
54
|
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
80
|
-
autoDeleteObjects: true, // needed for integration test cleanup
|
|
55
|
+
const bucketWithoutExtract = new s3.Bucket(this, 'BucketWithoutExtract', {
|
|
56
|
+
...commonBucketProps,
|
|
81
57
|
});
|
|
82
58
|
|
|
83
|
-
|
|
59
|
+
// Test that zip files are uploaded as-is when extract is disabled
|
|
60
|
+
new s3deploy.BucketDeployment(this, 'DeployWithoutExtract', {
|
|
84
61
|
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website'))],
|
|
85
|
-
destinationBucket:
|
|
62
|
+
destinationBucket: bucketWithoutExtract,
|
|
86
63
|
extract: false,
|
|
87
64
|
retainOnDelete: false,
|
|
88
65
|
});
|
|
89
66
|
|
|
90
|
-
this.
|
|
91
|
-
|
|
92
|
-
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
93
|
-
autoDeleteObjects: true, // needed for integration test cleanup
|
|
67
|
+
this.bucketWithAddSource = new s3.Bucket(this, 'BucketWithAddSource', {
|
|
68
|
+
...commonBucketProps,
|
|
94
69
|
});
|
|
95
70
|
|
|
96
|
-
|
|
71
|
+
// Test addSource() method for dynamically adding sources after construction
|
|
72
|
+
// and validate objectKeys output property returns both asset files and added sources
|
|
73
|
+
const deployWithAddSource = new s3deploy.BucketDeployment(this, 'DeployWithAddSource', {
|
|
97
74
|
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website-second'))],
|
|
98
|
-
destinationBucket: this.
|
|
99
|
-
retainOnDelete: false,
|
|
75
|
+
destinationBucket: this.bucketWithAddSource,
|
|
76
|
+
retainOnDelete: false,
|
|
100
77
|
});
|
|
101
|
-
|
|
78
|
+
deployWithAddSource.addSource(s3deploy.Source.data('some-key', 'helloworld'));
|
|
102
79
|
|
|
80
|
+
// Output objectKeys to validate they are returned in CloudFormation outputs
|
|
103
81
|
new cdk.CfnOutput(this, 'customResourceData', {
|
|
104
82
|
value: cdk.Fn.sub('Object Keys are ${keys}', {
|
|
105
|
-
keys: cdk.Fn.join(',',
|
|
83
|
+
keys: cdk.Fn.join(',', deployWithAddSource.objectKeys),
|
|
106
84
|
}),
|
|
107
85
|
});
|
|
108
86
|
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
112
|
-
autoDeleteObjects: true, // needed for integration test cleanup
|
|
87
|
+
const bucketWithoutObjectKeys = new s3.Bucket(this, 'BucketWithoutObjectKeys', {
|
|
88
|
+
...commonBucketProps,
|
|
113
89
|
});
|
|
114
90
|
|
|
115
|
-
|
|
91
|
+
// Test that objectKeys are not returned when outputObjectKeys is disabled
|
|
92
|
+
new s3deploy.BucketDeployment(this, 'DeployWithoutObjectKeys', {
|
|
116
93
|
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website-second'))],
|
|
117
|
-
destinationBucket:
|
|
118
|
-
retainOnDelete: false,
|
|
94
|
+
destinationBucket: bucketWithoutObjectKeys,
|
|
95
|
+
retainOnDelete: false,
|
|
119
96
|
outputObjectKeys: false,
|
|
120
97
|
});
|
|
121
98
|
}
|
|
@@ -128,13 +105,14 @@ const app = new cdk.App({
|
|
|
128
105
|
});
|
|
129
106
|
const testCase = new TestBucketDeployment(app, 'test-bucket-deployments');
|
|
130
107
|
|
|
131
|
-
// Assert that DeployMeWithoutExtractingFilesOnDestination deploys a zip file to bucket4
|
|
132
108
|
const integTest = new integ.IntegTest(app, 'integ-test-bucket-deployments', {
|
|
133
109
|
testCases: [testCase],
|
|
134
110
|
diffAssets: true,
|
|
135
111
|
});
|
|
112
|
+
|
|
113
|
+
// Assert that addSource() successfully adds the data source alongside the asset source
|
|
136
114
|
const listObjectsCall = integTest.assertions.awsApiCall('S3', 'listObjects', {
|
|
137
|
-
Bucket: testCase.
|
|
115
|
+
Bucket: testCase.bucketWithAddSource.bucketName,
|
|
138
116
|
});
|
|
139
117
|
listObjectsCall.provider.addToRolePolicy({
|
|
140
118
|
Effect: 'Allow',
|
|
@@ -154,12 +132,12 @@ listObjectsCall.expect(integ.ExpectedResult.objectLike({
|
|
|
154
132
|
),
|
|
155
133
|
}));
|
|
156
134
|
|
|
157
|
-
// Assert that
|
|
135
|
+
// Assert that objectKeys output contains the deployed object keys when outputObjectKeys is enabled (default)
|
|
158
136
|
const describe = integTest.assertions.awsApiCall('CloudFormation', 'describeStacks', {
|
|
159
137
|
StackName: 'test-bucket-deployments',
|
|
160
138
|
});
|
|
161
139
|
|
|
162
140
|
describe.assertAtPath('Stacks.0.Outputs.0.OutputKey', integ.ExpectedResult.stringLikeRegexp('customResourceData'));
|
|
163
|
-
describe.assertAtPath('Stacks.0.Outputs.0.OutputValue', integ.ExpectedResult.stringLikeRegexp('Object Keys are ([0-9a-f])
|
|
141
|
+
describe.assertAtPath('Stacks.0.Outputs.0.OutputValue', integ.ExpectedResult.stringLikeRegexp('Object Keys are ([0-9a-f])+\\.zip(,([0-9a-f])+\\.zip)*'));
|
|
164
142
|
|
|
165
143
|
app.synth();
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as cdk from 'aws-cdk-lib';
|
|
2
|
+
import { SecretValue } from 'aws-cdk-lib';
|
|
3
|
+
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager';
|
|
4
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
5
|
+
|
|
6
|
+
class TestStack extends cdk.Stack {
|
|
7
|
+
constructor(scope: cdk.App, id: string) {
|
|
8
|
+
super(scope, id);
|
|
9
|
+
|
|
10
|
+
// Create a default secret
|
|
11
|
+
const secret = new secretsmanager.Secret(this, 'Secret');
|
|
12
|
+
|
|
13
|
+
// Create a JSON secret containing cfnDynamicReferenceKey values extracted from the default secret
|
|
14
|
+
new secretsmanager.Secret(this, 'JSONSecret', {
|
|
15
|
+
secretObjectValue: {
|
|
16
|
+
cfnDynamicReferenceKeyWithDefaults: SecretValue.unsafePlainText(secret.cfnDynamicReferenceKey()),
|
|
17
|
+
cfnDynamicReferenceKeyWithJsonFieldAndVersionStage: SecretValue.unsafePlainText(secret.cfnDynamicReferenceKey({
|
|
18
|
+
jsonField: 'json-key',
|
|
19
|
+
versionStage: 'version-stage',
|
|
20
|
+
})),
|
|
21
|
+
cfnDynamicReferenceKeyWithJsonFieldAndVersionId: SecretValue.unsafePlainText(secret.cfnDynamicReferenceKey({
|
|
22
|
+
jsonField: 'json-key',
|
|
23
|
+
versionId: 'version-id',
|
|
24
|
+
})),
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const app = new cdk.App();
|
|
31
|
+
|
|
32
|
+
const stack = new TestStack(app, 'cdk-integ-secrets-dynamic-reference-key');
|
|
33
|
+
|
|
34
|
+
new integ.IntegTest(app, 'cdk-integ-secrets-dynamic-reference-key-test', {
|
|
35
|
+
testCases: [stack],
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
app.synth();
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import * as cdk from 'aws-cdk-lib/core';
|
|
2
|
+
import { ExpectedResult, IntegTest } from '@aws-cdk/integ-tests-alpha';
|
|
3
|
+
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
|
|
4
|
+
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
5
|
+
import { STEPFUNCTIONS_USE_DISTRIBUTED_MAP_RESULT_WRITER_V2 } from 'aws-cdk-lib/cx-api';
|
|
6
|
+
|
|
7
|
+
const CSV_KEY = 'my-key.csv';
|
|
8
|
+
const RESULT_BUCKET_PREFIX = 'my-prefix';
|
|
9
|
+
|
|
10
|
+
class DistributedMapStack extends cdk.Stack {
|
|
11
|
+
readonly stateMachine: sfn.StateMachine;
|
|
12
|
+
readonly bucket: s3.Bucket;
|
|
13
|
+
|
|
14
|
+
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
|
|
15
|
+
super(scope, id, props);
|
|
16
|
+
|
|
17
|
+
this.bucket = new s3.Bucket(this, 'Bucket', {
|
|
18
|
+
autoDeleteObjects: true,
|
|
19
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const distributedMap = sfn.DistributedMap.jsonata(this, 'DistributedMap', {
|
|
23
|
+
itemReader: new sfn.S3CsvItemReader({
|
|
24
|
+
bucket: this.bucket,
|
|
25
|
+
key: CSV_KEY,
|
|
26
|
+
csvHeaders: sfn.CsvHeaders.useFirstRow(),
|
|
27
|
+
}),
|
|
28
|
+
resultWriterV2: new sfn.ResultWriterV2({
|
|
29
|
+
bucket: this.bucket,
|
|
30
|
+
prefix: RESULT_BUCKET_PREFIX,
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
distributedMap.itemProcessor(sfn.Pass.jsonata(this, 'Pass'), {
|
|
35
|
+
mode: sfn.ProcessorMode.DISTRIBUTED,
|
|
36
|
+
executionType: sfn.ProcessorType.STANDARD,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
this.stateMachine = new sfn.StateMachine(this, 'StateMachine', {
|
|
40
|
+
definition: distributedMap,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const app = new cdk.App({
|
|
46
|
+
context: {
|
|
47
|
+
[STEPFUNCTIONS_USE_DISTRIBUTED_MAP_RESULT_WRITER_V2]: true,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
const stack = new DistributedMapStack(app, 'sm-jsonpath-with-distributed-map-jsonata');
|
|
51
|
+
|
|
52
|
+
const testCase = new IntegTest(app, 'integ-sm-jsonpath-with-distributed-map-jsonata', {
|
|
53
|
+
testCases: [stack],
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
testCase.assertions
|
|
57
|
+
.awsApiCall('StepFunctions', 'describeStateMachine', {
|
|
58
|
+
stateMachineArn: stack.stateMachine.stateMachineArn,
|
|
59
|
+
})
|
|
60
|
+
.expect(ExpectedResult.objectLike({ status: 'ACTIVE' }))
|
|
61
|
+
.waitForAssertions({
|
|
62
|
+
interval: cdk.Duration.seconds(10),
|
|
63
|
+
totalTimeout: cdk.Duration.minutes(5),
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Put an object in the bucket
|
|
67
|
+
const putObject = testCase.assertions.awsApiCall('S3', 'putObject', {
|
|
68
|
+
Bucket: stack.bucket.bucketName,
|
|
69
|
+
Key: CSV_KEY,
|
|
70
|
+
Body: 'a,b,c\n1,2,3\n4,5,6',
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// Start an execution
|
|
74
|
+
const start = testCase.assertions.awsApiCall('StepFunctions', 'startExecution', {
|
|
75
|
+
stateMachineArn: stack.stateMachine.stateMachineArn,
|
|
76
|
+
});
|
|
77
|
+
putObject.next(start);
|
|
78
|
+
|
|
79
|
+
// describe the results of the execution
|
|
80
|
+
const describe = testCase.assertions.awsApiCall('StepFunctions', 'describeExecution', {
|
|
81
|
+
executionArn: start.getAttString('executionArn'),
|
|
82
|
+
});
|
|
83
|
+
start.next(describe);
|
|
84
|
+
|
|
85
|
+
// assert the results
|
|
86
|
+
const describeExecution = describe.expect(ExpectedResult.objectLike({
|
|
87
|
+
status: 'SUCCEEDED',
|
|
88
|
+
})).waitForAssertions({
|
|
89
|
+
interval: cdk.Duration.seconds(10),
|
|
90
|
+
totalTimeout: cdk.Duration.minutes(5),
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const s3ApiCall = testCase.assertions.awsApiCall('S3', 'listObjectsV2', {
|
|
94
|
+
Bucket: stack.bucket.bucketName,
|
|
95
|
+
MaxKeys: 2,
|
|
96
|
+
Prefix: RESULT_BUCKET_PREFIX,
|
|
97
|
+
}).expect(ExpectedResult.objectLike({
|
|
98
|
+
KeyCount: 2,
|
|
99
|
+
}));
|
|
100
|
+
s3ApiCall.provider.addToRolePolicy({
|
|
101
|
+
Effect: 'Allow',
|
|
102
|
+
Action: ['s3:GetObject', 's3:ListBucket'],
|
|
103
|
+
Resource: ['*'],
|
|
104
|
+
});
|
|
105
|
+
describeExecution.next(s3ApiCall);
|
cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/README.md
CHANGED
|
@@ -141,6 +141,17 @@ The `EvaluateExpression` supports a `runtime` prop to specify the Lambda
|
|
|
141
141
|
runtime to use to evaluate the expression. Currently, only runtimes
|
|
142
142
|
of the Node.js family are supported.
|
|
143
143
|
|
|
144
|
+
The `EvaluateExpression` also supports an `architecture` prop to specify the Lambda
|
|
145
|
+
architecture. This can be useful when migrating to ARM64 or when running integration
|
|
146
|
+
tests on ARM64 systems.
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
const convertToSecondsArm64 = new tasks.EvaluateExpression(this, 'Convert to seconds', {
|
|
150
|
+
expression: '$.waitMilliseconds / 1000',
|
|
151
|
+
architecture: lambda.Architecture.ARM_64,
|
|
152
|
+
});
|
|
153
|
+
```
|
|
154
|
+
|
|
144
155
|
## API Gateway
|
|
145
156
|
|
|
146
157
|
Step Functions supports [API Gateway](https://docs.aws.amazon.com/step-functions/latest/dg/connect-api-gateway.html) through the service integration pattern.
|
|
@@ -1374,12 +1385,12 @@ The following code snippet includes a Task state that uses eks:call to list the
|
|
|
1374
1385
|
|
|
1375
1386
|
```ts
|
|
1376
1387
|
import * as eks from 'aws-cdk-lib/aws-eks';
|
|
1377
|
-
import {
|
|
1388
|
+
import { KubectlV34Layer } from '@aws-cdk/lambda-layer-kubectl-v34';
|
|
1378
1389
|
|
|
1379
1390
|
const myEksCluster = new eks.Cluster(this, 'my sample cluster', {
|
|
1380
|
-
version: eks.KubernetesVersion.
|
|
1391
|
+
version: eks.KubernetesVersion.V1_34,
|
|
1381
1392
|
clusterName: 'myEksCluster',
|
|
1382
|
-
kubectlLayer: new
|
|
1393
|
+
kubectlLayer: new KubectlV34Layer(this, 'kubectl'),
|
|
1383
1394
|
});
|
|
1384
1395
|
|
|
1385
1396
|
new tasks.EksCall(this, 'Call a EKS Endpoint', {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { App, Stack } from 'aws-cdk-lib';
|
|
2
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
3
|
+
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
|
|
4
|
+
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
5
|
+
import * as cdk from 'aws-cdk-lib';
|
|
6
|
+
import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks';
|
|
7
|
+
|
|
8
|
+
const app = new App();
|
|
9
|
+
const stack = new Stack(app, 'aws-cdk-sfn-evaluate-expression-arm64-integ');
|
|
10
|
+
|
|
11
|
+
const evaluateExpression = new tasks.EvaluateExpression(stack, 'EvaluateExpression', {
|
|
12
|
+
expression: '$.a + $.b',
|
|
13
|
+
architecture: lambda.Architecture.ARM_64,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const sm = new sfn.StateMachine(stack, 'StateMachine', {
|
|
17
|
+
definitionBody: sfn.DefinitionBody.fromChainable(evaluateExpression),
|
|
18
|
+
timeout: cdk.Duration.seconds(30),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
new cdk.CfnOutput(stack, 'stateMachineArn', {
|
|
22
|
+
value: sm.stateMachineArn,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
new integ.IntegTest(app, 'EvaluateExpressionArm64Test', {
|
|
26
|
+
testCases: [stack],
|
|
27
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { App, Stack } from 'aws-cdk-lib';
|
|
2
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
3
|
+
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
|
|
4
|
+
import * as cdk from 'aws-cdk-lib';
|
|
5
|
+
import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks';
|
|
6
|
+
|
|
7
|
+
const app = new App();
|
|
8
|
+
const stack = new Stack(app, 'aws-cdk-sfn-evaluate-expression-default-integ');
|
|
9
|
+
|
|
10
|
+
const evaluateExpression = new tasks.EvaluateExpression(stack, 'EvaluateExpression', {
|
|
11
|
+
expression: '$.a + $.b',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const sm = new sfn.StateMachine(stack, 'StateMachine', {
|
|
15
|
+
definitionBody: sfn.DefinitionBody.fromChainable(evaluateExpression),
|
|
16
|
+
timeout: cdk.Duration.seconds(30),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
new cdk.CfnOutput(stack, 'stateMachineArn', {
|
|
20
|
+
value: sm.stateMachineArn,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
new integ.IntegTest(app, 'EvaluateExpressionDefaultTest', {
|
|
24
|
+
testCases: [stack],
|
|
25
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
2
|
+
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
|
|
3
|
+
import * as cdk from 'aws-cdk-lib';
|
|
4
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
5
|
+
import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks';
|
|
6
|
+
|
|
7
|
+
const app = new cdk.App();
|
|
8
|
+
const stack = new cdk.Stack(app, 'aws-cdk-sfn-evaluate-expression-mixed-arch-integ');
|
|
9
|
+
|
|
10
|
+
const evalTaskArm = new tasks.EvaluateExpression(stack, 'EvalExpressionArm', {
|
|
11
|
+
expression: '$.a + $.b',
|
|
12
|
+
runtime: lambda.Runtime.NODEJS_20_X,
|
|
13
|
+
architecture: lambda.Architecture.ARM_64,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const evalTaskX86 = new tasks.EvaluateExpression(stack, 'EvalExpressionX86', {
|
|
17
|
+
expression: '$.a * $.b',
|
|
18
|
+
runtime: lambda.Runtime.NODEJS_20_X,
|
|
19
|
+
architecture: lambda.Architecture.X86_64,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const definition = new sfn.Pass(stack, 'Start', {
|
|
23
|
+
result: sfn.Result.fromObject({ a: 3, b: 4 }),
|
|
24
|
+
}).next(new sfn.Parallel(stack, 'ParallelEval')
|
|
25
|
+
.branch(evalTaskArm)
|
|
26
|
+
.branch(evalTaskX86),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
new sfn.StateMachine(stack, 'StateMachine', {
|
|
30
|
+
definitionBody: sfn.DefinitionBody.fromChainable(definition),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
new integ.IntegTest(app, 'EvaluateExpressionMixedArchTest', {
|
|
34
|
+
testCases: [stack],
|
|
35
|
+
});
|