Skip to content

Commit

Permalink
updated aws custom resource provider and reverted changes in integ tests
Browse files Browse the repository at this point in the history
Signed-off-by: Francis <colifran@amazon.com>
  • Loading branch information
colifran committed Nov 29, 2023
1 parent fdaee2c commit 0b46310
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as cdk from 'aws-cdk-lib';
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';

const app = new cdk.App();
const stack = new cdk.Stack(app, 'dynamodb-global-replicas-provisioned');
const stack = new cdk.Stack(app, 'aws-cdkdynamodb-global-replicas-provisioned');

const table = new dynamodb.Table(stack, 'Table', {
partitionKey: { name: 'hashKey', type: dynamodb.AttributeType.STRING },
Expand All @@ -17,7 +17,7 @@ table.autoScaleWriteCapacity({
maxCapacity: 10,
}).scaleOnUtilization({ targetUtilizationPercent: 75 });

new IntegTest(app, 'aws-cdk-dynamodb-global-replicas-provisioned-integ', {
new IntegTest(app, 'aws-cdk-dynamodb-global-replicas-provisioned-test', {
testCases: [stack],
diffAssets: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class TestStack extends Stack {
}

const app = new App();
const stack = new TestStack(app, 'cdk-dynamodb-global', { env: { region: 'eu-west-1' } });
const stack = new TestStack(app, 'cdk-dynamodb-global-20191121', { env: { region: 'eu-west-1' } });

new IntegTest(app, 'cdk-dynamodb-global-integ', {
new IntegTest(app, 'cdk-dynamodb-global-integ-20191121-test', {
testCases: [stack],
diffAssets: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IntegTest } from '@aws-cdk/integ-tests-alpha';

const app = new cdk.App();

const stack = new cdk.Stack(app, 'AwsCdkSesReceipt');
const stack = new cdk.Stack(app, 'aws-cdk-ses-receipt');

const ruleSet = new ses.ReceiptRuleSet(stack, 'RuleSet', {
dropSpam: true,
Expand All @@ -25,7 +25,7 @@ new ses.AllowListReceiptFilter(stack, 'Allowlist', {
],
});

new IntegTest(app, 'CdkSesReceiptInteg', {
new IntegTest(app, 'cdk-ses-receipt-integ', {
testCases: [stack],
diffAssets: true,
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import * as logs from '../../../aws-logs';
import * as cdk from '../../../core';
import { Annotations } from '../../../core';
import * as cxapi from '../../../cx-api';
import { CdkHandler } from '../../../handler-framework/lib/cdk-handler';
import { CdkSingletonFunction } from '../../../handler-framework/lib/cdk-singleton-function';
import { awsSdkToIamAction } from '../helpers-internal/sdk-info';

// Shared definition with packages/@aws-cdk/custom-resource-handlers/lib/custom-resources/aws-custom-resource-handler/shared.ts
Expand Down Expand Up @@ -446,10 +448,13 @@ export class AwsCustomResource extends Construct implements iam.IGrantable {

this.props = props;

const provider = new lambda.SingletonFunction(this, 'Provider', {
code: lambda.Code.fromAsset(path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'custom-resources', 'aws-custom-resource-handler')),
runtime: lambda.Runtime.NODEJS_18_X,
handler: 'index.handler',
const handler = new CdkHandler(this, 'Handler', {
codeDirectory: path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'custom-resources', 'aws-custom-resource-handler'),
compatibleRuntimes: [lambda.Runtime.NODEJS_LATEST],
});

const provider = new CdkSingletonFunction(this, 'Provider', {
handler,
uuid: AwsCustomResource.PROVIDER_FUNCTION_UUID,
lambdaPurpose: 'AWS',
timeout: props.timeout || cdk.Duration.minutes(2),
Expand Down

0 comments on commit 0b46310

Please sign in to comment.