Skip to content

Commit

Permalink
Merge branch 'main' into neptune-cw-logs
Browse files Browse the repository at this point in the history
  • Loading branch information
humanzz authored Sep 30, 2022
2 parents fb6211f + a2b7a46 commit caf7c55
Show file tree
Hide file tree
Showing 204 changed files with 9,398 additions and 657 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/github-merit-badger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ on:

jobs:
call-action:
if: ${{ github.actor != 'dependabot[bot]' }} && ${{ github.actor != 'mergify[bot]' }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: kaizencc/github-merit-badger@main
- uses: aws-github-ops/github-merit-badger@main
id: merit-badger
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
badges: '[beginning-contributor,repeat-contributor,valued-contributor,admired-contributor,star-contributor,distinguished-contributor]'
thresholds: '[0,3,6,13,25,50]'
badge-type: 'achievement'
ignore-usernames: '[RomainMuller,rix0rrr,Jerry-AWS,MrArnoldPalmer,iliapolo,otaviomacedo,madeline-k,kaizencc,comcalvi,corymhall,peterwoodworth,ryparker,TheRealAmazonKendra,vinayak-kukreja,Naumel,mrgrain,aws-cdk-automation]'
ignore-usernames: '[RomainMuller,rix0rrr,Jerry-AWS,MrArnoldPalmer,iliapolo,otaviomacedo,madeline-k,kaizencc,comcalvi,corymhall,peterwoodworth,ryparker,TheRealAmazonKendra,vinayak-kukreja,Naumel,mrgrain,pahud,cgarvis,aws-cdk-automation,dependabot[bot],mergify[bot]]'
2 changes: 1 addition & 1 deletion .github/workflows/pr-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ jobs:
- name: Validate
uses: ./tools/@aws-cdk/prlint
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PROJEN_GITHUB_TOKEN }}
REPO_ROOT: ${{ github.workspace }}
2 changes: 1 addition & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pull_request_rules:
label:
add: [ contribution/core ]
conditions:
- author~=^(RomainMuller|rix0rrr|Jerry-AWS|MrArnoldPalmer|iliapolo|uttarasridhar|otaviomacedo|madeline-k|kaizencc|comcalvi|corymhall|peterwoodworth|ryparker|TheRealAmazonKendra|yuth|vinayak-kukreja|Naumel|mrgrain)$
- author~=^(RomainMuller|rix0rrr|Jerry-AWS|MrArnoldPalmer|iliapolo|uttarasridhar|otaviomacedo|madeline-k|kaizencc|comcalvi|corymhall|peterwoodworth|ryparker|TheRealAmazonKendra|yuth|vinayak-kukreja|Naumel|mrgrain|pahud|cgarvis)$
- -label~="contribution/core"
- name: automatic merge
actions:
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.44.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.43.1-alpha.0...v2.44.0-alpha.0) (2022-09-28)


### Features

* **integ-tests:** chain assertion api calls ([#22196](https://github.com/aws/aws-cdk/issues/22196)) ([530e07b](https://github.com/aws/aws-cdk/commit/530e07bdc87ab94bbd5ed28debac98400a8152cc))
* **neptune:** introduce metric method to cluster and instance ([#21995](https://github.com/aws/aws-cdk/issues/21995)) ([02ed837](https://github.com/aws/aws-cdk/commit/02ed8371276d504ba9fe09687d45409ad7cca288)), closes [#20248](https://github.com/aws/aws-cdk/issues/20248)

## [2.43.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.43.0-alpha.0...v2.43.1-alpha.0) (2022-09-23)

## [2.43.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.42.1-alpha.0...v2.43.0-alpha.0) (2022-09-21)


Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.44.0](https://github.com/aws/aws-cdk/compare/v2.43.1...v2.44.0) (2022-09-28)


### Features

* **assets:** support drop-in docker replacements by setting `$CDK_DOCKER` ([#21838](https://github.com/aws/aws-cdk/issues/21838)) ([d52310e](https://github.com/aws/aws-cdk/commit/d52310ea2104dd1ed13761944d078ffce46a299f)), closes [40aws-cdk/core/lib/bundling.ts#L523](https://github.com/40aws-cdk/core/lib/bundling.ts/issues/L523) [#21836](https://github.com/aws/aws-cdk/issues/21836)
* **backup:** add copy actions to backup plan rules ([#22244](https://github.com/aws/aws-cdk/issues/22244)) ([d87a651](https://github.com/aws/aws-cdk/commit/d87a651608d23f3bfc3c178093d92b5bdda71084)), closes [#22173](https://github.com/aws/aws-cdk/issues/22173)
* **cfnspec:** cloudformation spec v89.0.0 ([#22232](https://github.com/aws/aws-cdk/issues/22232)) ([953d684](https://github.com/aws/aws-cdk/commit/953d6841fa3ed43258d0454e245cebcab6323e0d))
* **cli:** `cdk deploy --method=direct` is faster ([#22079](https://github.com/aws/aws-cdk/issues/22079)) ([dd6ead4](https://github.com/aws/aws-cdk/commit/dd6ead447a80cdec3379a3ced2e04b7d15f9c55d))
* **cloudwatch:** add gauge widget ([#22213](https://github.com/aws/aws-cdk/issues/22213)) ([d9f0e80](https://github.com/aws/aws-cdk/commit/d9f0e809d583d23cb83b4e2855574675a669c33f)), closes [#22136](https://github.com/aws/aws-cdk/issues/22136)
* **core:** 'postCliContext' property allows context that cannot be overridden by the CLI ([#21743](https://github.com/aws/aws-cdk/issues/21743)) ([a618096](https://github.com/aws/aws-cdk/commit/a618096432a27a808a0352ea186fe1e4db2911c4))
* **dynamodb:** Changes how metricForOperation methods are used ([#22097](https://github.com/aws/aws-cdk/issues/22097)) ([fcb311d](https://github.com/aws/aws-cdk/commit/fcb311d615422b76f18b6be60dd466b315fcd6b0)), closes [#21963](https://github.com/aws/aws-cdk/issues/21963)
* **logs:** add dimensions to metric filter ([#21654](https://github.com/aws/aws-cdk/issues/21654)) ([f834a45](https://github.com/aws/aws-cdk/commit/f834a4537643b32131076111be0693c6f8f96b24)), closes [/github.com/aws/aws-cdk/issues/16999#issuecomment-1005172655](https://github.com/aws//github.com/aws/aws-cdk/issues/16999/issues/issuecomment-1005172655) [#16999](https://github.com/aws/aws-cdk/issues/16999)
* **pipelines:** allow disabling use of change sets ([#21619](https://github.com/aws/aws-cdk/issues/21619)) ([05723e7](https://github.com/aws/aws-cdk/commit/05723e74cc0e760f570c36ec02a70e8936287814)), closes [#20827](https://github.com/aws/aws-cdk/issues/20827)
* **s3-deployment:** extract flag to disable automatic unzipping ([#21805](https://github.com/aws/aws-cdk/issues/21805)) ([91898b5](https://github.com/aws/aws-cdk/commit/91898b51573c0bfd0f26ae7610feb6a400bc8159)), closes [#8065](https://github.com/aws/aws-cdk/issues/8065)


### Bug Fixes

* **aws-elasticloadbalancingv2:** Validation for interval and timeout of application-target-group ([#22225](https://github.com/aws/aws-cdk/issues/22225)) ([6128e39](https://github.com/aws/aws-cdk/commit/6128e3908f4f6b6a1db66ebf7f77b6c966d1f9e7))
* **cli:** SSO credentials do not work when using a proxy ([#22115](https://github.com/aws/aws-cdk/issues/22115)) ([c425e8c](https://github.com/aws/aws-cdk/commit/c425e8ca1a3d296eb6a7fd7e005d07c1eadd16aa)), closes [#21328](https://github.com/aws/aws-cdk/issues/21328)
* **elbv2:** Use correct format for parsing imported target group ARNs ([#22153](https://github.com/aws/aws-cdk/issues/22153)) ([4704d4c](https://github.com/aws/aws-cdk/commit/4704d4c4ac065634dbada3732193a6753369dd12))
* **rds:** changing engine versions would fail to update on DBInstances that were part of a DBCluster ([#22185](https://github.com/aws/aws-cdk/issues/22185)) ([c070ace](https://github.com/aws/aws-cdk/commit/c070acea1b12ec4f73c7d2087c5408d7e38a90a3)), closes [#21758](https://github.com/aws/aws-cdk/issues/21758) [#22180](https://github.com/aws/aws-cdk/issues/22180)
* cannot use values that return an instance of a deprecated class for non TS / JS language ([#22204](https://github.com/aws/aws-cdk/issues/22204)) ([4cad2cf](https://github.com/aws/aws-cdk/commit/4cad2cf7e1ca41dedae6adc8866792e5f71b2123))

## [2.43.1](https://github.com/aws/aws-cdk/compare/v2.43.0...v2.43.1) (2022-09-23)


### Bug Fixes

* cannot use values that return an instance of a deprecated class for non TS / JS language ([#22204](https://github.com/aws/aws-cdk/issues/22204)) ([6182d33](https://github.com/aws/aws-cdk/commit/6182d33fdd3b4714e1888305a2e1c689a10e38ea))

## [2.43.0](https://github.com/aws/aws-cdk/compare/v2.42.1...v2.43.0) (2022-09-21)


Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-amplify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"aws-sdk": "^2.848.0"
"aws-sdk": "^2.1211.0"
},
"dependencies": {
"@aws-cdk/aws-codebuild": "0.0.0",
Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-apigateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
"@aws-cdk/assertions": "0.0.0",
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/integ-tests": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2"
Expand Down
21 changes: 21 additions & 0 deletions packages/@aws-cdk/aws-apprunner/lib/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,32 @@ export class Memory {
* The code runtimes
*/
export class Runtime {

/**
* CORRETTO 8
*/
public static readonly CORRETTO_8 = Runtime.of('CORRETTO_8')

/**
* CORRETTO 11
*/
public static readonly CORRETTO_11 = Runtime.of('CORRETTO_11')

/**
* NodeJS 12
*/
public static readonly NODEJS_12 = Runtime.of('NODEJS_12')

/**
* NodeJS 14
*/
public static readonly NODEJS_14 = Runtime.of('NODEJS_14')

/**
* NodeJS 16
*/
public static readonly NODEJS_16 = Runtime.of('NODEJS_16')

/**
* Python 3
*/
Expand Down
15 changes: 15 additions & 0 deletions packages/@aws-cdk/aws-backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@ plan.addRule(new backup.BackupPlanRule({
}));
```

Rules can also specify to copy recovery points to another Backup Vault using `copyActions`. Copied recovery points can
optionally have `moveToColdStorageAfter` and `deleteAfter` configured.

```ts
declare const plan: backup.BackupPlan;
declare const secondaryVault: backup.BackupVault;
plan.addRule(new backup.BackupPlanRule({
copyActions: [{
destinationBackupVault: secondaryVault,
moveToColdStorageAfter: Duration.days(30),
deleteAfter: Duration.days(120),
}]
}));
```

Ready-made rules are also available:

```ts
Expand Down
13 changes: 12 additions & 1 deletion packages/@aws-cdk/aws-backup/lib/plan.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IResource, Lazy, Resource } from '@aws-cdk/core';
import { Construct } from 'constructs';
import { CfnBackupPlan } from './backup.generated';
import { BackupPlanRule } from './rule';
import { BackupPlanCopyActionProps, BackupPlanRule } from './rule';
import { BackupSelection, BackupSelectionOptions } from './selection';
import { BackupVault, IBackupVault } from './vault';

Expand Down Expand Up @@ -191,9 +191,20 @@ export class BackupPlan extends Resource implements IBackupPlan {
startWindowMinutes: rule.props.startWindow?.toMinutes(),
enableContinuousBackup: rule.props.enableContinuousBackup,
targetBackupVault: vault.backupVaultName,
copyActions: rule.props.copyActions?.map(this.planCopyActions),
});
}

private planCopyActions(props: BackupPlanCopyActionProps): CfnBackupPlan.CopyActionResourceTypeProperty {
return {
destinationBackupVaultArn: props.destinationBackupVault.backupVaultArn,
lifecycle: (props.deleteAfter || props.moveToColdStorageAfter) && {
deleteAfterDays: props.deleteAfter?.toDays(),
moveToColdStorageAfterDays: props.moveToColdStorageAfter?.toDays(),
},
};
}

/**
* The backup vault where backups are stored if not defined at
* the rule level
Expand Down
47 changes: 46 additions & 1 deletion packages/@aws-cdk/aws-backup/lib/rule.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as events from '@aws-cdk/aws-events';
import { Duration } from '@aws-cdk/core';
import { Duration, Token } from '@aws-cdk/core';
import { IBackupVault } from './vault';

/**
Expand Down Expand Up @@ -70,6 +70,38 @@ export interface BackupPlanRuleProps {
* @default false
*/
readonly enableContinuousBackup?: boolean;

/**
* Copy operations to perform on recovery points created by this rule
*
* @default - no copy actions
*/
readonly copyActions?: BackupPlanCopyActionProps[];
}

/**
* Properties for a BackupPlanCopyAction
*/
export interface BackupPlanCopyActionProps {
/**
* Destination Vault for recovery points to be copied into
*/
readonly destinationBackupVault: IBackupVault;

/**
* Specifies the duration after creation that a copied recovery point is deleted from the destination vault.
* Must be at least 90 days greater than `moveToColdStorageAfter`, if specified.
*
* @default - recovery point is never deleted
*/
readonly deleteAfter?: Duration;

/**
* Specifies the duration after creation that a copied recovery point is moved to cold storage.
*
* @default - recovery point is never moved to cold storage
*/
readonly moveToColdStorageAfter?: Duration;
}

/**
Expand Down Expand Up @@ -185,6 +217,19 @@ export class BackupPlanRule {
throw new Error(`'deleteAfter' must be between 1 and 35 days if 'enableContinuousBackup' is enabled, but got ${props.deleteAfter.toHumanString()}`);
}

if (props.copyActions && props.copyActions.length > 0) {
props.copyActions.forEach(copyAction => {
if (copyAction.deleteAfter && !Token.isUnresolved(copyAction.deleteAfter) &&
copyAction.moveToColdStorageAfter && !Token.isUnresolved(copyAction.moveToColdStorageAfter) &&
copyAction.deleteAfter.toDays() < copyAction.moveToColdStorageAfter.toDays() + 90) {
throw new Error([
'\'deleteAfter\' must at least 90 days later than corresponding \'moveToColdStorageAfter\'',
`received 'deleteAfter: ${copyAction.deleteAfter.toDays()}' and 'moveToColdStorageAfter: ${copyAction.moveToColdStorageAfter.toDays()}'`,
].join('\n'));
}
});
}

this.props = {
...props,
deleteAfter,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "20.0.0",
"version": "21.0.0",
"files": {
"8001d34381bcb57b7b2a8fb3ade1e27b0ea7c1819c1d3973537e2cb5aa604ce7": {
"14e034eeffbdd95a18b6c1a8c7a4876e1dfbedde51220bb1a196a337a6848c16": {
"source": {
"path": "cdk-backup.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "8001d34381bcb57b7b2a8fb3ade1e27b0ea7c1819c1d3973537e2cb5aa604ce7.json",
"objectKey": "14e034eeffbdd95a18b6c1a8c7a4876e1dfbedde51220bb1a196a337a6848c16.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"SecondaryVault67665B5E": {
"Type": "AWS::Backup::BackupVault",
"Properties": {
"BackupVaultName": "cdkbackupSecondaryVaultA01C2A0E",
"LockConfiguration": {
"MinRetentionDays": 5
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"PlanDAF4E53A": {
"Type": "AWS::Backup::BackupPlan",
"Properties": {
Expand Down Expand Up @@ -84,6 +95,29 @@
"BackupVaultName"
]
}
},
{
"CopyActions": [
{
"DestinationBackupVaultArn": {
"Fn::GetAtt": [
"SecondaryVault67665B5E",
"BackupVaultArn"
]
},
"Lifecycle": {
"DeleteAfterDays": 120,
"MoveToColdStorageAfterDays": 30
}
}
],
"RuleName": "PlanRule3",
"TargetBackupVault": {
"Fn::GetAtt": [
"Vault23237E5B",
"BackupVaultName"
]
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"20.0.0"}
{"version":"21.0.0"}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "20.0.0",
"version": "21.0.0",
"testCases": {
"integ.backup": {
"stacks": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "20.0.0",
"version": "21.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand All @@ -23,7 +23,7 @@
"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}/8001d34381bcb57b7b2a8fb3ade1e27b0ea7c1819c1d3973537e2cb5aa604ce7.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/14e034eeffbdd95a18b6c1a8c7a4876e1dfbedde51220bb1a196a337a6848c16.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down Expand Up @@ -57,6 +57,12 @@
"data": "Vault23237E5B"
}
],
"/cdk-backup/SecondaryVault/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "SecondaryVault67665B5E"
}
],
"/cdk-backup/Plan/Resource": [
{
"type": "aws:cdk:logicalId",
Expand Down
Loading

0 comments on commit caf7c55

Please sign in to comment.