Skip to content

Commit

Permalink
Merge branch 'main' into merge-back/2.38.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 18, 2022
2 parents a5ced21 + 2ad2163 commit 860bde2
Show file tree
Hide file tree
Showing 160 changed files with 6,089 additions and 1,216 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"devDependencies": {
"@types/prettier": "2.6.0",
"@yarnpkg/lockfile": "^1.1.0",
"cdk-generate-synthetic-examples": "^0.1.14",
"cdk-generate-synthetic-examples": "^0.1.15",
"conventional-changelog-cli": "^2.2.2",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.10",
"jest-junit": "^13.2.0",
"jsii-diff": "^1.63.2",
"jsii-pacmak": "^1.63.2",
"jsii-reflect": "^1.63.2",
"jsii-rosetta": "^1.63.2",
"jsii-diff": "^1.64.0",
"jsii-pacmak": "^1.64.0",
"jsii-reflect": "^1.64.0",
"jsii-rosetta": "^1.64.0",
"lerna": "^4.0.0",
"patch-package": "^6.4.7",
"semver": "^6.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"Runtime": "nodejs14.x",
"Code": {
"S3Bucket": {
"Ref": "AssetParametersc70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13aS3BucketB4787383"
"Ref": "AssetParametersd01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347S3Bucket6D5A7C19"
},
"S3Key": {
"Fn::Join": [
Expand All @@ -174,7 +174,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParametersc70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13aS3VersionKey8CF8E820"
"Ref": "AssetParametersd01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347S3VersionKeyB0A22B12"
}
]
}
Expand All @@ -187,7 +187,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParametersc70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13aS3VersionKey8CF8E820"
"Ref": "AssetParametersd01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347S3VersionKeyB0A22B12"
}
]
}
Expand All @@ -211,17 +211,17 @@
}
},
"Parameters": {
"AssetParametersc70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13aS3BucketB4787383": {
"AssetParametersd01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347S3Bucket6D5A7C19": {
"Type": "String",
"Description": "S3 bucket for asset \"c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a\""
"Description": "S3 bucket for asset \"d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347\""
},
"AssetParametersc70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13aS3VersionKey8CF8E820": {
"AssetParametersd01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347S3VersionKeyB0A22B12": {
"Type": "String",
"Description": "S3 key for asset version \"c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a\""
"Description": "S3 key for asset version \"d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347\""
},
"AssetParametersc70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13aArtifactHashC9560B34": {
"AssetParametersd01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347ArtifactHash974BA2D2": {
"Type": "String",
"Description": "Artifact hash for asset \"c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a\""
"Description": "Artifact hash for asset \"d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347\""
}
},
"Outputs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
},
"flattenResponse": "false",
"salt": "1659609543121"
"salt": "1660753153241"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
Expand Down Expand Up @@ -57,7 +57,7 @@
]
]
},
"salt": "1659609543122"
"salt": "1660753153242"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
Expand Down
Empty file.

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,35 @@ async function createLogGroupSafe(logGroupName: string, region?: string, options
} while (true); // exit happens on retry count check
}

//delete a log group
async function deleteLogGroup(logGroupName: string, region?: string, options?: SdkRetryOptions) {
let retryCount = options?.maxRetries == undefined ? 10 : options.maxRetries;
const delay = options?.retryOptions?.base == undefined ? 10 : options.retryOptions.base;
do {
try {
const cloudwatchlogs = new AWS.CloudWatchLogs({ apiVersion: '2014-03-28', region, ...options });
await cloudwatchlogs.deleteLogGroup({ logGroupName }).promise();
return;
} catch (error) {
if (error.code === 'ResourceNotFoundException') {
// The log group doesn't exist
return;
}
if (error.code === 'OperationAbortedException') {
if (retryCount > 0) {
retryCount--;
await new Promise(resolve => setTimeout(resolve, delay));
continue;
} else {
// The log group is still being deleted by another execution but we are out of retries
throw new Error('Out of attempts to delete a logGroup');
}
}
throw error;
}
} while (true); // exit happens on retry count check
}

/**
* Puts or deletes a retention policy on a log group.
*
Expand Down Expand Up @@ -124,6 +153,12 @@ export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent
}
}

//When the requestType is delete, delete the log group if the removal policy is delete
if (event.RequestType === 'Delete' && event.ResourceProperties.RemovalPolicy === 'destroy') {
await deleteLogGroup(logGroupName, logGroupRegion, retryOptions);
//else retain the log group
}

await respond('SUCCESS', 'OK', logGroupName);
} catch (e) {
console.log(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"stacks": [
"AppSyncIntegLogRetention"
],
"assertionStack": "IntegDefaultTestDeployAssert4E6713E1"
"assertionStack": "Integ/DefaultTest/DeployAssert"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
{
"type": "aws:cdk:asset",
"data": {
"path": "asset.c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a",
"id": "c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a",
"path": "asset.d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347",
"id": "d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347",
"packaging": "zip",
"sourceHash": "c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a",
"s3BucketParameter": "AssetParametersc70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13aS3BucketB4787383",
"s3KeyParameter": "AssetParametersc70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13aS3VersionKey8CF8E820",
"artifactHashParameter": "AssetParametersc70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13aArtifactHashC9560B34"
"sourceHash": "d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347",
"s3BucketParameter": "AssetParametersd01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347S3Bucket6D5A7C19",
"s3KeyParameter": "AssetParametersd01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347S3VersionKeyB0A22B12",
"artifactHashParameter": "AssetParametersd01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347ArtifactHash974BA2D2"
}
}
],
Expand Down Expand Up @@ -77,22 +77,22 @@
"data": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A"
}
],
"/AppSyncIntegLogRetention/AssetParameters/c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a/S3Bucket": [
"/AppSyncIntegLogRetention/AssetParameters/d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347/S3Bucket": [
{
"type": "aws:cdk:logicalId",
"data": "AssetParametersc70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13aS3BucketB4787383"
"data": "AssetParametersd01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347S3Bucket6D5A7C19"
}
],
"/AppSyncIntegLogRetention/AssetParameters/c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a/S3VersionKey": [
"/AppSyncIntegLogRetention/AssetParameters/d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347/S3VersionKey": [
{
"type": "aws:cdk:logicalId",
"data": "AssetParametersc70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13aS3VersionKey8CF8E820"
"data": "AssetParametersd01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347S3VersionKeyB0A22B12"
}
],
"/AppSyncIntegLogRetention/AssetParameters/c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a/ArtifactHash": [
"/AppSyncIntegLogRetention/AssetParameters/d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347/ArtifactHash": [
{
"type": "aws:cdk:logicalId",
"data": "AssetParametersc70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13aArtifactHashC9560B34"
"data": "AssetParametersd01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347ArtifactHash974BA2D2"
}
],
"/AppSyncIntegLogRetention/Exports/Output{\"Fn::GetAtt\":[\"GraphqlApi1B6CF24C\",\"ApiId\"]}": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.63"
"version": "10.1.71"
}
},
"AppSyncIntegLogRetention": {
Expand Down Expand Up @@ -296,36 +296,36 @@
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.63"
"version": "10.1.71"
}
},
"AssetParameters": {
"id": "AssetParameters",
"path": "AppSyncIntegLogRetention/AssetParameters",
"children": {
"c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a": {
"id": "c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a",
"path": "AppSyncIntegLogRetention/AssetParameters/c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a",
"d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347": {
"id": "d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347",
"path": "AppSyncIntegLogRetention/AssetParameters/d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347",
"children": {
"S3Bucket": {
"id": "S3Bucket",
"path": "AppSyncIntegLogRetention/AssetParameters/c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a/S3Bucket",
"path": "AppSyncIntegLogRetention/AssetParameters/d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347/S3Bucket",
"constructInfo": {
"fqn": "@aws-cdk/core.CfnParameter",
"version": "0.0.0"
}
},
"S3VersionKey": {
"id": "S3VersionKey",
"path": "AppSyncIntegLogRetention/AssetParameters/c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a/S3VersionKey",
"path": "AppSyncIntegLogRetention/AssetParameters/d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347/S3VersionKey",
"constructInfo": {
"fqn": "@aws-cdk/core.CfnParameter",
"version": "0.0.0"
}
},
"ArtifactHash": {
"id": "ArtifactHash",
"path": "AppSyncIntegLogRetention/AssetParameters/c70c1d1695771af4771fd98971e16bb3e6443c62c2994b002b2c3d76e707b13a/ArtifactHash",
"path": "AppSyncIntegLogRetention/AssetParameters/d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347/ArtifactHash",
"constructInfo": {
"fqn": "@aws-cdk/core.CfnParameter",
"version": "0.0.0"
Expand All @@ -334,13 +334,13 @@
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.63"
"version": "10.1.71"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.63"
"version": "10.1.71"
}
},
"Exports": {
Expand All @@ -358,7 +358,7 @@
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.63"
"version": "10.1.71"
}
}
},
Expand All @@ -380,7 +380,7 @@
"path": "Integ/DefaultTest/Default",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.63"
"version": "10.1.71"
}
},
"DeployAssert": {
Expand All @@ -400,7 +400,7 @@
"path": "Integ/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsdescribeLogGroups/SdkProvider/AssertionsProvider",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.63"
"version": "10.1.71"
}
}
},
Expand Down Expand Up @@ -440,7 +440,7 @@
"path": "Integ/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsdescribeLogGroups/AssertEqualsCloudWatchLogsdescribeLogGroups/AssertionProvider/AssertionsProvider",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.63"
"version": "10.1.71"
}
}
},
Expand Down Expand Up @@ -518,7 +518,7 @@
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.63"
"version": "10.1.71"
}
},
"AssetParameters": {
Expand Down Expand Up @@ -556,13 +556,13 @@
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.63"
"version": "10.1.71"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.63"
"version": "10.1.71"
}
}
},
Expand Down
7 changes: 1 addition & 6 deletions packages/@aws-cdk/aws-batch/test/integ.job-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ import { JobDefinition } from "../lib";

const app = new App();

const stack = new Stack(app, "BatchDefaultEnvVarsStack", {
env: {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION,
},
});
const stack = new Stack(app, "BatchDefaultEnvVarsStack");

new JobDefinition(stack, "JobDefinition", {
container: {
Expand Down
Loading

0 comments on commit 860bde2

Please sign in to comment.