Skip to content

Commit

Permalink
migrate
Browse files Browse the repository at this point in the history
Signed-off-by: Francis <colifran@amazon.com>
  • Loading branch information
colifran committed Dec 8, 2023
1 parent f2504ae commit 98cbe11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions packages/aws-cdk-lib/aws-ecr/lib/repository.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { EOL } from 'os';
import * as path from 'path';
import { IConstruct, Construct } from 'constructs';
import { CfnRepository } from './ecr.generated';
import { LifecycleRule, TagStatus } from './lifecycle';
Expand All @@ -18,10 +17,9 @@ import {
Token,
TokenComparison,
CustomResource,
CustomResourceProvider,
CustomResourceProviderRuntime,
Aws,
} from '../../core';
import { AutoDeleteImagesProvider } from '../../custom-resource-handlers/dist/aws-ecr/auto-delete-images-provider.generated';

const AUTO_DELETE_IMAGES_RESOURCE_TYPE = 'Custom::ECRAutoDeleteImages';
const AUTO_DELETE_IMAGES_TAG = 'aws-cdk:auto-delete-images';
Expand Down Expand Up @@ -863,10 +861,8 @@ export class Repository extends RepositoryBase {

private enableAutoDeleteImages() {
const firstTime = Stack.of(this).node.tryFindChild(`${AUTO_DELETE_IMAGES_RESOURCE_TYPE}CustomResourceProvider`) === undefined;
const provider = CustomResourceProvider.getOrCreateProvider(this, AUTO_DELETE_IMAGES_RESOURCE_TYPE, {
codeDirectory: path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-ecr', 'auto-delete-images-handler'),
const provider = AutoDeleteImagesProvider.getOrCreateProvider(this, AUTO_DELETE_IMAGES_RESOURCE_TYPE, {
useCfnResponseWrapper: false,
runtime: CustomResourceProviderRuntime.NODEJS_18_X,
description: `Lambda function for auto-deleting images in ${this.repositoryName} repository.`,
});

Expand Down
8 changes: 2 additions & 6 deletions packages/aws-cdk-lib/aws-s3/lib/bucket.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { EOL } from 'os';
import * as path from 'path';
import { Construct } from 'constructs';
import { BucketPolicy } from './bucket-policy';
import { IBucketNotificationDestination } from './destination';
Expand All @@ -13,7 +12,6 @@ import * as iam from '../../aws-iam';
import * as kms from '../../aws-kms';
import {
CustomResource,
CustomResourceProvider,
Duration,
FeatureFlags,
Fn,
Expand All @@ -27,9 +25,9 @@ import {
Token,
Tokenization,
Annotations,
CustomResourceProviderRuntime,
} from '../../core';
import { CfnReference } from '../../core/lib/private/cfn-reference';
import { AutoDeleteObjectsProvider } from '../../custom-resource-handlers/dist/aws-s3/auto-delete-objects-provider.generated';
import * as cxapi from '../../cx-api';
import * as regionInformation from '../../region-info';

Expand Down Expand Up @@ -2466,10 +2464,8 @@ export class Bucket extends BucketBase {
}

private enableAutoDeleteObjects() {
const provider = CustomResourceProvider.getOrCreateProvider(this, AUTO_DELETE_OBJECTS_RESOURCE_TYPE, {
codeDirectory: path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-s3', 'auto-delete-objects-handler'),
const provider = AutoDeleteObjectsProvider.getOrCreateProvider(this, AUTO_DELETE_OBJECTS_RESOURCE_TYPE, {
useCfnResponseWrapper: false,
runtime: CustomResourceProviderRuntime.NODEJS_18_X,
description: `Lambda function for auto-deleting objects in ${this.bucketName} S3 bucket.`,
});

Expand Down

0 comments on commit 98cbe11

Please sign in to comment.