Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update data schema for e2e hotswappable test as per the new getting started #728

Merged
merged 6 commits into from
Nov 22, 2023
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
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
2,021 changes: 1,006 additions & 1,015 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
Loading