AmplifyBackend

2021/11/17 - AmplifyBackend - 6 new api methods

Changes  New APIs to support the Amplify Storage category. Add and manage file storage in your Amplify app backend.

CreateBackendStorage (new) Link ¶

Creates a backend storage resource.

See also: AWS API Documentation

Request Syntax

client.create_backend_storage(
    AppId='string',
    BackendEnvironmentName='string',
    ResourceConfig={
        'BucketName': 'string',
        'Permissions': {
            'Authenticated': [
                'READ'|'CREATE_AND_UPDATE'|'DELETE',
            ],
            'UnAuthenticated': [
                'READ'|'CREATE_AND_UPDATE'|'DELETE',
            ]
        },
        'ServiceName': 'S3'
    },
    ResourceName='string'
)
type AppId

string

param AppId

[REQUIRED]

The app ID.

type BackendEnvironmentName

string

param BackendEnvironmentName

[REQUIRED]

The name of the backend environment.

type ResourceConfig

dict

param ResourceConfig

[REQUIRED]

The resource configuration for creating backend storage.

  • BucketName (string) --

    The name of the S3 bucket.

  • Permissions (dict) -- [REQUIRED]

    The authorization configuration for the storage S3 bucket.

    • Authenticated (list) -- [REQUIRED]

      Lists all authenticated user read, write, and delete permissions for your S3 bucket.

      • (string) --

    • UnAuthenticated (list) --

      Lists all unauthenticated user read, write, and delete permissions for your S3 bucket.

      • (string) --

  • ServiceName (string) -- [REQUIRED]

    The name of the storage service.

type ResourceName

string

param ResourceName

[REQUIRED]

The name of the storage resource.

rtype

dict

returns

Response Syntax

{
    'AppId': 'string',
    'BackendEnvironmentName': 'string',
    'JobId': 'string',
    'Status': 'string'
}

Response Structure

  • (dict) --

    200 response

    • AppId (string) --

      The app ID.

    • BackendEnvironmentName (string) --

      The name of the backend environment.

    • JobId (string) --

      The ID for the job.

    • Status (string) --

      The current status of the request.

UpdateBackendStorage (new) Link ¶

Updates an existing backend storage resource.

See also: AWS API Documentation

Request Syntax

client.update_backend_storage(
    AppId='string',
    BackendEnvironmentName='string',
    ResourceConfig={
        'Permissions': {
            'Authenticated': [
                'READ'|'CREATE_AND_UPDATE'|'DELETE',
            ],
            'UnAuthenticated': [
                'READ'|'CREATE_AND_UPDATE'|'DELETE',
            ]
        },
        'ServiceName': 'S3'
    },
    ResourceName='string'
)
type AppId

string

param AppId

[REQUIRED]

The app ID.

type BackendEnvironmentName

string

param BackendEnvironmentName

[REQUIRED]

The name of the backend environment.

type ResourceConfig

dict

param ResourceConfig

[REQUIRED]

The resource configuration for updating backend storage.

  • Permissions (dict) -- [REQUIRED]

    The authorization configuration for the storage S3 bucket.

    • Authenticated (list) -- [REQUIRED]

      Lists all authenticated user read, write, and delete permissions for your S3 bucket.

      • (string) --

    • UnAuthenticated (list) --

      Lists all unauthenticated user read, write, and delete permissions for your S3 bucket.

      • (string) --

  • ServiceName (string) -- [REQUIRED]

    The name of the storage service.

type ResourceName

string

param ResourceName

[REQUIRED]

The name of the storage resource.

rtype

dict

returns

Response Syntax

{
    'AppId': 'string',
    'BackendEnvironmentName': 'string',
    'JobId': 'string',
    'Status': 'string'
}

Response Structure

  • (dict) --

    200 response

    • AppId (string) --

      The app ID.

    • BackendEnvironmentName (string) --

      The name of the backend environment.

    • JobId (string) --

      The ID for the job.

    • Status (string) --

      The current status of the request.

DeleteBackendStorage (new) Link ¶

Removes the specified backend storage resource.

See also: AWS API Documentation

Request Syntax

client.delete_backend_storage(
    AppId='string',
    BackendEnvironmentName='string',
    ResourceName='string',
    ServiceName='S3'
)
type AppId

string

param AppId

[REQUIRED]

The app ID.

type BackendEnvironmentName

string

param BackendEnvironmentName

[REQUIRED]

The name of the backend environment.

type ResourceName

string

param ResourceName

[REQUIRED]

The name of the storage resource.

type ServiceName

string

param ServiceName

[REQUIRED]

The name of the storage service.

rtype

dict

returns

Response Syntax

{
    'AppId': 'string',
    'BackendEnvironmentName': 'string',
    'JobId': 'string',
    'Status': 'string'
}

Response Structure

  • (dict) --

    200 response

    • AppId (string) --

      The app ID.

    • BackendEnvironmentName (string) --

      The name of the backend environment.

    • JobId (string) --

      The ID for the job.

    • Status (string) --

      The current status of the request.

ImportBackendStorage (new) Link ¶

Imports an existing backend storage resource.

See also: AWS API Documentation

Request Syntax

client.import_backend_storage(
    AppId='string',
    BackendEnvironmentName='string',
    BucketName='string',
    ServiceName='S3'
)
type AppId

string

param AppId

[REQUIRED]

The app ID.

type BackendEnvironmentName

string

param BackendEnvironmentName

[REQUIRED]

The name of the backend environment.

type BucketName

string

param BucketName

The name of the S3 bucket.

type ServiceName

string

param ServiceName

[REQUIRED]

The name of the storage service.

rtype

dict

returns

Response Syntax

{
    'AppId': 'string',
    'BackendEnvironmentName': 'string',
    'JobId': 'string',
    'Status': 'string'
}

Response Structure

  • (dict) --

    200 response

    • AppId (string) --

      The app ID.

    • BackendEnvironmentName (string) --

      The name of the backend environment.

    • JobId (string) --

      The ID for the job.

    • Status (string) --

      The current status of the request.

ListS3Buckets (new) Link ¶

The list of S3 buckets in your account.

See also: AWS API Documentation

Request Syntax

client.list_s3_buckets(
    NextToken='string'
)
type NextToken

string

param NextToken

Reserved for future use.

rtype

dict

returns

Response Syntax

{
    'Buckets': [
        {
            'CreationDate': 'string',
            'Name': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    200 response

    • Buckets (list) --

      The list of S3 buckets.

      • (dict) --

        Describes the metadata of the S3 bucket.

        • CreationDate (string) --

          The creation date of the S3 bucket.

        • Name (string) --

          The name of the S3 bucket.

    • NextToken (string) --

      Reserved for future use.

GetBackendStorage (new) Link ¶

Gets details for a backend storage resource.

See also: AWS API Documentation

Request Syntax

client.get_backend_storage(
    AppId='string',
    BackendEnvironmentName='string',
    ResourceName='string'
)
type AppId

string

param AppId

[REQUIRED]

The app ID.

type BackendEnvironmentName

string

param BackendEnvironmentName

[REQUIRED]

The name of the backend environment.

type ResourceName

string

param ResourceName

[REQUIRED]

The name of the storage resource.

rtype

dict

returns

Response Syntax

{
    'AppId': 'string',
    'BackendEnvironmentName': 'string',
    'ResourceConfig': {
        'BucketName': 'string',
        'Imported': True|False,
        'Permissions': {
            'Authenticated': [
                'READ'|'CREATE_AND_UPDATE'|'DELETE',
            ],
            'UnAuthenticated': [
                'READ'|'CREATE_AND_UPDATE'|'DELETE',
            ]
        },
        'ServiceName': 'S3'
    },
    'ResourceName': 'string'
}

Response Structure

  • (dict) --

    200 response

    • AppId (string) --

      The app ID.

    • BackendEnvironmentName (string) --

      The name of the backend environment.

    • ResourceConfig (dict) --

      The resource configuration for the backend storage resource.

      • BucketName (string) --

        The name of the S3 bucket.

      • Imported (boolean) --

        Returns True if the storage resource has been imported.

      • Permissions (dict) --

        The authorization configuration for the storage S3 bucket.

        • Authenticated (list) --

          Lists all authenticated user read, write, and delete permissions for your S3 bucket.

          • (string) --

        • UnAuthenticated (list) --

          Lists all unauthenticated user read, write, and delete permissions for your S3 bucket.

          • (string) --

      • ServiceName (string) --

        The name of the storage service.

    • ResourceName (string) --

      The name of the storage resource.