Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions layers/src/canary-stack.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { randomUUID } from 'node:crypto';
import path from 'node:path';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { CustomResource, Duration, Stack, type StackProps } from 'aws-cdk-lib';
import { Effect, PolicyStatement } from 'aws-cdk-lib/aws-iam';
import { LayerVersion, Runtime, Tracing } from 'aws-cdk-lib/aws-lambda';
Expand All @@ -15,6 +16,9 @@ export interface CanaryStackProps extends StackProps {
readonly ssmParameterLayerArn: string;
}

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

export class CanaryStack extends Stack {
public constructor(scope: Construct, id: string, props: CanaryStackProps) {
super(scope, id, props);
Expand All @@ -36,7 +40,7 @@ export class CanaryStack extends Stack {
];

const canaryFunction = new NodejsFunction(this, 'CanaryFunction', {
entry: path.join(
entry: join(
__dirname,
'../tests/e2e/layerPublisher.class.test.functionCode.ts'
),
Expand Down
6 changes: 5 additions & 1 deletion layers/src/layer-publisher-stack.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { execSync } from 'node:child_process';
import { randomUUID } from 'node:crypto';
import { join, resolve, sep } from 'node:path';
import { dirname, join, resolve, sep } from 'node:path';
import { fileURLToPath } from 'node:url';
import { CfnOutput, RemovalPolicy, Stack, type StackProps } from 'aws-cdk-lib';
import {
Architecture,
Expand All @@ -12,6 +13,9 @@ import {
import { StringParameter } from 'aws-cdk-lib/aws-ssm';
import type { Construct } from 'constructs';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

export interface LayerPublisherStackProps extends StackProps {
readonly layerName?: string;
readonly powertoolsPackageVersion?: string;
Expand Down