Skip to content

Commit

Permalink
Update data schema for e2e hotswappable test as per the new getting s…
Browse files Browse the repository at this point in the history
…tarted (#728)

* Updat data schema for e2e hotswappable test as per the new getting started

* update snapshots

* update snapshots

* upgrade aws-cdk to 2.110.1

* package lock

* add new changeset for aws-cdk upgrade
  • Loading branch information
Amplifiyer authored Nov 22, 2023
1 parent d06b5d8 commit 5ed51cb
Show file tree
Hide file tree
Showing 36 changed files with 1,579 additions and 1,230 deletions.
20 changes: 20 additions & 0 deletions .changeset/tender-rocks-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
'@aws-amplify/backend-platform-test-stubs': patch
'@aws-amplify/backend-output-storage': patch
'@aws-amplify/function-construct-alpha': patch
'@aws-amplify/integration-tests': patch
'@aws-amplify/storage-construct-alpha': patch
'@aws-amplify/backend-deployer': patch
'@aws-amplify/backend-function': patch
'@aws-amplify/backend-storage': patch
'@aws-amplify/auth-construct-alpha': patch
'create-amplify': patch
'@aws-amplify/platform-core': patch
'@aws-amplify/backend-auth': patch
'@aws-amplify/backend-data': patch
'@aws-amplify/plugin-types': patch
'@aws-amplify/backend': patch
'@aws-amplify/sandbox': patch
---

Upgrade aws-cdk to 2.110.1
5 changes: 5 additions & 0 deletions .changeset/two-pianos-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/integration-tests': patch
---

Update data schema for e2e hotswappable test as per the new getting started
1,929 changes: 960 additions & 969 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/auth-construct/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@aws-amplify/plugin-types": "^0.4.1"
},
"peerDependencies": {
"aws-cdk-lib": "^2.103.0",
"aws-cdk-lib": "^2.110.1",
"constructs": "^10.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/backend-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@aws-amplify/platform-core": "^0.3.0"
},
"peerDependencies": {
"aws-cdk-lib": "^2.103.0",
"aws-cdk-lib": "^2.110.1",
"constructs": "^10.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/backend-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@aws-amplify/platform-core": "^0.3.0"
},
"peerDependencies": {
"aws-cdk-lib": "^2.103.0",
"aws-cdk-lib": "^2.110.1",
"constructs": "^10.0.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-deployer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"tsx": "^3.12.6"
},
"peerDependencies": {
"aws-cdk": "^2.103.0",
"aws-cdk": "^2.110.1",
"typescript": "^5.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/backend-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@aws-amplify/platform-core": "^0.3.0"
},
"peerDependencies": {
"aws-cdk-lib": "^2.103.0",
"aws-cdk-lib": "^2.110.1",
"constructs": "^10.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/backend-output-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"@aws-amplify/platform-core": "^0.3.0"
},
"peerDependencies": {
"aws-cdk-lib": "^2.103.0"
"aws-cdk-lib": "^2.110.1"
}
}
2 changes: 1 addition & 1 deletion packages/backend-platform-test-stubs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"aws-cdk-lib": "^2.100.0",
"aws-cdk-lib": "^2.110.1",
"constructs": "^10.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/backend-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@aws-amplify/platform-core": "^0.3.0"
},
"peerDependencies": {
"aws-cdk-lib": "^2.103.0",
"aws-cdk-lib": "^2.110.1",
"constructs": "^10.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@aws-sdk/client-amplify": "^3.440.0"
},
"peerDependencies": {
"aws-cdk-lib": "~2.103.0",
"aws-cdk-lib": "~2.110.1",
"constructs": "^10.0.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"0.5.2\",\"stackType\":\"root\",\"metadata\":{}}",
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"0.5.4\",\"stackType\":\"root\",\"metadata\":{}}",
"Metadata": {
"AWS::Amplify::Platform": {
"version": "1",
Expand Down Expand Up @@ -204,7 +204,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "ef558b566d58035318b9153367697fecb478e9359fd27e8ac5bc11cf87eb2ea6.zip"
"S3Key": "747012bf6fea04c81a436d8dfe16db211a8a4df19c15421de44ea7440573b86b.zip"
},
"Environment": {
"Variables": {
Expand Down Expand Up @@ -421,7 +421,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/49db5c096a6e16028208ca156161ed85e1c77d49d3073bdb7957432865a50618.json"
"/aa5980fc1cfd00374e5224df874d7414086ec4f45288dc19e5fa63133e85c9a0.json"
]
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.4.1\",\"stackType\":\"api-AppSync\",\"metadata\":{}}",
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.4.2\",\"stackType\":\"api-AppSync\",\"metadata\":{}}",
"Resources": {
"amplifyDataGraphQLAPI42A6FA33": {
"Type": "AWS::AppSync::GraphQLApi",
Expand Down Expand Up @@ -47,7 +47,7 @@
"ApiId"
]
},
"Expires": 1702857469
"Expires": 1703205067
}
},
"amplifyDataGraphQLAPINONEDS684BF699": {
Expand Down Expand Up @@ -491,7 +491,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip"
"S3Key": "0b1f5aa55d045066ed91316b823a808060c12737e0575ab7cefe2335324108b0.zip"
},
"Environment": {
"Variables": {
Expand Down
2 changes: 1 addition & 1 deletion packages/function-construct/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@aws-amplify/backend-output-storage": "^0.2.0"
},
"peerDependencies": {
"aws-cdk-lib": "^2.103.0",
"aws-cdk-lib": "^2.110.1",
"constructs": "^10.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"0.5.2\",\"stackType\":\"root\",\"metadata\":{}}",
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"0.5.4\",\"stackType\":\"root\",\"metadata\":{}}",
"Metadata": {
"AWS::Amplify::Platform": {
"version": "1",
Expand Down Expand Up @@ -142,7 +142,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "ef558b566d58035318b9153367697fecb478e9359fd27e8ac5bc11cf87eb2ea6.zip"
"S3Key": "747012bf6fea04c81a436d8dfe16db211a8a4df19c15421de44ea7440573b86b.zip"
},
"Environment": {
"Variables": {
Expand Down Expand Up @@ -306,7 +306,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/1f9170d47be7a5554c0c68803291a57060ec87ed69a3225c34a56eb1a53d5831.json"
"/0af95f79425d31eb2f7a183c84eac6fef81f8a45d5d1895224e37a513e96e9ac.json"
]
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.4.1\",\"stackType\":\"api-AppSync\",\"metadata\":{}}",
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.4.2\",\"stackType\":\"api-AppSync\",\"metadata\":{}}",
"Resources": {
"amplifyDataGraphQLAPI42A6FA33": {
"Type": "AWS::AppSync::GraphQLApi",
Expand Down Expand Up @@ -31,7 +31,7 @@
"ApiId"
]
},
"Expires": 1700870257
"Expires": 1701217852
}
},
"amplifyDataGraphQLAPINONEDS684BF699": {
Expand Down Expand Up @@ -466,7 +466,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip"
"S3Key": "0b1f5aa55d045066ed91316b823a808060c12737e0575ab7cefe2335324108b0.zip"
},
"Environment": {
"Variables": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"0.5.2\",\"stackType\":\"root\",\"metadata\":{}}",
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"0.5.4\",\"stackType\":\"root\",\"metadata\":{}}",
"Metadata": {
"AWS::Amplify::Platform": {
"version": "1",
Expand Down Expand Up @@ -242,7 +242,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "ef558b566d58035318b9153367697fecb478e9359fd27e8ac5bc11cf87eb2ea6.zip"
"S3Key": "747012bf6fea04c81a436d8dfe16db211a8a4df19c15421de44ea7440573b86b.zip"
},
"Environment": {
"Variables": {
Expand Down Expand Up @@ -533,7 +533,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/875e5394df809b692ab27c35e2077fab9965dc03b2c7351d949aabfeab72f07d.json"
"/297077e3e6a1808350dfa1c8959f7f7335d51bd57c6bfbccc629f3ddb2e57d7b.json"
]
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.4.1\",\"stackType\":\"api-AppSync\",\"metadata\":{}}",
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.4.2\",\"stackType\":\"api-AppSync\",\"metadata\":{}}",
"Resources": {
"amplifyDataGraphQLAPI42A6FA33": {
"Type": "AWS::AppSync::GraphQLApi",
Expand Down Expand Up @@ -527,7 +527,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip"
"S3Key": "0b1f5aa55d045066ed91316b823a808060c12737e0575ab7cefe2335324108b0.zip"
},
"Environment": {
"Variables": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"0.5.2\",\"stackType\":\"root\",\"metadata\":{}}",
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"0.5.4\",\"stackType\":\"root\",\"metadata\":{}}",
"Metadata": {
"AWS::Amplify::Platform": {
"version": "1",
Expand Down Expand Up @@ -242,7 +242,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "ef558b566d58035318b9153367697fecb478e9359fd27e8ac5bc11cf87eb2ea6.zip"
"S3Key": "747012bf6fea04c81a436d8dfe16db211a8a4df19c15421de44ea7440573b86b.zip"
},
"Environment": {
"Variables": {
Expand Down Expand Up @@ -533,7 +533,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/875e5394df809b692ab27c35e2077fab9965dc03b2c7351d949aabfeab72f07d.json"
"/297077e3e6a1808350dfa1c8959f7f7335d51bd57c6bfbccc629f3ddb2e57d7b.json"
]
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.4.1\",\"stackType\":\"api-AppSync\",\"metadata\":{}}",
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.4.2\",\"stackType\":\"api-AppSync\",\"metadata\":{}}",
"Resources": {
"amplifyDataGraphQLAPI42A6FA33": {
"Type": "AWS::AppSync::GraphQLApi",
Expand Down Expand Up @@ -527,7 +527,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip"
"S3Key": "0b1f5aa55d045066ed91316b823a808060c12737e0575ab7cefe2335324108b0.zip"
},
"Environment": {
"Variables": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,39 @@
import { Func, defineData } from '@aws-amplify/backend';
import { myFunc } from '../function.js';
import { type ClientSchema, Func, a, defineData } from '@aws-amplify/backend';

const schema = a.schema({
Todo: a
.model({
content: a.string(),
filedToChange: a.string(),
fieldToRemove: a.string(),
})
.authorization([a.allow.owner(), a.allow.public().to(['read'])]),

EchoResponse: a.customType({
content: a.string(),
executionDuration: a.float(),
}),

echo: a
.query()
.arguments({ content: a.string() })
.returns(a.ref('EchoResponse'))
.authorization([a.allow.private()])
.function('echo'),
});

export type Schema = ClientSchema<typeof schema>;

export const data = defineData({
schema: /* GraphQL */ `
type Todo @model {
id: ID!
name: String!
description: String
otherField: String
}
type Query {
reverse(message: String!): String! @function(name: "reverse")
echo(message: String!): String! @function(name: "echo")
}
`,
schema,
authorizationModes: {
defaultAuthorizationMode: 'apiKey',
// API Key is used for a.allow.public() rules
apiKeyAuthorizationMode: {
expiresInDays: 30,
},
},
functions: {
reverse: myFunc,
// Leaving explicit Func invocation here,
Expand Down
Loading

0 comments on commit 5ed51cb

Please sign in to comment.