@@ -27,6 +27,27 @@ export function getComposePath(type: string, fixture: Fixture, isLocal: boolean)
27
27
'./package.json:/cube/conf/package.json' ,
28
28
'./model/ecommerce.yaml:/cube/conf/model/ecommerce.yaml' ,
29
29
] ;
30
+
31
+ // Add AWS credential mounting for IRSA-enabled tests
32
+ if ( process . env . AWS_ACCESS_KEY_ID && process . env . AWS_SECRET_ACCESS_KEY && process . env . AWS_SESSION_TOKEN ) {
33
+ const awsCredentialsDir = path . resolve ( _path , '.aws' ) ;
34
+ fs . ensureDirSync ( awsCredentialsDir ) ;
35
+
36
+ const credentialsContent = `[default]
37
+ aws_access_key_id = ${ process . env . AWS_ACCESS_KEY_ID }
38
+ aws_secret_access_key = ${ process . env . AWS_SECRET_ACCESS_KEY }
39
+ aws_session_token = ${ process . env . AWS_SESSION_TOKEN }
40
+ ` ;
41
+
42
+ const configContent = `[default]
43
+ region = ${ process . env . AWS_REGION || process . env . AWS_DEFAULT_REGION || 'us-west-1' }
44
+ ` ;
45
+
46
+ fs . writeFileSync ( path . resolve ( awsCredentialsDir , 'credentials' ) , credentialsContent ) ;
47
+ fs . writeFileSync ( path . resolve ( awsCredentialsDir , 'config' ) , configContent ) ;
48
+
49
+ volumes . push ( './.aws:/root/.aws:ro' ) ;
50
+ }
30
51
const compose : any = {
31
52
version : '2.2' ,
32
53
services : {
@@ -46,6 +67,9 @@ export function getComposePath(type: string, fixture: Fixture, isLocal: boolean)
46
67
image : `cubejs/cubestore:${ process . arch === 'arm64' ? 'arm64v8' : 'latest' } ` ,
47
68
ports : [ '3030' ] ,
48
69
restart : 'always' ,
70
+ ...( process . env . AWS_ACCESS_KEY_ID && process . env . AWS_SECRET_ACCESS_KEY && process . env . AWS_SESSION_TOKEN ? {
71
+ volumes : [ './.aws:/root/.aws:ro' ]
72
+ } : { } )
49
73
}
50
74
}
51
75
} ;
0 commit comments