You are viewing the documentation for an older major version of the AWS SDK for JavaScript.
The modular AWS SDK for JavaScript (v3), the latest major version of AWS SDK for JavaScript, is now stable and recommended for general use. For more information, see the Migration Guide and API Reference.

Class: AWS.AmplifyBackend

Inherits:
AWS.Service show all
Identifier:
amplifybackend
API Version:
2020-08-11
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

AWS Amplify Admin API

Sending a Request Using AmplifyBackend

var amplifybackend = new AWS.AmplifyBackend();
amplifybackend.cloneBackend(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the AmplifyBackend object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var amplifybackend = new AWS.AmplifyBackend({apiVersion: '2020-08-11'});

You can also set the API version globally in AWS.config.apiVersions using the amplifybackend service identifier:

AWS.config.apiVersions = {
  amplifybackend: '2020-08-11',
  // other service API versions
};

var amplifybackend = new AWS.AmplifyBackend();

Version:

  • 2020-08-11

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.AmplifyBackend(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a AmplifyBackend object

var amplifybackend = new AWS.AmplifyBackend({apiVersion: '2020-08-11'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String|AWS.Endpoint)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.AmplifyBackend.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.AmplifyBackend.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.AmplifyBackend.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

cloneBackend(params = {}, callback) ⇒ AWS.Request

This operation clones an existing backend.

Service Reference:

Examples:

Calling the cloneBackend operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  TargetEnvironmentName: 'STRING_VALUE' /* required */
};
amplifybackend.cloneBackend(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • TargetEnvironmentName — (String)

      The name of the destination backend environment to be created.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createBackend(params = {}, callback) ⇒ AWS.Request

This operation creates a backend for an Amplify app. Backends are automatically created at the time of app creation.

Service Reference:

Examples:

Calling the createBackend operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  AppName: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  ResourceConfig: {
  },
  ResourceName: 'STRING_VALUE'
};
amplifybackend.createBackend(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • AppName — (String)

      The name of the app.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • ResourceConfig — (map)

      The resource configuration for the create backend request.

    • ResourceName — (String)

      The name of the resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createBackendAPI(params = {}, callback) ⇒ AWS.Request

Creates a new backend API resource.

Service Reference:

Examples:

Calling the createBackendAPI operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  ResourceConfig: { /* required */
    AdditionalAuthTypes: [
      {
        Mode: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT,
        Settings: {
          CognitoUserPoolId: 'STRING_VALUE',
          Description: 'STRING_VALUE',
          ExpirationTime: 'NUMBER_VALUE',
          OpenIDAuthTTL: 'STRING_VALUE',
          OpenIDClientId: 'STRING_VALUE',
          OpenIDIatTTL: 'STRING_VALUE',
          OpenIDIssueURL: 'STRING_VALUE',
          OpenIDProviderName: 'STRING_VALUE'
        }
      },
      /* more items */
    ],
    ApiName: 'STRING_VALUE',
    ConflictResolution: {
      ResolutionStrategy: OPTIMISTIC_CONCURRENCY | LAMBDA | AUTOMERGE | NONE
    },
    DefaultAuthType: {
      Mode: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT,
      Settings: {
        CognitoUserPoolId: 'STRING_VALUE',
        Description: 'STRING_VALUE',
        ExpirationTime: 'NUMBER_VALUE',
        OpenIDAuthTTL: 'STRING_VALUE',
        OpenIDClientId: 'STRING_VALUE',
        OpenIDIatTTL: 'STRING_VALUE',
        OpenIDIssueURL: 'STRING_VALUE',
        OpenIDProviderName: 'STRING_VALUE'
      }
    },
    Service: 'STRING_VALUE',
    TransformSchema: 'STRING_VALUE'
  },
  ResourceName: 'STRING_VALUE' /* required */
};
amplifybackend.createBackendAPI(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • ResourceConfig — (map)

      The resource configuration for this request.

      • AdditionalAuthTypes — (Array<map>)

        Additional authentication methods used to interact with your data models.

        • Mode — (String)

          Describes the authentication mode.

          Possible values include:
          • "API_KEY"
          • "AWS_IAM"
          • "AMAZON_COGNITO_USER_POOLS"
          • "OPENID_CONNECT"
        • Settings — (map)

          Describes settings for the authentication mode.

          • CognitoUserPoolId — (String)

            The Amazon Cognito user pool ID, if Amazon Cognito was used as an authentication setting to access your data models.

          • Description — (String)

            The API key description for API_KEY, if it was used as an authentication mechanism to access your data models.

          • ExpirationTime — (Float)

            The API key expiration time for API_KEY, if it was used as an authentication mechanism to access your data models.

          • OpenIDAuthTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDClientId — (String)

            The clientID for openID, if openID was used as an authentication setting to access your data models.

          • OpenIDIatTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDIssueURL — (String)

            The openID issuer URL, if openID was used as an authentication setting to access your data models.

          • OpenIDProviderName — (String)

            The OpenID provider name, if OpenID was used as an authentication mechanism to access your data models.

      • ApiName — (String)

        The API name used to interact with the data model, configured as a part of your Amplify project.

      • ConflictResolution — (map)

        The conflict resolution strategy for your data stored in the data models.

        • ResolutionStrategy — (String)

          The strategy for conflict resolution.

          Possible values include:
          • "OPTIMISTIC_CONCURRENCY"
          • "LAMBDA"
          • "AUTOMERGE"
          • "NONE"
      • DefaultAuthType — (map)

        The default authentication type for interacting with the configured data models in your Amplify project.

        • Mode — (String)

          Describes the authentication mode.

          Possible values include:
          • "API_KEY"
          • "AWS_IAM"
          • "AMAZON_COGNITO_USER_POOLS"
          • "OPENID_CONNECT"
        • Settings — (map)

          Describes settings for the authentication mode.

          • CognitoUserPoolId — (String)

            The Amazon Cognito user pool ID, if Amazon Cognito was used as an authentication setting to access your data models.

          • Description — (String)

            The API key description for API_KEY, if it was used as an authentication mechanism to access your data models.

          • ExpirationTime — (Float)

            The API key expiration time for API_KEY, if it was used as an authentication mechanism to access your data models.

          • OpenIDAuthTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDClientId — (String)

            The clientID for openID, if openID was used as an authentication setting to access your data models.

          • OpenIDIatTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDIssueURL — (String)

            The openID issuer URL, if openID was used as an authentication setting to access your data models.

          • OpenIDProviderName — (String)

            The OpenID provider name, if OpenID was used as an authentication mechanism to access your data models.

      • Service — (String)

        The service used to provision and interact with the data model.

      • TransformSchema — (String)

        The definition of the data model in the annotated transform of the GraphQL schema.

    • ResourceName — (String)

      The name of this resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createBackendAuth(params = {}, callback) ⇒ AWS.Request

Creates a new backend authentication resource.

Service Reference:

Examples:

Calling the createBackendAuth operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  ResourceConfig: { /* required */
    AuthResources: USER_POOL_ONLY | IDENTITY_POOL_AND_USER_POOL, /* required */
    Service: COGNITO, /* required */
    UserPoolConfigs: { /* required */
      RequiredSignUpAttributes: [ /* required */
        ADDRESS | BIRTHDATE | EMAIL | FAMILY_NAME | GENDER | GIVEN_NAME | LOCALE | MIDDLE_NAME | NAME | NICKNAME | PHONE_NUMBER | PICTURE | PREFERRED_USERNAME | PROFILE | UPDATED_AT | WEBSITE | ZONE_INFO,
        /* more items */
      ],
      SignInMethod: EMAIL | EMAIL_AND_PHONE_NUMBER | PHONE_NUMBER | USERNAME, /* required */
      UserPoolName: 'STRING_VALUE', /* required */
      ForgotPassword: {
        DeliveryMethod: EMAIL | SMS, /* required */
        EmailSettings: {
          EmailMessage: 'STRING_VALUE',
          EmailSubject: 'STRING_VALUE'
        },
        SmsSettings: {
          SmsMessage: 'STRING_VALUE'
        }
      },
      Mfa: {
        MFAMode: ON | OFF | OPTIONAL, /* required */
        Settings: {
          MfaTypes: [
            SMS | TOTP,
            /* more items */
          ],
          SmsMessage: 'STRING_VALUE'
        }
      },
      OAuth: {
        OAuthGrantType: CODE | IMPLICIT, /* required */
        OAuthScopes: [ /* required */
          PHONE | EMAIL | OPENID | PROFILE | AWS_COGNITO_SIGNIN_USER_ADMIN,
          /* more items */
        ],
        RedirectSignInURIs: [ /* required */
          'STRING_VALUE',
          /* more items */
        ],
        RedirectSignOutURIs: [ /* required */
          'STRING_VALUE',
          /* more items */
        ],
        DomainPrefix: 'STRING_VALUE',
        SocialProviderSettings: {
          Facebook: {
            ClientId: 'STRING_VALUE',
            ClientSecret: 'STRING_VALUE'
          },
          Google: {
            ClientId: 'STRING_VALUE',
            ClientSecret: 'STRING_VALUE'
          },
          LoginWithAmazon: {
            ClientId: 'STRING_VALUE',
            ClientSecret: 'STRING_VALUE'
          },
          SignInWithApple: {
            ClientId: 'STRING_VALUE',
            KeyId: 'STRING_VALUE',
            PrivateKey: 'STRING_VALUE',
            TeamId: 'STRING_VALUE'
          }
        }
      },
      PasswordPolicy: {
        MinimumLength: 'NUMBER_VALUE', /* required */
        AdditionalConstraints: [
          REQUIRE_DIGIT | REQUIRE_LOWERCASE | REQUIRE_SYMBOL | REQUIRE_UPPERCASE,
          /* more items */
        ]
      }
    },
    IdentityPoolConfigs: {
      IdentityPoolName: 'STRING_VALUE', /* required */
      UnauthenticatedLogin: true || false /* required */
    }
  },
  ResourceName: 'STRING_VALUE' /* required */
};
amplifybackend.createBackendAuth(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • ResourceConfig — (map)

      The resource configuration for this request object.

      • AuthResourcesrequired — (String)

        Defines whether you want to configure only authentication or both authentication and authorization settings.

        Possible values include:
        • "USER_POOL_ONLY"
        • "IDENTITY_POOL_AND_USER_POOL"
      • IdentityPoolConfigs — (map)

        Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part of your auth resource in the Amplify project.

        • IdentityPoolNamerequired — (String)

          Name of the Amazon Cognito identity pool used for authorization.

        • UnauthenticatedLoginrequired — (Boolean)

          Set to true or false based on whether you want to enable guest authorization to your Amplify app.

      • Servicerequired — (String)

        Defines the service name to use when configuring an authentication resource in your Amplify project.

        Possible values include:
        • "COGNITO"
      • UserPoolConfigsrequired — (map)

        Describes authentication configuration for the Amazon Cognito user pool, provisioned as a part of your auth resource in the Amplify project.

        • ForgotPassword — (map)

          Describes the forgotten password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.

          • DeliveryMethodrequired — (String)

            Describes which mode to use (either SMS or email) to deliver messages to app users who want to recover their password.

            Possible values include:
            • "EMAIL"
            • "SMS"
          • EmailSettings — (map)

            The configuration for the email sent when an app user forgets their password.

            • EmailMessage — (String)

              The body of the email.

            • EmailSubject — (String)

              The subject of the email.

          • SmsSettings — (map)

            The configuration for the SMS message sent when an app user forgets their password.

            • SmsMessage — (String)

              The body of the SMS message.

        • Mfa — (map)

          Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool configured as a part of your Amplify project.

          • MFAModerequired — (String)

            Describes whether MFA should be [ON, OFF, or OPTIONAL] for authentication in your Amplify project.

            Possible values include:
            • "ON"
            • "OFF"
            • "OPTIONAL"
          • Settings — (map)

            Describes the configuration settings and methods for your Amplify app users to use MFA.

            • MfaTypes — (Array<String>)

              The supported MFA types.

            • SmsMessage — (String)

              The body of the SMS message.

        • OAuth — (map)

          Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your Amplify project.

          • DomainPrefix — (String)

            The domain prefix for your Amplify app.

          • OAuthGrantTyperequired — (String)

            The OAuth grant type that you use to allow app users to authenticate from your Amplify app.

            Possible values include:
            • "CODE"
            • "IMPLICIT"
          • OAuthScopesrequired — (Array<String>)

            List of OAuth-related flows used to allow your app users to authenticate from your Amplify app.

          • RedirectSignInURIsrequired — (Array<String>)

            The redirected URI for signing in to your Amplify app.

          • RedirectSignOutURIsrequired — (Array<String>)

            Redirect URLs that OAuth uses when a user signs out of an Amplify app.

          • SocialProviderSettings — (map)

            The settings for using social providers to access your Amplify app.

            • Facebook — (map)

              Describes third-party social federation configurations for allowing your app users to sign in using OAuth.

              • ClientId — (String)

                Describes the client_id, which can be obtained from the third-party social federation provider.

              • ClientSecret — (String)

                Describes the client_secret, which can be obtained from third-party social federation providers.

            • Google — (map)

              Describes third-party social federation configurations for allowing your app users to sign in using OAuth.

              • ClientId — (String)

                Describes the client_id, which can be obtained from the third-party social federation provider.

              • ClientSecret — (String)

                Describes the client_secret, which can be obtained from third-party social federation providers.

            • LoginWithAmazon — (map)

              Describes third-party social federation configurations for allowing your app users to sign in using OAuth.

              • ClientId — (String)

                Describes the client_id, which can be obtained from the third-party social federation provider.

              • ClientSecret — (String)

                Describes the client_secret, which can be obtained from third-party social federation providers.

            • SignInWithApple — (map)

              Describes Apple social federation configurations for allowing your app users to sign in using OAuth.

              • ClientId — (String)

                Describes the client_id (also called Services ID) that comes from Apple.

              • KeyId — (String)

                Describes the key_id that comes from Apple.

              • PrivateKey — (String)

                Describes the private_key that comes from Apple.

              • TeamId — (String)

                Describes the team_id that comes from Apple.

        • PasswordPolicy — (map)

          Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.

          • AdditionalConstraints — (Array<String>)

            Additional constraints for the password used to access the backend of your Amplify project.

          • MinimumLengthrequired — (Float)

            The minimum length of the password used to access the backend of your Amplify project.

        • RequiredSignUpAttributesrequired — (Array<String>)

          The required attributes to sign up new users in the user pool.

        • SignInMethodrequired — (String)

          Describes the sign-in methods that your Amplify app users use to log in using the Amazon Cognito user pool, configured as a part of your Amplify project.

          Possible values include:
          • "EMAIL"
          • "EMAIL_AND_PHONE_NUMBER"
          • "PHONE_NUMBER"
          • "USERNAME"
        • UserPoolNamerequired — (String)

          The Amazon Cognito user pool name.

    • ResourceName — (String)

      The name of this resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createBackendConfig(params = {}, callback) ⇒ AWS.Request

Creates a config object for a backend.

Service Reference:

Examples:

Calling the createBackendConfig operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendManagerAppId: 'STRING_VALUE'
};
amplifybackend.createBackendConfig(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendManagerAppId — (String)

      The app ID for the backend manager.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • 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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createToken(params = {}, callback) ⇒ AWS.Request

Generates a one-time challenge code to authenticate a user into your Amplify Admin UI.

Service Reference:

Examples:

Calling the createToken operation

var params = {
  AppId: 'STRING_VALUE' /* required */
};
amplifybackend.createToken(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • ChallengeCode — (String)

        One-time challenge code for authenticating into the Amplify Admin UI.

      • SessionId — (String)

        A unique ID provided when creating a new challenge token.

      • Ttl — (String)

        The expiry time for the one-time generated token code.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteBackend(params = {}, callback) ⇒ AWS.Request

Removes an existing environment from your Amplify project.

Service Reference:

Examples:

Calling the deleteBackend operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE' /* required */
};
amplifybackend.deleteBackend(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteBackendAPI(params = {}, callback) ⇒ AWS.Request

Deletes an existing backend API resource.

Service Reference:

Examples:

Calling the deleteBackendAPI operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  ResourceName: 'STRING_VALUE', /* required */
  ResourceConfig: {
    AdditionalAuthTypes: [
      {
        Mode: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT,
        Settings: {
          CognitoUserPoolId: 'STRING_VALUE',
          Description: 'STRING_VALUE',
          ExpirationTime: 'NUMBER_VALUE',
          OpenIDAuthTTL: 'STRING_VALUE',
          OpenIDClientId: 'STRING_VALUE',
          OpenIDIatTTL: 'STRING_VALUE',
          OpenIDIssueURL: 'STRING_VALUE',
          OpenIDProviderName: 'STRING_VALUE'
        }
      },
      /* more items */
    ],
    ApiName: 'STRING_VALUE',
    ConflictResolution: {
      ResolutionStrategy: OPTIMISTIC_CONCURRENCY | LAMBDA | AUTOMERGE | NONE
    },
    DefaultAuthType: {
      Mode: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT,
      Settings: {
        CognitoUserPoolId: 'STRING_VALUE',
        Description: 'STRING_VALUE',
        ExpirationTime: 'NUMBER_VALUE',
        OpenIDAuthTTL: 'STRING_VALUE',
        OpenIDClientId: 'STRING_VALUE',
        OpenIDIatTTL: 'STRING_VALUE',
        OpenIDIssueURL: 'STRING_VALUE',
        OpenIDProviderName: 'STRING_VALUE'
      }
    },
    Service: 'STRING_VALUE',
    TransformSchema: 'STRING_VALUE'
  }
};
amplifybackend.deleteBackendAPI(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • ResourceConfig — (map)

      Defines the resource configuration for the data model in your Amplify project.

      • AdditionalAuthTypes — (Array<map>)

        Additional authentication methods used to interact with your data models.

        • Mode — (String)

          Describes the authentication mode.

          Possible values include:
          • "API_KEY"
          • "AWS_IAM"
          • "AMAZON_COGNITO_USER_POOLS"
          • "OPENID_CONNECT"
        • Settings — (map)

          Describes settings for the authentication mode.

          • CognitoUserPoolId — (String)

            The Amazon Cognito user pool ID, if Amazon Cognito was used as an authentication setting to access your data models.

          • Description — (String)

            The API key description for API_KEY, if it was used as an authentication mechanism to access your data models.

          • ExpirationTime — (Float)

            The API key expiration time for API_KEY, if it was used as an authentication mechanism to access your data models.

          • OpenIDAuthTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDClientId — (String)

            The clientID for openID, if openID was used as an authentication setting to access your data models.

          • OpenIDIatTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDIssueURL — (String)

            The openID issuer URL, if openID was used as an authentication setting to access your data models.

          • OpenIDProviderName — (String)

            The OpenID provider name, if OpenID was used as an authentication mechanism to access your data models.

      • ApiName — (String)

        The API name used to interact with the data model, configured as a part of your Amplify project.

      • ConflictResolution — (map)

        The conflict resolution strategy for your data stored in the data models.

        • ResolutionStrategy — (String)

          The strategy for conflict resolution.

          Possible values include:
          • "OPTIMISTIC_CONCURRENCY"
          • "LAMBDA"
          • "AUTOMERGE"
          • "NONE"
      • DefaultAuthType — (map)

        The default authentication type for interacting with the configured data models in your Amplify project.

        • Mode — (String)

          Describes the authentication mode.

          Possible values include:
          • "API_KEY"
          • "AWS_IAM"
          • "AMAZON_COGNITO_USER_POOLS"
          • "OPENID_CONNECT"
        • Settings — (map)

          Describes settings for the authentication mode.

          • CognitoUserPoolId — (String)

            The Amazon Cognito user pool ID, if Amazon Cognito was used as an authentication setting to access your data models.

          • Description — (String)

            The API key description for API_KEY, if it was used as an authentication mechanism to access your data models.

          • ExpirationTime — (Float)

            The API key expiration time for API_KEY, if it was used as an authentication mechanism to access your data models.

          • OpenIDAuthTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDClientId — (String)

            The clientID for openID, if openID was used as an authentication setting to access your data models.

          • OpenIDIatTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDIssueURL — (String)

            The openID issuer URL, if openID was used as an authentication setting to access your data models.

          • OpenIDProviderName — (String)

            The OpenID provider name, if OpenID was used as an authentication mechanism to access your data models.

      • Service — (String)

        The service used to provision and interact with the data model.

      • TransformSchema — (String)

        The definition of the data model in the annotated transform of the GraphQL schema.

    • ResourceName — (String)

      The name of this resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteBackendAuth(params = {}, callback) ⇒ AWS.Request

Deletes an existing backend authentication resource.

Service Reference:

Examples:

Calling the deleteBackendAuth operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  ResourceName: 'STRING_VALUE' /* required */
};
amplifybackend.deleteBackendAuth(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • ResourceName — (String)

      The name of this resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteToken(params = {}, callback) ⇒ AWS.Request

Deletes the challenge token based on the given appId and sessionId.

Service Reference:

Examples:

Calling the deleteToken operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  SessionId: 'STRING_VALUE' /* required */
};
amplifybackend.deleteToken(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • SessionId — (String)

      The session ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • IsSuccess — (Boolean)

        Indicates whether the request succeeded or failed.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

generateBackendAPIModels(params = {}, callback) ⇒ AWS.Request

Generates a model schema for an existing backend API resource.

Service Reference:

Examples:

Calling the generateBackendAPIModels operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  ResourceName: 'STRING_VALUE' /* required */
};
amplifybackend.generateBackendAPIModels(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • ResourceName — (String)

      The name of this resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBackend(params = {}, callback) ⇒ AWS.Request

Provides project-level details for your Amplify UI project.

Service Reference:

Examples:

Calling the getBackend operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE'
};
amplifybackend.getBackend(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AmplifyMetaConfig — (String)

        A stringified version of the current configs for your Amplify project.

      • AppId — (String)

        The app ID.

      • AppName — (String)

        The name of the app.

      • BackendEnvironmentList — (Array<String>)

        A list of backend environments in an array.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request failed, this is the returned error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBackendAPI(params = {}, callback) ⇒ AWS.Request

Gets the details for a backend API.

Service Reference:

Examples:

Calling the getBackendAPI operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  ResourceName: 'STRING_VALUE', /* required */
  ResourceConfig: {
    AdditionalAuthTypes: [
      {
        Mode: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT,
        Settings: {
          CognitoUserPoolId: 'STRING_VALUE',
          Description: 'STRING_VALUE',
          ExpirationTime: 'NUMBER_VALUE',
          OpenIDAuthTTL: 'STRING_VALUE',
          OpenIDClientId: 'STRING_VALUE',
          OpenIDIatTTL: 'STRING_VALUE',
          OpenIDIssueURL: 'STRING_VALUE',
          OpenIDProviderName: 'STRING_VALUE'
        }
      },
      /* more items */
    ],
    ApiName: 'STRING_VALUE',
    ConflictResolution: {
      ResolutionStrategy: OPTIMISTIC_CONCURRENCY | LAMBDA | AUTOMERGE | NONE
    },
    DefaultAuthType: {
      Mode: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT,
      Settings: {
        CognitoUserPoolId: 'STRING_VALUE',
        Description: 'STRING_VALUE',
        ExpirationTime: 'NUMBER_VALUE',
        OpenIDAuthTTL: 'STRING_VALUE',
        OpenIDClientId: 'STRING_VALUE',
        OpenIDIatTTL: 'STRING_VALUE',
        OpenIDIssueURL: 'STRING_VALUE',
        OpenIDProviderName: 'STRING_VALUE'
      }
    },
    Service: 'STRING_VALUE',
    TransformSchema: 'STRING_VALUE'
  }
};
amplifybackend.getBackendAPI(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • ResourceConfig — (map)

      Defines the resource configuration for the data model in your Amplify project.

      • AdditionalAuthTypes — (Array<map>)

        Additional authentication methods used to interact with your data models.

        • Mode — (String)

          Describes the authentication mode.

          Possible values include:
          • "API_KEY"
          • "AWS_IAM"
          • "AMAZON_COGNITO_USER_POOLS"
          • "OPENID_CONNECT"
        • Settings — (map)

          Describes settings for the authentication mode.

          • CognitoUserPoolId — (String)

            The Amazon Cognito user pool ID, if Amazon Cognito was used as an authentication setting to access your data models.

          • Description — (String)

            The API key description for API_KEY, if it was used as an authentication mechanism to access your data models.

          • ExpirationTime — (Float)

            The API key expiration time for API_KEY, if it was used as an authentication mechanism to access your data models.

          • OpenIDAuthTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDClientId — (String)

            The clientID for openID, if openID was used as an authentication setting to access your data models.

          • OpenIDIatTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDIssueURL — (String)

            The openID issuer URL, if openID was used as an authentication setting to access your data models.

          • OpenIDProviderName — (String)

            The OpenID provider name, if OpenID was used as an authentication mechanism to access your data models.

      • ApiName — (String)

        The API name used to interact with the data model, configured as a part of your Amplify project.

      • ConflictResolution — (map)

        The conflict resolution strategy for your data stored in the data models.

        • ResolutionStrategy — (String)

          The strategy for conflict resolution.

          Possible values include:
          • "OPTIMISTIC_CONCURRENCY"
          • "LAMBDA"
          • "AUTOMERGE"
          • "NONE"
      • DefaultAuthType — (map)

        The default authentication type for interacting with the configured data models in your Amplify project.

        • Mode — (String)

          Describes the authentication mode.

          Possible values include:
          • "API_KEY"
          • "AWS_IAM"
          • "AMAZON_COGNITO_USER_POOLS"
          • "OPENID_CONNECT"
        • Settings — (map)

          Describes settings for the authentication mode.

          • CognitoUserPoolId — (String)

            The Amazon Cognito user pool ID, if Amazon Cognito was used as an authentication setting to access your data models.

          • Description — (String)

            The API key description for API_KEY, if it was used as an authentication mechanism to access your data models.

          • ExpirationTime — (Float)

            The API key expiration time for API_KEY, if it was used as an authentication mechanism to access your data models.

          • OpenIDAuthTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDClientId — (String)

            The clientID for openID, if openID was used as an authentication setting to access your data models.

          • OpenIDIatTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDIssueURL — (String)

            The openID issuer URL, if openID was used as an authentication setting to access your data models.

          • OpenIDProviderName — (String)

            The OpenID provider name, if OpenID was used as an authentication mechanism to access your data models.

      • Service — (String)

        The service used to provision and interact with the data model.

      • TransformSchema — (String)

        The definition of the data model in the annotated transform of the GraphQL schema.

    • ResourceName — (String)

      The name of this resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • ResourceConfig — (map)

        The resource configuration for this response object.

        • AdditionalAuthTypes — (Array<map>)

          Additional authentication methods used to interact with your data models.

          • Mode — (String)

            Describes the authentication mode.

            Possible values include:
            • "API_KEY"
            • "AWS_IAM"
            • "AMAZON_COGNITO_USER_POOLS"
            • "OPENID_CONNECT"
          • Settings — (map)

            Describes settings for the authentication mode.

            • CognitoUserPoolId — (String)

              The Amazon Cognito user pool ID, if Amazon Cognito was used as an authentication setting to access your data models.

            • Description — (String)

              The API key description for API_KEY, if it was used as an authentication mechanism to access your data models.

            • ExpirationTime — (Float)

              The API key expiration time for API_KEY, if it was used as an authentication mechanism to access your data models.

            • OpenIDAuthTTL — (String)

              The expiry time for the OpenID authentication mechanism.

            • OpenIDClientId — (String)

              The clientID for openID, if openID was used as an authentication setting to access your data models.

            • OpenIDIatTTL — (String)

              The expiry time for the OpenID authentication mechanism.

            • OpenIDIssueURL — (String)

              The openID issuer URL, if openID was used as an authentication setting to access your data models.

            • OpenIDProviderName — (String)

              The OpenID provider name, if OpenID was used as an authentication mechanism to access your data models.

        • ApiName — (String)

          The API name used to interact with the data model, configured as a part of your Amplify project.

        • ConflictResolution — (map)

          The conflict resolution strategy for your data stored in the data models.

          • ResolutionStrategy — (String)

            The strategy for conflict resolution.

            Possible values include:
            • "OPTIMISTIC_CONCURRENCY"
            • "LAMBDA"
            • "AUTOMERGE"
            • "NONE"
        • DefaultAuthType — (map)

          The default authentication type for interacting with the configured data models in your Amplify project.

          • Mode — (String)

            Describes the authentication mode.

            Possible values include:
            • "API_KEY"
            • "AWS_IAM"
            • "AMAZON_COGNITO_USER_POOLS"
            • "OPENID_CONNECT"
          • Settings — (map)

            Describes settings for the authentication mode.

            • CognitoUserPoolId — (String)

              The Amazon Cognito user pool ID, if Amazon Cognito was used as an authentication setting to access your data models.

            • Description — (String)

              The API key description for API_KEY, if it was used as an authentication mechanism to access your data models.

            • ExpirationTime — (Float)

              The API key expiration time for API_KEY, if it was used as an authentication mechanism to access your data models.

            • OpenIDAuthTTL — (String)

              The expiry time for the OpenID authentication mechanism.

            • OpenIDClientId — (String)

              The clientID for openID, if openID was used as an authentication setting to access your data models.

            • OpenIDIatTTL — (String)

              The expiry time for the OpenID authentication mechanism.

            • OpenIDIssueURL — (String)

              The openID issuer URL, if openID was used as an authentication setting to access your data models.

            • OpenIDProviderName — (String)

              The OpenID provider name, if OpenID was used as an authentication mechanism to access your data models.

        • Service — (String)

          The service used to provision and interact with the data model.

        • TransformSchema — (String)

          The definition of the data model in the annotated transform of the GraphQL schema.

      • ResourceName — (String)

        The name of this resource.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBackendAPIModels(params = {}, callback) ⇒ AWS.Request

Generates a model schema for existing backend API resource.

Service Reference:

Examples:

Calling the getBackendAPIModels operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  ResourceName: 'STRING_VALUE' /* required */
};
amplifybackend.getBackendAPIModels(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • ResourceName — (String)

      The name of this resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Models — (String)

        Stringified JSON of the datastore model.

      • Status — (String)

        The current status of the request.

        Possible values include:
        • "LATEST"
        • "STALE"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBackendAuth(params = {}, callback) ⇒ AWS.Request

Gets a backend auth details.

Service Reference:

Examples:

Calling the getBackendAuth operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  ResourceName: 'STRING_VALUE' /* required */
};
amplifybackend.getBackendAuth(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • ResourceName — (String)

      The name of this resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • ResourceConfig — (map)

        The resource configuration for authorization requests to the backend of your Amplify project.

        • AuthResourcesrequired — (String)

          Defines whether you want to configure only authentication or both authentication and authorization settings.

          Possible values include:
          • "USER_POOL_ONLY"
          • "IDENTITY_POOL_AND_USER_POOL"
        • IdentityPoolConfigs — (map)

          Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part of your auth resource in the Amplify project.

          • IdentityPoolNamerequired — (String)

            Name of the Amazon Cognito identity pool used for authorization.

          • UnauthenticatedLoginrequired — (Boolean)

            Set to true or false based on whether you want to enable guest authorization to your Amplify app.

        • Servicerequired — (String)

          Defines the service name to use when configuring an authentication resource in your Amplify project.

          Possible values include:
          • "COGNITO"
        • UserPoolConfigsrequired — (map)

          Describes authentication configuration for the Amazon Cognito user pool, provisioned as a part of your auth resource in the Amplify project.

          • ForgotPassword — (map)

            Describes the forgotten password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.

            • DeliveryMethodrequired — (String)

              Describes which mode to use (either SMS or email) to deliver messages to app users who want to recover their password.

              Possible values include:
              • "EMAIL"
              • "SMS"
            • EmailSettings — (map)

              The configuration for the email sent when an app user forgets their password.

              • EmailMessage — (String)

                The body of the email.

              • EmailSubject — (String)

                The subject of the email.

            • SmsSettings — (map)

              The configuration for the SMS message sent when an app user forgets their password.

              • SmsMessage — (String)

                The body of the SMS message.

          • Mfa — (map)

            Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool configured as a part of your Amplify project.

            • MFAModerequired — (String)

              Describes whether MFA should be [ON, OFF, or OPTIONAL] for authentication in your Amplify project.

              Possible values include:
              • "ON"
              • "OFF"
              • "OPTIONAL"
            • Settings — (map)

              Describes the configuration settings and methods for your Amplify app users to use MFA.

              • MfaTypes — (Array<String>)

                The supported MFA types.

              • SmsMessage — (String)

                The body of the SMS message.

          • OAuth — (map)

            Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your Amplify project.

            • DomainPrefix — (String)

              The domain prefix for your Amplify app.

            • OAuthGrantTyperequired — (String)

              The OAuth grant type that you use to allow app users to authenticate from your Amplify app.

              Possible values include:
              • "CODE"
              • "IMPLICIT"
            • OAuthScopesrequired — (Array<String>)

              List of OAuth-related flows used to allow your app users to authenticate from your Amplify app.

            • RedirectSignInURIsrequired — (Array<String>)

              The redirected URI for signing in to your Amplify app.

            • RedirectSignOutURIsrequired — (Array<String>)

              Redirect URLs that OAuth uses when a user signs out of an Amplify app.

            • SocialProviderSettings — (map)

              The settings for using social providers to access your Amplify app.

              • Facebook — (map)

                Describes third-party social federation configurations for allowing your app users to sign in using OAuth.

                • ClientId — (String)

                  Describes the client_id, which can be obtained from the third-party social federation provider.

                • ClientSecret — (String)

                  Describes the client_secret, which can be obtained from third-party social federation providers.

              • Google — (map)

                Describes third-party social federation configurations for allowing your app users to sign in using OAuth.

                • ClientId — (String)

                  Describes the client_id, which can be obtained from the third-party social federation provider.

                • ClientSecret — (String)

                  Describes the client_secret, which can be obtained from third-party social federation providers.

              • LoginWithAmazon — (map)

                Describes third-party social federation configurations for allowing your app users to sign in using OAuth.

                • ClientId — (String)

                  Describes the client_id, which can be obtained from the third-party social federation provider.

                • ClientSecret — (String)

                  Describes the client_secret, which can be obtained from third-party social federation providers.

              • SignInWithApple — (map)

                Describes Apple social federation configurations for allowing your app users to sign in using OAuth.

                • ClientId — (String)

                  Describes the client_id (also called Services ID) that comes from Apple.

                • KeyId — (String)

                  Describes the key_id that comes from Apple.

                • PrivateKey — (String)

                  Describes the private_key that comes from Apple.

                • TeamId — (String)

                  Describes the team_id that comes from Apple.

          • PasswordPolicy — (map)

            Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.

            • AdditionalConstraints — (Array<String>)

              Additional constraints for the password used to access the backend of your Amplify project.

            • MinimumLengthrequired — (Float)

              The minimum length of the password used to access the backend of your Amplify project.

          • RequiredSignUpAttributesrequired — (Array<String>)

            The required attributes to sign up new users in the user pool.

          • SignInMethodrequired — (String)

            Describes the sign-in methods that your Amplify app users use to log in using the Amazon Cognito user pool, configured as a part of your Amplify project.

            Possible values include:
            • "EMAIL"
            • "EMAIL_AND_PHONE_NUMBER"
            • "PHONE_NUMBER"
            • "USERNAME"
          • UserPoolNamerequired — (String)

            The Amazon Cognito user pool name.

      • ResourceName — (String)

        The name of this resource.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBackendJob(params = {}, callback) ⇒ AWS.Request

Returns information about a specific job.

Service Reference:

Examples:

Calling the getBackendJob operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  JobId: 'STRING_VALUE' /* required */
};
amplifybackend.getBackendJob(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • JobId — (String)

      The ID for the job.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • CreateTime — (String)

        The time when the job was created.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

      • UpdateTime — (String)

        The time when the job was last updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getToken(params = {}, callback) ⇒ AWS.Request

Gets the challenge token based on the given appId and sessionId.

Service Reference:

Examples:

Calling the getToken operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  SessionId: 'STRING_VALUE' /* required */
};
amplifybackend.getToken(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • SessionId — (String)

      The session ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • ChallengeCode — (String)

        The one-time challenge code for authenticating into the Amplify Admin UI.

      • SessionId — (String)

        A unique ID provided when creating a new challenge token.

      • Ttl — (String)

        The expiry time for the one-time generated token code.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

importBackendAuth(params = {}, callback) ⇒ AWS.Request

Imports an existing backend authentication resource.

Service Reference:

Examples:

Calling the importBackendAuth operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  NativeClientId: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE', /* required */
  WebClientId: 'STRING_VALUE', /* required */
  IdentityPoolId: 'STRING_VALUE'
};
amplifybackend.importBackendAuth(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • IdentityPoolId — (String)

      The ID of the Amazon Cognito identity pool.

    • NativeClientId — (String)

      The ID of the Amazon Cognito native client.

    • UserPoolId — (String)

      The ID of the Amazon Cognito user pool.

    • WebClientId — (String)

      The ID of the Amazon Cognito web client.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listBackendJobs(params = {}, callback) ⇒ AWS.Request

Lists the jobs for the backend of an Amplify app.

Service Reference:

Examples:

Calling the listBackendJobs operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  JobId: 'STRING_VALUE',
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE',
  Operation: 'STRING_VALUE',
  Status: 'STRING_VALUE'
};
amplifybackend.listBackendJobs(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • JobId — (String)

      The ID for the job.

    • MaxResults — (Integer)

      The maximum number of results that you want in the response.

    • NextToken — (String)

      The token for the next set of results.

    • Operation — (String)

      Filters the list of response objects to include only those with the specified operation name.

    • Status — (String)

      Filters the list of response objects to include only those with the specified status.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Jobs — (Array<map>)

        An array of jobs and their properties.

        • AppIdrequired — (String)

          The app ID.

        • BackendEnvironmentNamerequired — (String)

          The name of the backend environment.

        • CreateTime — (String)

          The time when the job was created.

        • Error — (String)

          If the request fails, this error is returned.

        • JobId — (String)

          The ID for the job.

        • Operation — (String)

          The name of the operation.

        • Status — (String)

          The current status of the request.

        • UpdateTime — (String)

          The time when the job was last updated.

      • NextToken — (String)

        The token for the next set of results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

removeAllBackends(params = {}, callback) ⇒ AWS.Request

Removes all backend environments from your Amplify project.

Service Reference:

Examples:

Calling the removeAllBackends operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  CleanAmplifyApp: true || false
};
amplifybackend.removeAllBackends(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • CleanAmplifyApp — (Boolean)

      Cleans up the Amplify Console app if this value is set to true.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

removeBackendConfig(params = {}, callback) ⇒ AWS.Request

Removes the AWS resources required to access the Amplify Admin UI.

Service Reference:

Examples:

Calling the removeBackendConfig operation

var params = {
  AppId: 'STRING_VALUE' /* required */
};
amplifybackend.removeBackendConfig(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Error — (String)

        If the request fails, this error is returned.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateBackendAPI(params = {}, callback) ⇒ AWS.Request

Updates an existing backend API resource.

Service Reference:

Examples:

Calling the updateBackendAPI operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  ResourceName: 'STRING_VALUE', /* required */
  ResourceConfig: {
    AdditionalAuthTypes: [
      {
        Mode: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT,
        Settings: {
          CognitoUserPoolId: 'STRING_VALUE',
          Description: 'STRING_VALUE',
          ExpirationTime: 'NUMBER_VALUE',
          OpenIDAuthTTL: 'STRING_VALUE',
          OpenIDClientId: 'STRING_VALUE',
          OpenIDIatTTL: 'STRING_VALUE',
          OpenIDIssueURL: 'STRING_VALUE',
          OpenIDProviderName: 'STRING_VALUE'
        }
      },
      /* more items */
    ],
    ApiName: 'STRING_VALUE',
    ConflictResolution: {
      ResolutionStrategy: OPTIMISTIC_CONCURRENCY | LAMBDA | AUTOMERGE | NONE
    },
    DefaultAuthType: {
      Mode: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT,
      Settings: {
        CognitoUserPoolId: 'STRING_VALUE',
        Description: 'STRING_VALUE',
        ExpirationTime: 'NUMBER_VALUE',
        OpenIDAuthTTL: 'STRING_VALUE',
        OpenIDClientId: 'STRING_VALUE',
        OpenIDIatTTL: 'STRING_VALUE',
        OpenIDIssueURL: 'STRING_VALUE',
        OpenIDProviderName: 'STRING_VALUE'
      }
    },
    Service: 'STRING_VALUE',
    TransformSchema: 'STRING_VALUE'
  }
};
amplifybackend.updateBackendAPI(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • ResourceConfig — (map)

      Defines the resource configuration for the data model in your Amplify project.

      • AdditionalAuthTypes — (Array<map>)

        Additional authentication methods used to interact with your data models.

        • Mode — (String)

          Describes the authentication mode.

          Possible values include:
          • "API_KEY"
          • "AWS_IAM"
          • "AMAZON_COGNITO_USER_POOLS"
          • "OPENID_CONNECT"
        • Settings — (map)

          Describes settings for the authentication mode.

          • CognitoUserPoolId — (String)

            The Amazon Cognito user pool ID, if Amazon Cognito was used as an authentication setting to access your data models.

          • Description — (String)

            The API key description for API_KEY, if it was used as an authentication mechanism to access your data models.

          • ExpirationTime — (Float)

            The API key expiration time for API_KEY, if it was used as an authentication mechanism to access your data models.

          • OpenIDAuthTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDClientId — (String)

            The clientID for openID, if openID was used as an authentication setting to access your data models.

          • OpenIDIatTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDIssueURL — (String)

            The openID issuer URL, if openID was used as an authentication setting to access your data models.

          • OpenIDProviderName — (String)

            The OpenID provider name, if OpenID was used as an authentication mechanism to access your data models.

      • ApiName — (String)

        The API name used to interact with the data model, configured as a part of your Amplify project.

      • ConflictResolution — (map)

        The conflict resolution strategy for your data stored in the data models.

        • ResolutionStrategy — (String)

          The strategy for conflict resolution.

          Possible values include:
          • "OPTIMISTIC_CONCURRENCY"
          • "LAMBDA"
          • "AUTOMERGE"
          • "NONE"
      • DefaultAuthType — (map)

        The default authentication type for interacting with the configured data models in your Amplify project.

        • Mode — (String)

          Describes the authentication mode.

          Possible values include:
          • "API_KEY"
          • "AWS_IAM"
          • "AMAZON_COGNITO_USER_POOLS"
          • "OPENID_CONNECT"
        • Settings — (map)

          Describes settings for the authentication mode.

          • CognitoUserPoolId — (String)

            The Amazon Cognito user pool ID, if Amazon Cognito was used as an authentication setting to access your data models.

          • Description — (String)

            The API key description for API_KEY, if it was used as an authentication mechanism to access your data models.

          • ExpirationTime — (Float)

            The API key expiration time for API_KEY, if it was used as an authentication mechanism to access your data models.

          • OpenIDAuthTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDClientId — (String)

            The clientID for openID, if openID was used as an authentication setting to access your data models.

          • OpenIDIatTTL — (String)

            The expiry time for the OpenID authentication mechanism.

          • OpenIDIssueURL — (String)

            The openID issuer URL, if openID was used as an authentication setting to access your data models.

          • OpenIDProviderName — (String)

            The OpenID provider name, if OpenID was used as an authentication mechanism to access your data models.

      • Service — (String)

        The service used to provision and interact with the data model.

      • TransformSchema — (String)

        The definition of the data model in the annotated transform of the GraphQL schema.

    • ResourceName — (String)

      The name of this resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateBackendAuth(params = {}, callback) ⇒ AWS.Request

Updates an existing backend authentication resource.

Service Reference:

Examples:

Calling the updateBackendAuth operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  ResourceConfig: { /* required */
    AuthResources: USER_POOL_ONLY | IDENTITY_POOL_AND_USER_POOL, /* required */
    Service: COGNITO, /* required */
    UserPoolConfigs: { /* required */
      ForgotPassword: {
        DeliveryMethod: EMAIL | SMS,
        EmailSettings: {
          EmailMessage: 'STRING_VALUE',
          EmailSubject: 'STRING_VALUE'
        },
        SmsSettings: {
          SmsMessage: 'STRING_VALUE'
        }
      },
      Mfa: {
        MFAMode: ON | OFF | OPTIONAL,
        Settings: {
          MfaTypes: [
            SMS | TOTP,
            /* more items */
          ],
          SmsMessage: 'STRING_VALUE'
        }
      },
      OAuth: {
        DomainPrefix: 'STRING_VALUE',
        OAuthGrantType: CODE | IMPLICIT,
        OAuthScopes: [
          PHONE | EMAIL | OPENID | PROFILE | AWS_COGNITO_SIGNIN_USER_ADMIN,
          /* more items */
        ],
        RedirectSignInURIs: [
          'STRING_VALUE',
          /* more items */
        ],
        RedirectSignOutURIs: [
          'STRING_VALUE',
          /* more items */
        ],
        SocialProviderSettings: {
          Facebook: {
            ClientId: 'STRING_VALUE',
            ClientSecret: 'STRING_VALUE'
          },
          Google: {
            ClientId: 'STRING_VALUE',
            ClientSecret: 'STRING_VALUE'
          },
          LoginWithAmazon: {
            ClientId: 'STRING_VALUE',
            ClientSecret: 'STRING_VALUE'
          },
          SignInWithApple: {
            ClientId: 'STRING_VALUE',
            KeyId: 'STRING_VALUE',
            PrivateKey: 'STRING_VALUE',
            TeamId: 'STRING_VALUE'
          }
        }
      },
      PasswordPolicy: {
        AdditionalConstraints: [
          REQUIRE_DIGIT | REQUIRE_LOWERCASE | REQUIRE_SYMBOL | REQUIRE_UPPERCASE,
          /* more items */
        ],
        MinimumLength: 'NUMBER_VALUE'
      }
    },
    IdentityPoolConfigs: {
      UnauthenticatedLogin: true || false
    }
  },
  ResourceName: 'STRING_VALUE' /* required */
};
amplifybackend.updateBackendAuth(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • ResourceConfig — (map)

      The resource configuration for this request object.

      • AuthResourcesrequired — (String)

        Defines the service name to use when configuring an authentication resource in your Amplify project.

        Possible values include:
        • "USER_POOL_ONLY"
        • "IDENTITY_POOL_AND_USER_POOL"
      • IdentityPoolConfigs — (map)

        Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part of your auth resource in the Amplify project.

        • UnauthenticatedLogin — (Boolean)

          A boolean value that can be set to allow or disallow guest-level authorization into your Amplify app.

      • Servicerequired — (String)

        Defines the service name to use when configuring an authentication resource in your Amplify project.

        Possible values include:
        • "COGNITO"
      • UserPoolConfigsrequired — (map)

        Describes the authentication configuration for the Amazon Cognito user pool, provisioned as a part of your auth resource in the Amplify project.

        • ForgotPassword — (map)

          Describes the forgot password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.

          • DeliveryMethod — (String)

            Describes which mode to use (either SMS or email) to deliver messages to app users that want to recover their password.

            Possible values include:
            • "EMAIL"
            • "SMS"
          • EmailSettings — (map)

            The configuration for the email sent when an app user forgets their password.

            • EmailMessage — (String)

              The body of the email.

            • EmailSubject — (String)

              The subject of the email.

          • SmsSettings — (map)

            The configuration for the SMS message sent when an Amplify app user forgets their password.

            • SmsMessage — (String)

              The body of the SMS message.

        • Mfa — (map)

          Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool configured as a part of your Amplify project.

          • MFAMode — (String)

            The MFA mode for the backend of your Amplify project.

            Possible values include:
            • "ON"
            • "OFF"
            • "OPTIONAL"
          • Settings — (map)

            The settings of your MFA configuration for the backend of your Amplify project.

            • MfaTypes — (Array<String>)

              The supported MFA types.

            • SmsMessage — (String)

              The body of the SMS message.

        • OAuth — (map)

          Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your Amplify project.

          • DomainPrefix — (String)

            The Amazon Cognito domain prefix used to create a hosted UI for authentication.

          • OAuthGrantType — (String)

            The OAuth grant type to allow app users to authenticate from your Amplify app.

            Possible values include:
            • "CODE"
            • "IMPLICIT"
          • OAuthScopes — (Array<String>)

            The list of OAuth-related flows that can allow users to authenticate from your Amplify app.

          • RedirectSignInURIs — (Array<String>)

            Redirect URLs that OAuth uses when a user signs in to an Amplify app.

          • RedirectSignOutURIs — (Array<String>)

            Redirect URLs that OAuth uses when a user signs out of an Amplify app.

          • SocialProviderSettings — (map)

            Describes third-party social federation configurations for allowing your users to sign in with OAuth.

            • Facebook — (map)

              Describes third-party social federation configurations for allowing your app users to sign in using OAuth.

              • ClientId — (String)

                Describes the client_id, which can be obtained from the third-party social federation provider.

              • ClientSecret — (String)

                Describes the client_secret, which can be obtained from third-party social federation providers.

            • Google — (map)

              Describes third-party social federation configurations for allowing your app users to sign in using OAuth.

              • ClientId — (String)

                Describes the client_id, which can be obtained from the third-party social federation provider.

              • ClientSecret — (String)

                Describes the client_secret, which can be obtained from third-party social federation providers.

            • LoginWithAmazon — (map)

              Describes third-party social federation configurations for allowing your app users to sign in using OAuth.

              • ClientId — (String)

                Describes the client_id, which can be obtained from the third-party social federation provider.

              • ClientSecret — (String)

                Describes the client_secret, which can be obtained from third-party social federation providers.

            • SignInWithApple — (map)

              Describes Apple social federation configurations for allowing your app users to sign in using OAuth.

              • ClientId — (String)

                Describes the client_id (also called Services ID) that comes from Apple.

              • KeyId — (String)

                Describes the key_id that comes from Apple.

              • PrivateKey — (String)

                Describes the private_key that comes from Apple.

              • TeamId — (String)

                Describes the team_id that comes from Apple.

        • PasswordPolicy — (map)

          Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.

          • AdditionalConstraints — (Array<String>)

            Describes additional constraints on password requirements to sign in to the auth resource, configured as a part of your Amplify project.

          • MinimumLength — (Float)

            Describes the minimum length of the password required to sign in to the auth resource, configured as a part of your Amplify project.

    • ResourceName — (String)

      The name of this resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateBackendConfig(params = {}, callback) ⇒ AWS.Request

Updates the AWS resources required to access the Amplify Admin UI.

Service Reference:

Examples:

Calling the updateBackendConfig operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  LoginAuthConfig: {
    AwsCognitoIdentityPoolId: 'STRING_VALUE',
    AwsCognitoRegion: 'STRING_VALUE',
    AwsUserPoolsId: 'STRING_VALUE',
    AwsUserPoolsWebClientId: 'STRING_VALUE'
  }
};
amplifybackend.updateBackendConfig(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • LoginAuthConfig — (map)

      Describes the Amazon Cognito configuration for Admin UI access.

      • AwsCognitoIdentityPoolId — (String)

        The Amazon Cognito identity pool ID used for the Amplify Admin UI login authorization.

      • AwsCognitoRegion — (String)

        The AWS Region for the Amplify Admin UI login.

      • AwsUserPoolsId — (String)

        The Amazon Cognito user pool ID used for Amplify Admin UI login authentication.

      • AwsUserPoolsWebClientId — (String)

        The web client ID for the Amazon Cognito user pools.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendManagerAppId — (String)

        The app ID for the backend manager.

      • Error — (String)

        If the request fails, this error is returned.

      • LoginAuthConfig — (map)

        Describes the Amazon Cognito configurations for the Admin UI auth resource to log in with.

        • AwsCognitoIdentityPoolId — (String)

          The Amazon Cognito identity pool ID used for the Amplify Admin UI login authorization.

        • AwsCognitoRegion — (String)

          The AWS Region for the Amplify Admin UI login.

        • AwsUserPoolsId — (String)

          The Amazon Cognito user pool ID used for Amplify Admin UI login authentication.

        • AwsUserPoolsWebClientId — (String)

          The web client ID for the Amazon Cognito user pools.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateBackendJob(params = {}, callback) ⇒ AWS.Request

Updates a specific job.

Service Reference:

Examples:

Calling the updateBackendJob operation

var params = {
  AppId: 'STRING_VALUE', /* required */
  BackendEnvironmentName: 'STRING_VALUE', /* required */
  JobId: 'STRING_VALUE', /* required */
  Operation: 'STRING_VALUE',
  Status: 'STRING_VALUE'
};
amplifybackend.updateBackendJob(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppId — (String)

      The app ID.

    • BackendEnvironmentName — (String)

      The name of the backend environment.

    • JobId — (String)

      The ID for the job.

    • Operation — (String)

      Filters the list of response objects to include only those with the specified operation name.

    • Status — (String)

      Filters the list of response objects to include only those with the specified status.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppId — (String)

        The app ID.

      • BackendEnvironmentName — (String)

        The name of the backend environment.

      • CreateTime — (String)

        The time when the job was created.

      • Error — (String)

        If the request fails, this error is returned.

      • JobId — (String)

        The ID for the job.

      • Operation — (String)

        The name of the operation.

      • Status — (String)

        The current status of the request.

      • UpdateTime — (String)

        The time when the job was last updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.