Name:
interface
Value:
Extend your Amplify Gen 2 app with AWS Blocks — self-contained backend capabilities you compose into your existing backend.

Page updated May 2, 2024

NewDeploy web apps with Git or your AI coding agent using the latest AWS Amplify. Add managed databases and authentication as you grow. Explore the documentation.
Maintenance ModeYou are viewing Amplify Gen 1 documentation. Amplify Gen 1 has entered maintenance mode and will reach end of life on May 1, 2027. For existing Gen 1 projects, a migration guide and tooling are available to help you upgrade.

Using Path

These docs cover Amplify Gen 1. For new web apps, we recommend the latest AWS Amplify, with a simplified CLI and native integrations for databases, storage, and AI models. Get started with the latest AWS Amplify.

You can now use the path parameter in the API to access any path within your S3 bucket. This provides more flexibility than the predefined protected, private, or guest folder access levels, allowing you to create and manage a storage structure tailored to your needs.

Note: path parameter can not be empty or start with a '/' (leading slash)

The sections below explain how to use existing guest, protected, and private resources with path-based APIs.

Using Guest accessLevel

import { getProperties } from 'aws-amplify/storage';
try {
const result = await getProperties({
path: 'public/album/2024/1.jpg',
});
console.log('File Properties ', result);
} catch (error) {
console.log('Error ', error);
}

Using Protected accessLevel

import { getProperties } from 'aws-amplify/storage';
try {
const result = await getProperties({
// `identityId` will provide the ID of the currently authenticated user
path: ({identityId}) => `protected/${identityId}/album/2024/1.jpg`,
});
console.log('File Properties ', result);
} catch (error) {
console.log('Error ', error);
}

Using Private accessLevel

import { getProperties } from 'aws-amplify/storage';
try {
const result = await getProperties({
// `identityId` will provide the ID of the currently authenticated user
path: ({identityId}) => `private/${identityId}/album/2024/1.jpg`,
});
console.log('File Properties ', result);
} catch (error) {
console.log('Error ', error);
}