Skip to content

Commit

Permalink
Merge branch 'main' into rds-update
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Apr 13, 2023
2 parents d7307ff + f17008a commit be080dd
Show file tree
Hide file tree
Showing 42 changed files with 2,487 additions and 1,860 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ concurrency=$(node -p 'Math.max(1, require("os").cpus().length - 1)')

echo "============================================================================================="
echo "building..."
time lerna run $bail --stream --concurrency=$concurrency $runtarget || fail
time npx lerna run $bail --stream --concurrency=$concurrency $runtarget || fail

if [ "$check_compat" == "true" ]; then
/bin/bash scripts/check-api-compatibility.sh
Expand Down
33 changes: 33 additions & 0 deletions packages/@aws-cdk/aws-batch/test/aws-events-targets/batch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,37 @@ describe('Batch job event target', () => {
],
});
});

test('should validate jobName minimum and maximum length', () => {
const rule = new events.Rule(stack, 'Rule', {
schedule: events.Schedule.expression('rate(1 min)'),
});

expect(() => {
rule.addTarget(
new targets.BatchJob(
jobQueue.jobQueueArn,
jobQueue,
jobDefinition.jobDefinitionArn,
jobDefinition,
{
jobName: '',
},
),
);
}).toThrowError(/must have length between 1 and 128/);
expect(() => {
rule.addTarget(
new targets.BatchJob(
jobQueue.jobQueueArn,
jobQueue,
jobDefinition.jobDefinitionArn,
jobDefinition,
{
jobName: 'a'.repeat(200),
},
),
);
}).toThrowError(/must have length between 1 and 128/);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "31.0.0",
"files": {
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
"source": {
"path": "BatchUniqueNameTestDefaultTestDeployAssertA3886AB9.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"31.0.0"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "31.0.0",
"testCases": {
"BatchUniqueNameTest/DefaultTest": {
"stacks": [
"stack"
],
"assertionStack": "BatchUniqueNameTest/DefaultTest/DeployAssert",
"assertionStackName": "BatchUniqueNameTestDefaultTestDeployAssertA3886AB9"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"version": "31.0.0",
"artifacts": {
"stack.assets": {
"type": "cdk:asset-manifest",
"properties": {
"file": "stack.assets.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"stack": {
"type": "aws:cloudformation:stack",
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "stack.template.json",
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fc5aee66236b7c22643f298a9dbade30928a43ce59854880e447781626009ffe.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
"stack.assets"
],
"lookupRole": {
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
"requiresBootstrapStackVersion": 8,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"dependencies": [
"stack.assets"
],
"metadata": {
"/stack/ComputeEnvironment/BatchServiceRole/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "ComputeEnvironmentBatchServiceRole3533BE31"
}
],
"/stack/ComputeEnvironment/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "ComputeEnvironmentC570994D"
}
],
"/stack/MyQueue/MyQueue": [
{
"type": "aws:cdk:logicalId",
"data": "MyQueue4F9177CF"
}
],
"/stack/container/ExecutionRole/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "containerExecutionRoleFD602179"
}
],
"/stack/MyJob/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "MyJob8719E923"
}
],
"/stack/MyJob/EventsRole/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "MyJobEventsRoleCF43C336"
}
],
"/stack/MyJob/EventsRole/DefaultPolicy/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "MyJobEventsRoleDefaultPolicy7266D3A7"
}
],
"/stack/Rule/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "Rule4C995B7F"
}
],
"/stack/BootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "BootstrapVersion"
}
],
"/stack/CheckBootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "CheckBootstrapVersion"
}
]
},
"displayName": "stack"
},
"BatchUniqueNameTestDefaultTestDeployAssertA3886AB9.assets": {
"type": "cdk:asset-manifest",
"properties": {
"file": "BatchUniqueNameTestDefaultTestDeployAssertA3886AB9.assets.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"BatchUniqueNameTestDefaultTestDeployAssertA3886AB9": {
"type": "aws:cloudformation:stack",
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "BatchUniqueNameTestDefaultTestDeployAssertA3886AB9.template.json",
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
"BatchUniqueNameTestDefaultTestDeployAssertA3886AB9.assets"
],
"lookupRole": {
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
"requiresBootstrapStackVersion": 8,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"dependencies": [
"BatchUniqueNameTestDefaultTestDeployAssertA3886AB9.assets"
],
"metadata": {
"/BatchUniqueNameTest/DefaultTest/DeployAssert/BootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "BootstrapVersion"
}
],
"/BatchUniqueNameTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "CheckBootstrapVersion"
}
]
},
"displayName": "BatchUniqueNameTest/DefaultTest/DeployAssert"
},
"Tree": {
"type": "cdk:tree",
"properties": {
"file": "tree.json"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "31.0.0",
"files": {
"fc5aee66236b7c22643f298a9dbade30928a43ce59854880e447781626009ffe": {
"source": {
"path": "stack.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "fc5aee66236b7c22643f298a9dbade30928a43ce59854880e447781626009ffe.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Loading

0 comments on commit be080dd

Please sign in to comment.