AmplifyGen3 / Client / create_app

create_app

AmplifyGen3.Client.create_app(**kwargs)

Creates a new Amplify Gen 3 app.

See also: AWS API Documentation

Request Syntax

response = client.create_app(
    AppName='string',
    SourceConfig={
        'GitHubSource': {
            'RepositoryUrl': 'string',
            'ProductionBranch': 'string'
        },
        'GitLabSource': {
            'RepositoryUrl': 'string',
            'Owner': 'string',
            'ProductionBranch': 'string'
        }
    },
    Web={
        'BuildConfig': {
            'InstallCommand': 'string',
            'BuildCommand': 'string',
            'RootDirectory': 'string',
            'OutputDirectory': 'string'
        }
    },
    Backend={
        'MigrationsDirectory': 'string'
    },
    DefaultEnvironmentsConfiguration=[
        {
            'EnvironmentType': 'PRODUCTION'|'PREVIEW',
            'EnvironmentPermissionsConfig': {
                'ExecutionRoleArn': 'string',
                'PermissionMode': 'SCOPED'|'FULL'
            },
            'EnvironmentNetworkConfig': {
                'BuildNetworkConnectorArn': 'string',
                'ComputeNetworkConnectorArn': 'string'
            },
            'Backend': {
                'Auth': 'string',
                'Database': {
                    'MaxBackendCapacityUnits': 123,
                    'BackupRetentionDays': 123
                }
            }
        },
    ],
    Tags={
        'string': 'string'
    }
)
Parameters:
  • AppName (string) –

    [REQUIRED]

    The name of the app.

  • SourceConfig (dict) –

    The source repository configuration for the app.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: GitHubSource, GitLabSource.

    • GitHubSource (dict) –

      The GitHub source repository settings.

      • RepositoryUrl (string) – [REQUIRED]

        The URL of the source repository.

      • ProductionBranch (string) – [REQUIRED]

        The name of the production branch. CreateApp uses this only to set the branch patterns of the Production and Preview environments that it creates. The app doesn’t store it. To change the branches that an environment tracks, use UpdateEnvironment.

    • GitLabSource (dict) –

      The GitLab source repository settings.

      • RepositoryUrl (string) – [REQUIRED]

        The URL of the source repository.

      • Owner (string) – [REQUIRED]

        The owner of the repository in the Git provider.

      • ProductionBranch (string) – [REQUIRED]

        The name of the production branch. CreateApp uses this only to set the branch patterns of the Production and Preview environments that it creates. The app doesn’t store it. To change the branches that an environment tracks, use UpdateEnvironment.

  • Web (dict) –

    The web hosting settings for the app.

    • BuildConfig (dict) –

      The build settings.

      • InstallCommand (string) –

        The command that installs dependencies during the build.

      • BuildCommand (string) –

        The command that builds the application.

      • RootDirectory (string) –

        The directory in the repository that contains the application source.

      • OutputDirectory (string) –

        The directory that contains the build output to deploy.

  • Backend (dict) –

    The backend settings for the app. Omit this for a frontend-only app.

    • MigrationsDirectory (string) –

      The directory that contains the migration files, relative to the root of the source. The default is migrations. Specify an empty string to reset to the default.

  • DefaultEnvironmentsConfiguration (list) –

    [REQUIRED]

    The settings for the Production and Preview environments that Amplify creates for the app. Specify one entry for each environment.

    • (dict) –

      The settings for one of the environments that Amplify creates with an app.

      • EnvironmentType (string) – [REQUIRED]

        The type of the environment that these settings apply to.

      • EnvironmentPermissionsConfig (dict) – [REQUIRED]

        The IAM role settings for the environment.

        • ExecutionRoleArn (string) – [REQUIRED]

          The Amazon Resource Name (ARN) of the IAM role for the environment.

        • PermissionMode (string) –

          The permission mode for the environment’s IAM role. The default is SCOPED.

      • EnvironmentNetworkConfig (dict) –

        The VPC network configuration for the environment’s build and server-side rendering compute.

        • BuildNetworkConnectorArn (string) –

          The Amazon Resource Name (ARN) of the network connector used for VPC access during builds.

        • ComputeNetworkConnectorArn (string) –

          The Amazon Resource Name (ARN) of the network connector used for VPC access at runtime.

      • Backend (dict) –

        The backend settings for the environment. You can specify this only when the app has a backend.

        • Auth (string) –

          The authentication settings for the environment’s backend, as a JSON document. A secret value must be a reference to a BACKEND-scoped environment variable, in the form ${env:NAME}. If you omit this, the default settings are used.

        • Database (dict) –

          The database settings for the environment. If you omit this, the plan’s defaults are used. A value above the limit of the account’s plan causes the next deployment to fail, not this request, because the plan can change between the two.

          • MaxBackendCapacityUnits (integer) –

            The maximum number of backend capacity units that the environment’s database can scale to.

          • BackupRetentionDays (integer) –

            The number of days to keep automated backups. This is also how far back the environment’s database can be restored.

  • Tags (dict) –

    The tags to apply to the resource.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'AppArn': 'string'
}

Response Structure

  • (dict) –

    • AppArn (string) –

      The Amazon Resource Name (ARN) of the app.

Exceptions

  • AmplifyGen3.Client.exceptions.ServiceQuotaExceededException

  • AmplifyGen3.Client.exceptions.ThrottlingException

  • AmplifyGen3.Client.exceptions.AccessDeniedException

  • AmplifyGen3.Client.exceptions.ValidationException

  • AmplifyGen3.Client.exceptions.ConflictException

  • AmplifyGen3.Client.exceptions.InternalServerException