#isDefault for Gen 2 Storage

2 messages · Page 1 of 1 (latest)

torn thistle
#

When i try to declare a "isDefault" for storage in gen 2, I get the following error:

Object literal may only specify known properties, and 'isDefault' does not exist in type 'AmplifyStorageFactoryProps'.ts(2353)

The documentation says this should be a thing. My resource file is as follows:

export const bucketOne = defineStorage({
name: 'bucketOne-dev',
isDefault: true,
access: (allow) => ({
'users/protected/{entity_id}/*': [
allow.authenticated.to(['read', 'write', 'delete']),
allow.entity('identity').to(['read', 'write', 'delete'])
],
})
});

export const bucketTwo = defineStorage({
name: 'bucketTwo-dev',
access: (allow) => ({
'{entity_id}/protected/surveys/*': [
allow.authenticated.to(['read', 'write', 'delete']),
allow.entity('identity').to(['read', 'write', 'delete'])
],
})
});

topaz helm
#

hey its possible your projects amplify backend dependencies are out of date.
could you run npx ampx info and provide us the output or update the dependencies. The latest should be

 "@aws-amplify/backend": "^1.6.0",
 "@aws-amplify/backend-cli": "^1.4.0",