From 790a709d758333f4622c5fb860d9bbb48dee7106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastiaan?= <78153680+SebastiaanSafeguard@users.noreply.github.com> Date: Thu, 2 Mar 2023 18:29:49 +0100 Subject: [PATCH 1/3] fix(lambda-nodejs): esbuild preCompilation tsconfig precedence is wrong (#23871) The current implementation of the `extractTsConfig` function overrides previously found compiler options by new ones in extended files. So if you override parameters in your tsconfig.json that extends from a different one higher up in the project, the parameters in the base configuration file take precedence over those in the tsconfig that is specified for this specific build task. This change turns around the importance of those parameters so that it matches the behaviour of tsc, where any parameters in the tsconfig override those of the tsconfigs it may extend from. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk/aws-lambda-nodejs/lib/util.ts | 2 +- .../test/testtsconfig-extended.json | 6 ++++ .../aws-lambda-nodejs/test/util.test.ts | 33 +++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 packages/@aws-cdk/aws-lambda-nodejs/test/testtsconfig-extended.json diff --git a/packages/@aws-cdk/aws-lambda-nodejs/lib/util.ts b/packages/@aws-cdk/aws-lambda-nodejs/lib/util.ts index eb2f59db03e09..fafac54e9a60e 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/lib/util.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/lib/util.ts @@ -197,8 +197,8 @@ function extractTsConfig(tsconfigPath: string, previousCompilerOptions?: Record< // eslint-disable-next-line @typescript-eslint/no-require-imports const { extends: extendedConfig, compilerOptions } = require(tsconfigPath); const updatedCompilerOptions = { - ...(previousCompilerOptions ?? {}), ...compilerOptions, + ...(previousCompilerOptions ?? {}), }; if (extendedConfig) { return extractTsConfig( diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/testtsconfig-extended.json b/packages/@aws-cdk/aws-lambda-nodejs/test/testtsconfig-extended.json new file mode 100644 index 0000000000000..d84edea2e872b --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/testtsconfig-extended.json @@ -0,0 +1,6 @@ +{ + "extends": "./testtsconfig.json", + "compilerOptions": { + "target": "ES2022" + } +} diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/util.test.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/util.test.ts index a0b27157b8a98..6ea345f505721 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/util.test.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/util.test.ts @@ -213,4 +213,37 @@ describe('getTsconfigCompilerOptions', () => { '--target ES2020', ].join(' ')); }); + + test('should extract compiler options with extended config overriding', () => { + const tsconfig = path.join(__dirname, 'testtsconfig-extended.json'); + const compilerOptions = getTsconfigCompilerOptions(tsconfig); + expect(compilerOptions).toEqual([ + '--alwaysStrict', + '--charset utf8', + '--declaration', + '--declarationMap false', + '--experimentalDecorators', + '--incremental false', + '--inlineSourceMap', + '--inlineSources', + '--lib es2020', + '--module CommonJS', + '--newLine lf', + '--noEmitOnError', + '--noFallthroughCasesInSwitch', + '--noImplicitAny', + '--noImplicitReturns', + '--noImplicitThis', + '--noUnusedLocals', + '--noUnusedParameters', + '--outDir ./', + '--resolveJsonModule', + '--rootDir ./', + '--strict', + '--strictNullChecks', + '--strictPropertyInitialization', + '--stripInternal false', + '--target ES2022', + ].join(' ')); + }); }); From 154b8e3921494ca0b33298522e2036ded1c485e8 Mon Sep 17 00:00:00 2001 From: watany <76135106+watany-dev@users.noreply.github.com> Date: Fri, 3 Mar 2023 03:38:34 +0900 Subject: [PATCH 2/3] chore(rds): RDS VersionUP follow-up in 2023.3 (#24426) A day after the last commit, we got a bunch of updates! A bit frustrating:) - [Amazon RDS for PostgreSQL now supports major version PostgreSQL 15](https://aws.amazon.com/about-aws/whats-new/2023/02/amazon-rds-postgresql-major-version-15/) - [Amazon RDS for MariaDB supports new minor versions 10.6.12, 10.5.19, 10.4.28 and 10.3.38](https://aws.amazon.com/about-aws/whats-new/2023/02/amazon-rds-mariadb-new-minor-versions/) - [Amazon Aurora MySQL 3.03 (compatible with MySQL 8.0.26) is generally available](https://aws.amazon.com/about-aws/whats-new/2023/03/amazon-aurora-mysql-3-03-compatible-mysql-8-0-26-available/) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-rds/lib/cluster-engine.ts | 2 ++ packages/@aws-cdk/aws-rds/lib/instance-engine.ts | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts b/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts index 6c61051c5938f..760abe90ac27e 100644 --- a/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts +++ b/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts @@ -426,6 +426,8 @@ export class AuroraMysqlEngineVersion { public static readonly VER_3_02_1 = AuroraMysqlEngineVersion.builtIn_8_0('3.02.1'); /** Version "8.0.mysql_aurora.3.02.2". */ public static readonly VER_3_02_2 = AuroraMysqlEngineVersion.builtIn_8_0('3.02.2'); + /** Version "8.0.mysql_aurora.3.03.0". */ + public static readonly VER_3_03_0 = AuroraMysqlEngineVersion.builtIn_8_0('3.03.0'); /** * Create a new AuroraMysqlEngineVersion with an arbitrary version. diff --git a/packages/@aws-cdk/aws-rds/lib/instance-engine.ts b/packages/@aws-cdk/aws-rds/lib/instance-engine.ts index 11f2e7cf2d1c3..77fb08ffb0ad5 100644 --- a/packages/@aws-cdk/aws-rds/lib/instance-engine.ts +++ b/packages/@aws-cdk/aws-rds/lib/instance-engine.ts @@ -313,6 +313,8 @@ export class MariaDbEngineVersion { public static readonly VER_10_3_36 = MariaDbEngineVersion.of('10.3.36', '10.3'); /** Version "10.3.37". */ public static readonly VER_10_3_37 = MariaDbEngineVersion.of('10.3.37', '10.3'); + /** Version "10.3.38". */ + public static readonly VER_10_3_38 = MariaDbEngineVersion.of('10.3.38', '10.3'); /** Version "10.4" (only a major version, without a specific minor version). */ public static readonly VER_10_4 = MariaDbEngineVersion.of('10.4', '10.4'); @@ -334,6 +336,8 @@ export class MariaDbEngineVersion { public static readonly VER_10_4_26 = MariaDbEngineVersion.of('10.4.26', '10.4'); /** Version "10.4.27". */ public static readonly VER_10_4_27 = MariaDbEngineVersion.of('10.4.27', '10.4') + /** Version "10.4.28". */ + public static readonly VER_10_4_28 = MariaDbEngineVersion.of('10.4.28', '10.4') /** Version "10.5" (only a major version, without a specific minor version). */ public static readonly VER_10_5 = MariaDbEngineVersion.of('10.5', '10.5'); @@ -353,6 +357,8 @@ export class MariaDbEngineVersion { public static readonly VER_10_5_17 = MariaDbEngineVersion.of('10.5.17', '10.5'); /** Version "10.5.18". */ public static readonly VER_10_5_18 = MariaDbEngineVersion.of('10.5.18', '10.5'); + /** Version "10.5.19". */ + public static readonly VER_10_5_19 = MariaDbEngineVersion.of('10.5.19', '10.5'); /** Version "10.6" (only a major version, without a specific minor version). */ public static readonly VER_10_6 = MariaDbEngineVersion.of('10.6', '10.6'); @@ -366,6 +372,9 @@ export class MariaDbEngineVersion { public static readonly VER_10_6_10 = MariaDbEngineVersion.of('10.6.10', '10.6'); /** Version "10.6.11". */ public static readonly VER_10_6_11 = MariaDbEngineVersion.of('10.6.11', '10.6'); + /** Version "10.6.12". */ + public static readonly VER_10_6_12 = MariaDbEngineVersion.of('10.6.12', '10.6'); + /** * Create a new MariaDbEngineVersion with an arbitrary version. @@ -1038,6 +1047,9 @@ export class PostgresEngineVersion { /** Version "14.6". */ public static readonly VER_14_6 = PostgresEngineVersion.of('14.6', '14', { s3Import: true, s3Export: true }); + /** Version "15" (only a major version, without a specific minor version). */ + public static readonly VER_15 = PostgresEngineVersion.of('15', '15', { s3Import: true, s3Export: true }); + /** * Create a new PostgresEngineVersion with an arbitrary version. * @@ -1335,7 +1347,6 @@ export class OracleEngineVersion { /** Version "19.0.0.0.ru-2023-01.rur-2023-01.r1". */ public static readonly VER_19_0_0_0_2023_01_R1 = OracleEngineVersion.of('19.0.0.0.ru-2023-01.rur-2023-01.r1', '19'); - /** Version "21" (only a major version, without a specific minor version). */ public static readonly VER_21 = OracleEngineVersion.of('21', '21'); /** Version "21.0.0.0.ru-2022-01.rur-2022-01.r1". */ From 856defb8a682af69e20d9af31e0c8a9c25ba8f6c Mon Sep 17 00:00:00 2001 From: watany <76135106+watany-dev@users.noreply.github.com> Date: Fri, 3 Mar 2023 04:21:39 +0900 Subject: [PATCH 3/3] chore(config): AWS Config now supports 20 new resource types (#24424) fix. https://aws.amazon.com/about-aws/whats-new/2023/02/aws-config-20-resource-types/ ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-config/lib/rule.ts | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/packages/@aws-cdk/aws-config/lib/rule.ts b/packages/@aws-cdk/aws-config/lib/rule.ts index 679e67ae50999..846006d990de1 100644 --- a/packages/@aws-cdk/aws-config/lib/rule.ts +++ b/packages/@aws-cdk/aws-config/lib/rule.ts @@ -2168,6 +2168,10 @@ export class ResourceType { public static readonly EFS_ACCESS_POINT = new ResourceType('AWS::EFS::AccessPoint'); /** Amazon Elastic Kubernetes Service cluster */ public static readonly EKS_CLUSTER = new ResourceType('AWS::EKS::Cluster'); + /** Amazon Elastic Kubernetes Service identity provider config */ + public static readonly EKS_IDENTITY_PROVIDER_CONFIG = new ResourceType('AWS::EKS::IdentityProviderConfig'); + /** Amazon Elastic Kubernetes Service addon */ + public static readonly EKS_ADDON = new ResourceType('AWS::EKS::Addon'); /** Amazon EMR security configuration */ public static readonly EMR_SECURITY_CONFIGURATION = new ResourceType('AWS::EMR::SecurityConfiguration'); /** Amazon EventBridge EventBus */ @@ -2202,6 +2206,12 @@ export class ResourceType { public static readonly GUARDDUTY_FILTER = new ResourceType('AWS::GuardDuty::Filter'); /** Amazon ElasticSearch domain */ public static readonly ELASTICSEARCH_DOMAIN = new ResourceType('AWS::Elasticsearch::Domain'); + /** Amazon Interactive Video Service (IVS) channel */ + public static readonly IVS_CHANNEL = new ResourceType('AWS::IVS::Channel'); + /** Amazon Interactive Video Service (IVS) recording configuration */ + public static readonly IVS_RECORDING_CONFIGURATION = new ResourceType('AWS::IVS::RecordingConfiguration'); + /** Amazon Interactive Video Service (IVS) playback key pair */ + public static readonly IVS_PLAYBACK_KEYPAIR = new ResourceType('AWS::IVS::PlaybackKeyPair'); /** Amazon OpenSearch domain */ public static readonly OPENSEARCH_DOMAIN = new ResourceType('AWS::OpenSearch::Domain'); /** Amazon QLDB ledger */ @@ -2210,6 +2220,8 @@ export class ResourceType { public static readonly KINESIS_STREAM = new ResourceType('AWS::Kinesis::Stream'); /** Amazon Kinesis stream consumer */ public static readonly KINESIS_STREAM_CONSUMER = new ResourceType('AWS::Kinesis::StreamConsumer'); + /** Amazon Kinesis Analytics V2 application */ + public static readonly KINESIS_ANALYTICS_V2_APPLICATION = new ResourceType('AWS::KinesisAnalyticsV2::Application'); /** Amazon Lightsail Certificate */ public static readonly LIGHTSAIL_CERTIFICATE = new ResourceType('AWS::Lightsail::Certificate'); /** Amazon Lightsail Disk */ @@ -2248,6 +2260,8 @@ export class ResourceType { public static readonly RDS_DB_CLUSTER = new ResourceType('AWS::RDS::DBCluster'); /** Amazon RDS database cluster snapshot */ public static readonly RDS_DB_CLUSTER_SNAPSHOT = new ResourceType('AWS::RDS::DBClusterSnapshot'); + /** Amazon RDS global cluster */ + public static readonly RDS_GLOBAL_CLUSTER = new ResourceType('AWS::RDS::GlobalCluster'); /** Amazon Route53 Hosted Zone */ public static readonly ROUTE53_HOSTED_ZONE= new ResourceType('AWS::Route53::HostedZone'); /** Amazon Route53 Health Check */ @@ -2270,6 +2284,8 @@ export class ResourceType { public static readonly SNS_TOPIC = new ResourceType('AWS::SNS::Topic'); /** Amazon S3 bucket */ public static readonly S3_BUCKET = new ResourceType('AWS::S3::Bucket'); + /** Amazon S3 Multi-Region Access Point */ + public static readonly S3_MULTIREGION_ACCESS_POINT = new ResourceType('AWS::S3::MultiRegionAccessPoint'); /** Amazon SageMaker code repository */ public static readonly SAGEMAKER_CODE_REPOSITORY = new ResourceType('AWS::SageMaker::CodeRepository'); /** Amazon SageMaker model */ @@ -2408,6 +2424,8 @@ export class ResourceType { public static readonly GLUE_JOB = new ResourceType('AWS::Glue::Job'); /** AWS Glue Classifier */ public static readonly GLUE_CLASSIFIER = new ResourceType('AWS::Glue::Classifier'); + /** AWS Glue machine learning transform */ + public static readonly GLUE_ML_TRANSFORM = new ResourceType('AWS::Glue::MLTransform'); /** AWS IAM user */ public static readonly IAM_USER = new ResourceType('AWS::IAM::User'); /** AWS IAM group */ @@ -2426,14 +2444,36 @@ export class ResourceType { public static readonly IOT_ROLE_ALIAS = new ResourceType('AWS::IoT::RoleAlias'); /** AWS IoT dimension */ public static readonly IOT_DIMENSION = new ResourceType('AWS::IoT::Dimension'); + /** AWS IoT policy */ + public static readonly IOT_POLICY = new ResourceType('AWS::IoT::Policy'); + /** AWS IoT mitigation action */ + public static readonly IOT_MITIGATION_ACTION = new ResourceType('AWS::IoT::MitigationAction'); + /** AWS IoT TwinMaker workspace */ + public static readonly IOT_TWINMAKER_WORKSPACE = new ResourceType('AWS::IoTwinMaker::Workspace'); + /** AWS IoT TwinMaker entity */ + public static readonly IOT_TWINMAKER_ENTITY = new ResourceType('AWS::IoTTwinMaker::Entity'); /** AWS IoT Analytics datastore */ public static readonly IOT_ANALYTICS_DATASTORE = new ResourceType('AWS::IoTAnalytics::Datastore'); + /** AWS IoT Analytics dataset */ + public static readonly IOT_ANALYTICS_DATASET = new ResourceType('AWS::IoTAnalytics::Dataset'); + /** AWS IoT Analytics pipeline */ + public static readonly IOT_ANALYTICS_PIPELINE = new ResourceType('AWS::IoTAnalytics::Pipeline'); + /** AWS IoT Analytics channel */ + public static readonly IOT_ANALYTICS_CHANNEL = new ResourceType('AWS::IoTAnalytics::Channel'); /** AWS IoT Events Input */ public static readonly IOT_EVENTS_INPUT = new ResourceType('AWS::IoTEvents::Input'); /** AWS IoT Events Detector Model */ public static readonly IOT_EVENTS_DETECTOR_MODEL = new ResourceType('AWS::IoTEvents::DetectorModel'); /** AWS IoT Events Alarm Model */ public static readonly IOT_EVENTS_ALARM_MODEL = new ResourceType('AWS::IoTEvents::AlarmModel'); + /** AWS IoT SiteWise dashboard */ + public static readonly IOT_SITEWISE_DASHBOARD = new ResourceType('AWS::IoTSiteWise::Dashboard'); + /** AWS IoT SiteWise project */ + public static readonly IOT_SITEWISE_PROJECT = new ResourceType('AWS::IoTSiteWise::Project'); + /** AWS IoT SiteWise portal */ + public static readonly IOT_SITEWISE_PORTAL = new ResourceType('AWS::IoTSiteWise::Portal'); + /** AWS IoT SiteWise asset model */ + public static readonly IOT_SITEWISE_ASSETMODEL = new ResourceType('AWS::IoTSiteWise::AssetModel'); /** AWS KMS Key */ public static readonly KMS_KEY = new ResourceType('AWS::KMS::Key'); /** AWS Lambda function */