Skip to content

Commit a6f8b31

Browse files
authored
Merge pull request #3297 from aws-amplify/main
Prep data release
2 parents 5bf229e + c7f066a commit a6f8b31

File tree

25 files changed

+4017
-260
lines changed

25 files changed

+4017
-260
lines changed

dependency_licenses.txt

Lines changed: 1346 additions & 64 deletions
Large diffs are not rendered by default.

packages/amplify-data-construct/.jsii

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@
66
]
77
},
88
"bundled": {
9-
"@aws-amplify/ai-constructs": "^1.2.4",
9+
"@aws-amplify/ai-constructs": "^1.5.3",
1010
"@aws-amplify/backend-output-schemas": "^1.0.0",
1111
"@aws-amplify/backend-output-storage": "^1.0.0",
12-
"@aws-amplify/graphql-auth-transformer": "4.2.2",
13-
"@aws-amplify/graphql-conversation-transformer": "1.1.10",
14-
"@aws-amplify/graphql-default-value-transformer": "3.1.12",
15-
"@aws-amplify/graphql-directives": "2.7.0",
16-
"@aws-amplify/graphql-function-transformer": "3.1.14",
17-
"@aws-amplify/graphql-generation-transformer": "1.2.2",
18-
"@aws-amplify/graphql-http-transformer": "3.0.17",
19-
"@aws-amplify/graphql-index-transformer": "3.0.17",
20-
"@aws-amplify/graphql-maps-to-transformer": "4.0.17",
21-
"@aws-amplify/graphql-model-transformer": "3.2.2",
22-
"@aws-amplify/graphql-predictions-transformer": "3.0.17",
23-
"@aws-amplify/graphql-relational-transformer": "3.1.9",
24-
"@aws-amplify/graphql-searchable-transformer": "3.0.17",
25-
"@aws-amplify/graphql-sql-transformer": "0.4.17",
26-
"@aws-amplify/graphql-transformer": "2.3.2",
27-
"@aws-amplify/graphql-transformer-core": "3.4.2",
28-
"@aws-amplify/graphql-transformer-interfaces": "4.2.5",
29-
"@aws-amplify/graphql-validate-transformer": "1.1.2",
12+
"@aws-amplify/graphql-auth-transformer": "4.2.3",
13+
"@aws-amplify/graphql-conversation-transformer": "1.1.11",
14+
"@aws-amplify/graphql-default-value-transformer": "3.1.13",
15+
"@aws-amplify/graphql-directives": "2.7.1",
16+
"@aws-amplify/graphql-function-transformer": "3.1.15",
17+
"@aws-amplify/graphql-generation-transformer": "1.2.3",
18+
"@aws-amplify/graphql-http-transformer": "3.0.18",
19+
"@aws-amplify/graphql-index-transformer": "3.0.18",
20+
"@aws-amplify/graphql-maps-to-transformer": "4.0.18",
21+
"@aws-amplify/graphql-model-transformer": "3.3.0",
22+
"@aws-amplify/graphql-predictions-transformer": "3.0.18",
23+
"@aws-amplify/graphql-relational-transformer": "3.1.10",
24+
"@aws-amplify/graphql-searchable-transformer": "3.0.18",
25+
"@aws-amplify/graphql-sql-transformer": "0.4.18",
26+
"@aws-amplify/graphql-transformer": "2.3.3",
27+
"@aws-amplify/graphql-transformer-core": "3.4.3",
28+
"@aws-amplify/graphql-transformer-interfaces": "4.2.6",
29+
"@aws-amplify/graphql-validate-transformer": "1.1.3",
3030
"@aws-amplify/platform-core": "^1.0.0",
3131
"@aws-amplify/plugin-types": "^1.0.0",
3232
"@aws-crypto/crc32": "5.2.0",
@@ -112,7 +112,7 @@
112112
"graceful-fs": "^4.2.0",
113113
"graphql": "^15.5.0",
114114
"graphql-mapping-template": "5.0.2",
115-
"graphql-transformer-common": "5.1.2",
115+
"graphql-transformer-common": "5.1.3",
116116
"hjson": "^3.2.2",
117117
"immer": "^9.0.12",
118118
"is-buffer": "~1.1.6",
@@ -134,7 +134,7 @@
134134
"zod": "^3.22.2"
135135
},
136136
"dependencies": {
137-
"@aws-amplify/graphql-api-construct": "1.20.0",
137+
"@aws-amplify/graphql-api-construct": "1.20.1",
138138
"aws-cdk-lib": "^2.187.0",
139139
"constructs": "^10.3.0"
140140
},
@@ -1375,6 +1375,19 @@
13751375
}
13761376
}
13771377
},
1378+
"aws-cdk-lib.aws_dsql": {
1379+
"targets": {
1380+
"dotnet": {
1381+
"package": "Amazon.CDK.AWS.DSQL"
1382+
},
1383+
"java": {
1384+
"package": "software.amazon.awscdk.services.dsql"
1385+
},
1386+
"python": {
1387+
"module": "aws_cdk.aws_dsql"
1388+
}
1389+
}
1390+
},
13781391
"aws-cdk-lib.aws_dynamodb": {
13791392
"targets": {
13801393
"dotnet": {
@@ -4108,6 +4121,6 @@
41084121
}
41094122
},
41104123
"types": {},
4111-
"version": "1.16.0",
4112-
"fingerprint": "70ZYr20/P49DYsGeCTZalWTrkNFkgnaynL80XG4us6w="
4124+
"version": "1.16.1",
4125+
"fingerprint": "OuvqXjsCW35ZIYVFFnyK5qGSezz23bufN1/EmytUUmQ="
41134126
}

packages/amplify-data-construct/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
"zod"
162162
],
163163
"dependencies": {
164-
"@aws-amplify/ai-constructs": "^1.2.4",
164+
"@aws-amplify/ai-constructs": "^1.5.3",
165165
"@aws-amplify/backend-output-schemas": "^1.0.0",
166166
"@aws-amplify/backend-output-storage": "^1.0.0",
167167
"@aws-amplify/graphql-api-construct": "1.20.1",
@@ -292,7 +292,7 @@
292292
"devDependencies": {
293293
"@types/fs-extra": "^8.0.1",
294294
"@types/node": "^20.0.0",
295-
"aws-cdk-lib": "2.187.0",
295+
"aws-cdk-lib": "2.189.1",
296296
"constructs": "10.3.0",
297297
"jsii": "^5.4.23",
298298
"jsii-pacmak": "^1.84.0",

packages/amplify-e2e-core/src/utils/credentials-rotator.ts

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import { AssumeRoleCommand, STSClient } from '@aws-sdk/client-sts';
22
import { fromContainerMetadata } from '@aws-sdk/credential-providers';
3-
import { generateRandomShortId, TEST_PROFILE_NAME } from './index';
43
import * as ini from 'ini';
54
import * as fs from 'fs-extra';
65
import { pathManager } from '@aws-amplify/amplify-cli-core';
7-
const refreshCredentials = async (roleArn: string) => {
6+
import { generateRandomShortId, TEST_PROFILE_NAME } from './index';
7+
8+
const refreshCredentials = async (roleArn: string, useCurrentCreds: boolean = false) => {
9+
let credentials = undefined;
10+
if (!useCurrentCreds) {
11+
credentials = fromContainerMetadata();
12+
}
813
const client = new STSClient({
9-
// Use CodeBuild role to assume test account role. I.e. don't read credentials from process.env
10-
credentials: fromContainerMetadata(),
14+
credentials,
1115
});
1216
const sessionName = `testSession${generateRandomShortId()}`;
1317
const command = new AssumeRoleCommand({
@@ -29,9 +33,15 @@ const refreshCredentials = async (roleArn: string) => {
2933
await fs.writeFile(pathManager.getAWSCredentialsFilePath(), ini.stringify(credentialsContents));
3034
};
3135

32-
const tryRefreshCredentials = async (roleArn: string) => {
36+
/**
37+
* Refresh the parent account. If child account is available, refresh that as well.
38+
*/
39+
const tryRefreshCredentials = async (parentRoleArn: string, childRoleArn?: string) => {
3340
try {
34-
await refreshCredentials(roleArn);
41+
await refreshCredentials(parentRoleArn);
42+
if (childRoleArn) {
43+
await refreshCredentials(childRoleArn, true);
44+
}
3545
console.log('Test profile credentials refreshed');
3646
} catch (e) {
3747
console.error('Test profile credentials request failed');
@@ -54,16 +64,24 @@ export const tryScheduleCredentialRefresh = () => {
5464
return;
5565
}
5666

57-
if (!process.env.USE_PARENT_ACCOUNT) {
58-
throw new Error('Credentials rotator supports only tests running in parent account at this time');
59-
}
67+
if (process.env.USE_PARENT_ACCOUNT) {
68+
// Attempts to refresh credentials in background every 10 minutes.
69+
setInterval(() => {
70+
void tryRefreshCredentials(process.env.TEST_ACCOUNT_ROLE);
71+
}, 10 * 60 * 1000);
6072

61-
// Attempts to refresh credentials in background every 15 minutes.
62-
setInterval(() => {
63-
void tryRefreshCredentials(process.env.TEST_ACCOUNT_ROLE);
64-
}, 15 * 60 * 1000);
73+
console.log('Test profile credentials refresh was scheduled for parent account');
74+
return;
75+
} else if (process.env.CHILD_ACCOUNT_ROLE) {
76+
// Attempts to refresh credentials in background every 10 minutes.
77+
setInterval(() => {
78+
void tryRefreshCredentials(process.env.TEST_ACCOUNT_ROLE, process.env.CHILD_ACCOUNT_ROLE);
79+
}, 10 * 60 * 1000);
6580

66-
isRotationBackgroundTaskAlreadyScheduled = true;
81+
console.log('Test profile credentials refresh was scheduled for child account');
82+
} else {
83+
throw new Error('Credentials rotator could not find any role to rotate credentials for');
84+
}
6785

68-
console.log('Test profile credentials refresh was scheduled');
86+
isRotationBackgroundTaskAlreadyScheduled = true;
6987
};

packages/amplify-e2e-tests/src/rds-v2-tests-common/rds-auth-oidc-fields.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
initJSProjectWithProfile,
1313
setupRDSInstanceAndData,
1414
sleep,
15+
tryScheduleCredentialRefresh,
1516
updateAuthAddUserGroups,
1617
} from 'amplify-category-api-e2e-core';
1718
import { existsSync, writeFileSync, removeSync } from 'fs-extra';
@@ -79,6 +80,7 @@ export const testOIDCFieldAuth = (engine: ImportedRDSType): void => {
7980
console.log(sqlCreateStatements(engine));
8081
projRoot = await createNewProjectDir(projName);
8182
await setupAmplifyProject();
83+
tryScheduleCredentialRefresh();
8284
});
8385

8486
afterAll(async () => {

packages/amplify-graphql-api-construct-tests/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"build-tests": "tsc --build tsconfig.tests.json"
2323
},
2424
"dependencies": {
25-
"@aws-amplify/auth-construct": "^1.0.0",
25+
"@aws-amplify/auth-construct": "1.8.0",
2626
"@aws-amplify/core": "^2.1.0",
2727
"@aws-amplify/graphql-api-construct": "1.20.1",
2828
"@aws-sdk/client-appsync": "3.624.0",
@@ -52,7 +52,7 @@
5252
"@aws-amplify/graphql-transformer-interfaces": "4.2.6",
5353
"@aws-amplify/graphql-validate-transformer": "1.1.3",
5454
"@types/node": "^20.0.0",
55-
"aws-cdk-lib": "2.187.0",
55+
"aws-cdk-lib": "2.189.1",
5656
"constructs": "10.3.0",
5757
"ts-node": "^8.10.2"
5858
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const authConstructDependency = '@aws-amplify/auth-construct@^1.0.0';
1+
export const authConstructDependency = '@aws-amplify/auth-construct@1.8.0';

packages/amplify-graphql-api-construct-tests/src/__tests__/migration/many-to-many-migration.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from 'path';
2-
import { createNewProjectDir, deleteProjectDir, deleteProject } from 'amplify-category-api-e2e-core';
2+
import { createNewProjectDir, deleteProjectDir, deleteProject, tryScheduleCredentialRefresh } from 'amplify-category-api-e2e-core';
33
import { initCDKProject, cdkDeploy, cdkDestroy, createGen1ProjectForMigration, deleteDDBTables } from '../../commands';
44
import { graphql } from '../../graphql-request';
55
import { TestDefinition, writeStackConfig, writeTestDefinitions, writeOverrides } from '../../utils';
@@ -14,6 +14,10 @@ describe('Many-to-many Migration', () => {
1414
let gen2ProjFolderName: string;
1515
let dataSourceMapping: Record<string, string>;
1616

17+
beforeAll(() => {
18+
tryScheduleCredentialRefresh();
19+
});
20+
1721
beforeEach(async () => {
1822
gen1ProjFolderName = 'mtmmigrationgen1';
1923
gen2ProjFolderName = 'mtmmigrationgen2';

packages/amplify-graphql-api-construct-tests/src/__tests__/migration/migration-validation.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from 'path';
2-
import { createNewProjectDir, deleteProjectDir, deleteProject } from 'amplify-category-api-e2e-core';
2+
import { createNewProjectDir, deleteProjectDir, deleteProject, tryScheduleCredentialRefresh } from 'amplify-category-api-e2e-core';
33
import { CloudFormationClient, ListStacksCommand, DescribeStackEventsCommand, StackEvent } from '@aws-sdk/client-cloudformation';
44
import { initCDKProject, cdkDeploy, cdkDestroy, createGen1ProjectForMigration, deleteDDBTables } from '../../commands';
55
import { TestDefinition, writeStackConfig, writeTestDefinitions, writeOverrides } from '../../utils';
@@ -15,6 +15,7 @@ describe('Migration table import validation', () => {
1515
let dataSourceMapping: Record<string, string>;
1616

1717
beforeAll(async () => {
18+
tryScheduleCredentialRefresh();
1819
gen1ProjFolderName = 'validategen1';
1920
gen1ProjRoot = await createNewProjectDir(gen1ProjFolderName);
2021

packages/amplify-graphql-api-construct-tests/src/__tests__/sql-pg-models.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { TestOptions } from '../utils/sql-test-config-helper';
55
import { DURATION_1_HOUR } from '../utils/duration-constants';
66
import { testGraphQLAPI } from '../sql-tests-common/sql-models';
77
import { sqlCreateStatements } from '../sql-tests-common/tests-sources/sql-models/provider';
8+
import { tryScheduleCredentialRefresh } from 'amplify-category-api-e2e-core';
89

910
jest.setTimeout(DURATION_1_HOUR);
1011

0 commit comments

Comments
 (0)