App

class aws_cdk.aws_amplify.App(scope, id, *, app_name=None, auto_branch_creation=None, auto_branch_deletion=None, basic_auth=None, build_spec=None, custom_rules=None, description=None, environment_variables=None, role=None, source_code_provider=None)

Bases: aws_cdk.core.Resource

(experimental) An Amplify Console application.

Stability

experimental

Parameters
  • scope (Construct) –

  • id (str) –

  • app_name (Optional[str]) – (experimental) The name for the application. Default: - a CDK generated name

  • auto_branch_creation (Optional[AutoBranchCreation]) – (experimental) The auto branch creation configuration. Use this to automatically create branches that match a certain pattern. Default: - no auto branch creation

  • auto_branch_deletion (Optional[bool]) – (experimental) Automatically disconnect a branch in the Amplify Console when you delete a branch from your Git repository. Default: false

  • basic_auth (Optional[BasicAuth]) – (experimental) The Basic Auth configuration. Use this to set password protection at an app level to all your branches. Default: - no password protection

  • build_spec (Optional[BuildSpec]) – (experimental) BuildSpec for the application. Alternatively, add a amplify.yml file to the repository. Default: - no build spec

  • custom_rules (Optional[List[CustomRule]]) – (experimental) Custom rewrite/redirect rules for the application. Default: - no custom rewrite/redirect rules

  • description (Optional[str]) – (experimental) A description for the application. Default: - no description

  • environment_variables (Optional[Mapping[str, str]]) – (experimental) Environment variables for the application. All environment variables that you add are encrypted to prevent rogue access so you can use them to store secret information. Default: - no environment variables

  • role (Optional[IRole]) – (experimental) The IAM service role to associate with the application. The App implements IGrantable. Default: - a new role is created

  • source_code_provider (Optional[ISourceCodeProvider]) – (experimental) The source code provider for this application. Default: - not connected to a source code provider

Stability

experimental

Methods

add_auto_branch_environment(name, value)

(experimental) Adds an environment variable to the auto created branch.

All environment variables that you add are encrypted to prevent rogue access so you can use them to store secret information.

Parameters
  • name (str) –

  • value (str) –

Stability

experimental

Return type

App

add_branch(id, *, auto_build=None, basic_auth=None, branch_name=None, build_spec=None, description=None, environment_variables=None, pull_request_environment_name=None, pull_request_preview=None, stage=None)

(experimental) Adds a branch to this application.

Parameters
  • id (str) –

  • auto_build (Optional[bool]) – (experimental) Whether to enable auto building for the branch. Default: true

  • basic_auth (Optional[BasicAuth]) – (experimental) The Basic Auth configuration. Use this to set password protection for the branch Default: - no password protection

  • branch_name (Optional[str]) – (experimental) The name of the branch. Default: - the construct’s id

  • build_spec (Optional[BuildSpec]) – (experimental) BuildSpec for the branch. Default: - no build spec

  • description (Optional[str]) – (experimental) A description for the branch. Default: - no description

  • environment_variables (Optional[Mapping[str, str]]) – (experimental) Environment variables for the branch. All environment variables that you add are encrypted to prevent rogue access so you can use them to store secret information. Default: - application environment variables

  • pull_request_environment_name (Optional[str]) – (experimental) The dedicated backend environment for the pull request previews. Default: - automatically provision a temporary backend

  • pull_request_preview (Optional[bool]) – (experimental) Whether to enable pull request preview for the branch. Default: true

  • stage (Optional[str]) – (experimental) Stage for the branch. Default: - no stage

Stability

experimental

Return type

Branch

add_custom_rule(rule)

(experimental) Adds a custom rewrite/redirect rule to this application.

Parameters

rule (CustomRule) –

Stability

experimental

Return type

App

add_domain(id, *, domain_name=None, sub_domains=None)

(experimental) Adds a domain to this application.

Parameters
  • id (str) –

  • domain_name (Optional[str]) – (experimental) The name of the domain. Default: - the construct’s id

  • sub_domains (Optional[List[SubDomain]]) – (experimental) Subdomains. Default: - use addSubDomain() to add subdomains

Stability

experimental

Return type

Domain

add_environment(name, value)

(experimental) Adds an environment variable to this application.

All environment variables that you add are encrypted to prevent rogue access so you can use them to store secret information.

Parameters
  • name (str) –

  • value (str) –

Stability

experimental

Return type

App

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

app_id

(experimental) The application id.

Stability

experimental

Return type

str

app_name

(experimental) The name of the application.

Stability

experimental

Attribute

true

Return type

str

arn

(experimental) The ARN of the application.

Stability

experimental

Attribute

true

Return type

str

default_domain

(experimental) The default domain of the application.

Stability

experimental

Attribute

true

Return type

str

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

Return type

ResourceEnvironment

grant_principal

(experimental) The principal to grant permissions to.

Stability

experimental

Return type

IPrincipal

node

The construct tree node associated with this construct.

Return type

ConstructNode

stack

The stack in which this resource is defined.

Return type

Stack

Static Methods

classmethod from_app_id(scope, id, app_id)

(experimental) Import an existing application.

Parameters
  • scope (Construct) –

  • id (str) –

  • app_id (str) –

Stability

experimental

Return type

IApp

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool