Skip to content

Commit a6c0288

Browse files
authored
ci(integ-runner): fix deployment to incorrect region (#36143)
### Reason for this change Integ runner does not deploy to the correct regions that have been set to be bootstrapped. ### Description of changes Updates the integ-runner version which fixes this bug. Fix is detailed in aws/aws-cdk-cli#949 As the new version changes the default CWD of integ tests, some integ tests had to be modified to use __dirname to lookup local assets files. ### Describe any new or updated permissions being added No new permissions are added. ### Description of how you validated changes Fix is confirmed with local fork run: https://github.com/Abogical/aws-cdk/actions/runs/19569552896/job/56039507543 ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 4361f8b commit a6c0288

File tree

58 files changed

+88
-73
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+88
-73
lines changed

packages/@aws-cdk-testing/framework-integ/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"license": "Apache-2.0",
3131
"devDependencies": {
3232
"@aws-cdk/cdk-build-tools": "0.0.0",
33-
"@aws-cdk/integ-runner": "^2.190.2",
33+
"@aws-cdk/integ-runner": "^2.192.2",
3434
"@aws-cdk/pkglint": "0.0.0",
3535
"@aws-sdk/client-acm": "3.632.0",
3636
"@aws-sdk/client-rds": "3.632.0",

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.configuration-kms.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ConfigurationContent,
77
HostedConfiguration,
88
} from 'aws-cdk-lib/aws-appconfig';
9+
import * as path from 'path';
910

1011
const app = new App();
1112

@@ -21,7 +22,7 @@ const appConfigApp = new Application(stack, 'MyAppConfig', {
2122

2223
new HostedConfiguration(stack, 'MyHostedConfigFromFile', {
2324
application: appConfigApp,
24-
content: ConfigurationContent.fromFile('config.json'),
25+
content: ConfigurationContent.fromFile(path.join(__dirname, 'config.json')),
2526
kmsKey,
2627
});
2728

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.configuration.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
RolloutStrategy,
2222
SourcedConfiguration,
2323
} from 'aws-cdk-lib/aws-appconfig';
24+
import * as path from 'path';
2425

2526
const SCHEMA_STR =
2627
`{
@@ -58,7 +59,7 @@ const deploymentStrategy = new DeploymentStrategy(stack, 'MyDeployStrategy', {
5859
// hosted config from file
5960
new HostedConfiguration(stack, 'MyHostedConfigFromFile', {
6061
application: appConfigApp,
61-
content: ConfigurationContent.fromFile('config.json'),
62+
content: ConfigurationContent.fromFile(path.join(__dirname, 'config.json')),
6263
deletionProtectionCheck: DeletionProtectionCheck.BYPASS,
6364
});
6465

@@ -70,7 +71,7 @@ new HostedConfiguration(stack, 'MyHostedConfig', {
7071
deployTo: [hostedEnv],
7172
validators: [
7273
JsonSchemaValidator.fromInline(SCHEMA_STR),
73-
JsonSchemaValidator.fromFile('schema.json'),
74+
JsonSchemaValidator.fromFile(path.join(__dirname, 'schema.json')),
7475
],
7576
deploymentStrategy,
7677
});
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import * as cdk from 'aws-cdk-lib';
22
import * as codecommit from 'aws-cdk-lib/aws-codecommit';
33
import { Code } from 'aws-cdk-lib/aws-codecommit';
4+
import * as path from 'path';
45

56
const app = new cdk.App();
67
const stack = new cdk.Stack(app, 'aws-cdk-codecommit-repo-contents-zip-file');
78

89
new codecommit.Repository(stack, 'Repo', {
910
repositoryName: 'aws-cdk-codecommit-repo-contents-zip-file',
10-
code: Code.fromZipFile('./asset-test.zip'),
11+
code: Code.fromZipFile(path.join(__dirname, 'asset-test.zip')),
1112
});
1213

1314
app.synth();
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import * as cdk from 'aws-cdk-lib';
22
import * as codecommit from 'aws-cdk-lib/aws-codecommit';
33
import { Code } from 'aws-cdk-lib/aws-codecommit';
4+
import * as path from 'path';
45

56
const app = new cdk.App();
67
const stack = new cdk.Stack(app, 'aws-cdk-codecommit-repo-contents-assets');
78

89
new codecommit.Repository(stack, 'Repo', {
910
repositoryName: 'aws-cdk-codecommit-repo-contents-assets',
10-
code: Code.fromDirectory('./asset-test'),
11+
code: Code.fromDirectory(path.join(__dirname, 'asset-test')),
1112
});
1213

1314
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import * as iam from 'aws-cdk-lib/aws-iam';
1111
import * as lambda from 'aws-cdk-lib/aws-lambda';
1212
import * as route53 from 'aws-cdk-lib/aws-route53';
1313
import * as route53targets from 'aws-cdk-lib/aws-route53-targets';
14+
import * as path from 'path';
1415

1516
interface CognitoUserProps {
1617
userPool: cognito.UserPool;
@@ -204,7 +205,7 @@ const testUser = new CognitoUser(testCase, 'User', cognitoUserProps);
204205
// this function signs in to the website and returns text content of the authenticated page body
205206
const signinFunction = new lambda.Function(testCase, 'Signin', {
206207
functionName: 'cdk-integ-alb-cognito-signin-handler',
207-
code: lambda.Code.fromAsset('alb-cognito-signin-handler', { exclude: ['*.ts'] }),
208+
code: lambda.Code.fromAsset(path.join(__dirname, 'alb-cognito-signin-handler'), { exclude: ['*.ts'] }),
208209
handler: 'index.handler',
209210
runtime: lambda.Runtime.NODEJS_20_X,
210211
environment: {

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import * as route53targets from 'aws-cdk-lib/aws-route53-targets';
1010
import { App, Duration, RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib/core';
1111
import { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId } from 'aws-cdk-lib/custom-resources';
1212
import { Construct } from 'constructs';
13+
import * as path from 'path';
1314

1415
interface CognitoUserProps {
1516
userPool: cognito.UserPool;
@@ -184,7 +185,7 @@ const testUser = new CognitoUser(testCase, 'User', cognitoUserProps);
184185
// this function signs in to the website and returns text content of the authenticated page body
185186
const signinFunction = new lambda.Function(testCase, 'Signin', {
186187
functionName: 'cdk-integ-alb-oidc-signin-handler',
187-
code: lambda.Code.fromAsset('alb-oidc-signin-handler', { exclude: ['*.ts'] }),
188+
code: lambda.Code.fromAsset(path.join(__dirname, 'alb-oidc-signin-handler'), { exclude: ['*.ts'] }),
188189
handler: 'index.handler',
189190
runtime: lambda.Runtime.NODEJS_20_X,
190191
environment: {

packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-snapstart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ new Function(stack, 'Python313SnapstartLambda', {
3333
});
3434

3535
new Function(stack, 'DotnetSnapstartLambda', {
36-
code: Code.fromAsset('dotnet-handler'),
36+
code: Code.fromAsset(path.join(__dirname, 'dotnet-handler')),
3737
handler: 'Handler',
3838
runtime: Runtime.DOTNET_8,
3939
snapStart: SnapStartConf.ON_PUBLISHED_VERSIONS,

packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-sourceKMSKeyArn.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class TestStack extends Stack {
8080
bucketName: 's3sourcekmskeyarnbucket',
8181
});
8282
const deployment = new s3deploy.BucketDeployment(this, 'DeployLambdaCode', {
83-
sources: [s3deploy.Source.asset('lambda-zip')],
83+
sources: [s3deploy.Source.asset(path.join(__dirname, 'lambda-zip'))],
8484
destinationBucket: bucket,
8585
});
8686
const fnBucket = new lambda.Function(this, 'myFunction2', {
@@ -96,7 +96,7 @@ class TestStack extends Stack {
9696
this.functionName2 = fnBucket.functionName;
9797

9898
// Using Custom Command
99-
const command = 'lambda-zip/python-lambda-handler.zip';
99+
const command = path.join(__dirname, 'lambda-zip/python-lambda-handler.zip');
100100
const fnCustom = new lambda.Function(this, 'myFunction3', {
101101
runtime: lambda.Runtime.PYTHON_3_11,
102102
handler: 'index.handler',

packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.runtimes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { App, Stack } from 'aws-cdk-lib';
22
import * as integ from '@aws-cdk/integ-tests-alpha';
33
import { Code, Function, Runtime } from 'aws-cdk-lib/aws-lambda';
4+
import * as path from 'path';
45

56
const app = new App({
67
postCliContext: {
@@ -11,7 +12,7 @@ const app = new App({
1112
const stack = new Stack(app, 'aws-cdk-lambda-runtime-management');
1213

1314
new Function(stack, 'Lambda', {
14-
code: Code.fromAsset('dotnet-handler'),
15+
code: Code.fromAsset(path.join(__dirname, 'dotnet-handler')),
1516
handler: 'Handler',
1617
runtime: Runtime.DOTNET_8,
1718
});

0 commit comments

Comments
 (0)