From 721c59f6f1e94f69820856186f59e7e4bea55bc7 Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 7 Dec 2023 18:21:19 -0800 Subject: [PATCH] migrate Signed-off-by: Francis --- packages/aws-cdk-lib/aws-iam/lib/oidc-provider.ts | 8 ++------ .../aws-cdk-lib/core/lib/private/cfn-utils-provider.ts | 8 ++++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/aws-cdk-lib/aws-iam/lib/oidc-provider.ts b/packages/aws-cdk-lib/aws-iam/lib/oidc-provider.ts index c7456b5867463..b8c5494038a24 100644 --- a/packages/aws-cdk-lib/aws-iam/lib/oidc-provider.ts +++ b/packages/aws-cdk-lib/aws-iam/lib/oidc-provider.ts @@ -1,14 +1,12 @@ -import * as path from 'path'; import { Construct } from 'constructs'; import { Arn, CustomResource, - CustomResourceProvider, - CustomResourceProviderRuntime, IResource, Resource, Token, } from '../../core'; +import { OidcProvider } from '../../custom-resource-handlers/dist/aws-iam/oidc-provider.generated'; const RESOURCE_TYPE = 'Custom::AWSCDKOpenIdConnectProvider'; @@ -162,9 +160,7 @@ export class OpenIdConnectProvider extends Resource implements IOpenIdConnectPro } private getOrCreateProvider() { - return CustomResourceProvider.getOrCreateProvider(this, RESOURCE_TYPE, { - codeDirectory: path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-iam', 'oidc-handler'), - runtime: CustomResourceProviderRuntime.NODEJS_18_X, + return OidcProvider.getOrCreateProvider(this, RESOURCE_TYPE, { policyStatements: [ { Effect: 'Allow', diff --git a/packages/aws-cdk-lib/core/lib/private/cfn-utils-provider.ts b/packages/aws-cdk-lib/core/lib/private/cfn-utils-provider.ts index c41331c2702fe..16358347185d6 100644 --- a/packages/aws-cdk-lib/core/lib/private/cfn-utils-provider.ts +++ b/packages/aws-cdk-lib/core/lib/private/cfn-utils-provider.ts @@ -1,14 +1,18 @@ +import * as path from 'path'; import { Construct } from 'constructs'; import { CfnUtilsResourceType } from './cfn-utils-provider/consts'; -import { CdkCfnUtilsProvider } from '../../../custom-resource-handlers/dist/core/cfn-utils-provider.generated'; import { CustomResource } from '../custom-resource'; +import { CustomResourceProvider, CustomResourceProviderRuntime } from '../custom-resource-provider'; /** * A custom resource provider for CFN utilities such as `CfnJson`. */ export class CfnUtilsProvider extends Construct { public static getOrCreate(scope: Construct) { - return CdkCfnUtilsProvider.getOrCreate(scope, 'AWSCDKCfnUtilsProvider', {}); + return CustomResourceProvider.getOrCreate(scope, 'AWSCDKCfnUtilsProvider', { + runtime: CustomResourceProviderRuntime.NODEJS_18_X, + codeDirectory: path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'core', 'cfn-utils-provider'), + }); } }