CfnAppPropsMixin

class aws_cdk.mixins_preview.aws_amplify.mixins.CfnAppPropsMixin(props, *, strategy=None)

Bases: Mixin

The AWS::Amplify::App resource specifies Apps in Amplify Hosting.

An App is a collection of branches.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-app.html

CloudformationResource:

AWS::Amplify::App

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_amplify import mixins as amplify_mixins

cfn_app_props_mixin = amplify_mixins.CfnAppPropsMixin(amplify_mixins.CfnAppMixinProps(
    access_token="accessToken",
    auto_branch_creation_config=amplify_mixins.CfnAppPropsMixin.AutoBranchCreationConfigProperty(
        auto_branch_creation_patterns=["autoBranchCreationPatterns"],
        basic_auth_config=amplify_mixins.CfnAppPropsMixin.BasicAuthConfigProperty(
            enable_basic_auth=False,
            password="password",
            username="username"
        ),
        build_spec="buildSpec",
        enable_auto_branch_creation=False,
        enable_auto_build=False,
        enable_performance_mode=False,
        enable_pull_request_preview=False,
        environment_variables=[amplify_mixins.CfnAppPropsMixin.EnvironmentVariableProperty(
            name="name",
            value="value"
        )],
        framework="framework",
        pull_request_environment_name="pullRequestEnvironmentName",
        stage="stage"
    ),
    basic_auth_config=amplify_mixins.CfnAppPropsMixin.BasicAuthConfigProperty(
        enable_basic_auth=False,
        password="password",
        username="username"
    ),
    build_spec="buildSpec",
    cache_config=amplify_mixins.CfnAppPropsMixin.CacheConfigProperty(
        type="type"
    ),
    compute_role_arn="computeRoleArn",
    custom_headers="customHeaders",
    custom_rules=[amplify_mixins.CfnAppPropsMixin.CustomRuleProperty(
        condition="condition",
        source="source",
        status="status",
        target="target"
    )],
    description="description",
    enable_branch_auto_deletion=False,
    environment_variables=[amplify_mixins.CfnAppPropsMixin.EnvironmentVariableProperty(
        name="name",
        value="value"
    )],
    iam_service_role="iamServiceRole",
    job_config=amplify_mixins.CfnAppPropsMixin.JobConfigProperty(
        build_compute_type="buildComputeType"
    ),
    name="name",
    oauth_token="oauthToken",
    platform="platform",
    repository="repository",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::Amplify::App.

Parameters:
  • props (Union[CfnAppMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['accessToken', 'autoBranchCreationConfig', 'basicAuthConfig', 'buildSpec', 'cacheConfig', 'computeRoleArn', 'customHeaders', 'customRules', 'description', 'enableBranchAutoDeletion', 'environmentVariables', 'iamServiceRole', 'jobConfig', 'name', 'oauthToken', 'platform', 'repository', 'tags']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

AutoBranchCreationConfigProperty

class CfnAppPropsMixin.AutoBranchCreationConfigProperty(*, auto_branch_creation_patterns=None, basic_auth_config=None, build_spec=None, enable_auto_branch_creation=None, enable_auto_build=None, enable_performance_mode=None, enable_pull_request_preview=None, environment_variables=None, framework=None, pull_request_environment_name=None, stage=None)

Bases: object

Use the AutoBranchCreationConfig property type to automatically create branches that match a certain pattern.

Parameters:
  • auto_branch_creation_patterns (Optional[Sequence[str]]) – Automated branch creation glob patterns for the Amplify app.

  • basic_auth_config (Union[IResolvable, BasicAuthConfigProperty, Dict[str, Any], None]) – Sets password protection for your auto created branch.

  • build_spec (Optional[str]) – The build specification (build spec) for the autocreated branch.

  • enable_auto_branch_creation (Union[bool, IResolvable, None]) – Enables automated branch creation for the Amplify app.

  • enable_auto_build (Union[bool, IResolvable, None]) – Enables auto building for the auto created branch.

  • enable_performance_mode (Union[bool, IResolvable, None]) – Enables performance mode for the branch. Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out.

  • enable_pull_request_preview (Union[bool, IResolvable, None]) – Sets whether pull request previews are enabled for each branch that Amplify Hosting automatically creates for your app. Amplify creates previews by deploying your app to a unique URL whenever a pull request is opened for the branch. Development and QA teams can use this preview to test the pull request before it’s merged into a production or integration branch. To provide backend support for your preview, Amplify Hosting automatically provisions a temporary backend environment that it deletes when the pull request is closed. If you want to specify a dedicated backend environment for your previews, use the PullRequestEnvironmentName property. For more information, see Web Previews in the AWS Amplify Hosting User Guide .

  • environment_variables (Union[IResolvable, Sequence[Union[IResolvable, EnvironmentVariableProperty, Dict[str, Any]]], None]) – The environment variables for the autocreated branch.

  • framework (Optional[str]) – The framework for the autocreated branch.

  • pull_request_environment_name (Optional[str]) – If pull request previews are enabled, you can use this property to specify a dedicated backend environment for your previews. For example, you could specify an environment named prod , test , or dev that you initialized with the Amplify CLI. To enable pull request previews, set the EnablePullRequestPreview property to true . If you don’t specify an environment, Amplify Hosting provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify deletes this environment when the pull request is closed. For more information about creating backend environments, see Feature Branch Deployments and Team Workflows in the AWS Amplify Hosting User Guide .

  • stage (Optional[str]) – Stage for the auto created branch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_amplify import mixins as amplify_mixins

auto_branch_creation_config_property = amplify_mixins.CfnAppPropsMixin.AutoBranchCreationConfigProperty(
    auto_branch_creation_patterns=["autoBranchCreationPatterns"],
    basic_auth_config=amplify_mixins.CfnAppPropsMixin.BasicAuthConfigProperty(
        enable_basic_auth=False,
        password="password",
        username="username"
    ),
    build_spec="buildSpec",
    enable_auto_branch_creation=False,
    enable_auto_build=False,
    enable_performance_mode=False,
    enable_pull_request_preview=False,
    environment_variables=[amplify_mixins.CfnAppPropsMixin.EnvironmentVariableProperty(
        name="name",
        value="value"
    )],
    framework="framework",
    pull_request_environment_name="pullRequestEnvironmentName",
    stage="stage"
)

Attributes

auto_branch_creation_patterns

Automated branch creation glob patterns for the Amplify app.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html#cfn-amplify-app-autobranchcreationconfig-autobranchcreationpatterns

basic_auth_config

Sets password protection for your auto created branch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html#cfn-amplify-app-autobranchcreationconfig-basicauthconfig

build_spec

The build specification (build spec) for the autocreated branch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html#cfn-amplify-app-autobranchcreationconfig-buildspec

enable_auto_branch_creation

Enables automated branch creation for the Amplify app.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html#cfn-amplify-app-autobranchcreationconfig-enableautobranchcreation

enable_auto_build

Enables auto building for the auto created branch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html#cfn-amplify-app-autobranchcreationconfig-enableautobuild

enable_performance_mode

Enables performance mode for the branch.

Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html#cfn-amplify-app-autobranchcreationconfig-enableperformancemode

enable_pull_request_preview

Sets whether pull request previews are enabled for each branch that Amplify Hosting automatically creates for your app.

Amplify creates previews by deploying your app to a unique URL whenever a pull request is opened for the branch. Development and QA teams can use this preview to test the pull request before it’s merged into a production or integration branch.

To provide backend support for your preview, Amplify Hosting automatically provisions a temporary backend environment that it deletes when the pull request is closed. If you want to specify a dedicated backend environment for your previews, use the PullRequestEnvironmentName property.

For more information, see Web Previews in the AWS Amplify Hosting User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html#cfn-amplify-app-autobranchcreationconfig-enablepullrequestpreview

environment_variables

The environment variables for the autocreated branch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html#cfn-amplify-app-autobranchcreationconfig-environmentvariables

framework

The framework for the autocreated branch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html#cfn-amplify-app-autobranchcreationconfig-framework

pull_request_environment_name

If pull request previews are enabled, you can use this property to specify a dedicated backend environment for your previews.

For example, you could specify an environment named prod , test , or dev that you initialized with the Amplify CLI.

To enable pull request previews, set the EnablePullRequestPreview property to true .

If you don’t specify an environment, Amplify Hosting provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify deletes this environment when the pull request is closed.

For more information about creating backend environments, see Feature Branch Deployments and Team Workflows in the AWS Amplify Hosting User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html#cfn-amplify-app-autobranchcreationconfig-pullrequestenvironmentname

stage

Stage for the auto created branch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html#cfn-amplify-app-autobranchcreationconfig-stage

BasicAuthConfigProperty

class CfnAppPropsMixin.BasicAuthConfigProperty(*, enable_basic_auth=None, password=None, username=None)

Bases: object

Use the BasicAuthConfig property type to set password protection at an app level to all your branches.

Parameters:
  • enable_basic_auth (Union[bool, IResolvable, None]) – Enables basic authorization for the Amplify app’s branches.

  • password (Optional[str]) – The password for basic authorization.

  • username (Optional[str]) – The user name for basic authorization.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-basicauthconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_amplify import mixins as amplify_mixins

basic_auth_config_property = amplify_mixins.CfnAppPropsMixin.BasicAuthConfigProperty(
    enable_basic_auth=False,
    password="password",
    username="username"
)

Attributes

enable_basic_auth

Enables basic authorization for the Amplify app’s branches.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-basicauthconfig.html#cfn-amplify-app-basicauthconfig-enablebasicauth

password

The password for basic authorization.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-basicauthconfig.html#cfn-amplify-app-basicauthconfig-password

username

The user name for basic authorization.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-basicauthconfig.html#cfn-amplify-app-basicauthconfig-username

CacheConfigProperty

class CfnAppPropsMixin.CacheConfigProperty(*, type=None)

Bases: object

Describes the cache configuration for an Amplify app.

For more information about how Amplify applies an optimal cache configuration for your app based on the type of content that is being served, see Managing cache configuration in the Amplify User guide .

Parameters:

type (Optional[str]) – The type of cache configuration to use for an Amplify app. The AMPLIFY_MANAGED cache configuration automatically applies an optimized cache configuration for your app based on its platform, routing rules, and rewrite rules. The AMPLIFY_MANAGED_NO_COOKIES cache configuration type is the same as AMPLIFY_MANAGED , except that it excludes all cookies from the cache key. This is the default setting.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-cacheconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_amplify import mixins as amplify_mixins

cache_config_property = amplify_mixins.CfnAppPropsMixin.CacheConfigProperty(
    type="type"
)

Attributes

type

The type of cache configuration to use for an Amplify app.

The AMPLIFY_MANAGED cache configuration automatically applies an optimized cache configuration for your app based on its platform, routing rules, and rewrite rules.

The AMPLIFY_MANAGED_NO_COOKIES cache configuration type is the same as AMPLIFY_MANAGED , except that it excludes all cookies from the cache key. This is the default setting.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-cacheconfig.html#cfn-amplify-app-cacheconfig-type

CustomRuleProperty

class CfnAppPropsMixin.CustomRuleProperty(*, condition=None, source=None, status=None, target=None)

Bases: object

The CustomRule property type allows you to specify redirects, rewrites, and reverse proxies.

Redirects enable a web app to reroute navigation from one URL to another.

Parameters:
  • condition (Optional[str]) – The condition for a URL rewrite or redirect rule, such as a country code.

  • source (Optional[str]) – The source pattern for a URL rewrite or redirect rule.

  • status (Optional[str]) – The status code for a URL rewrite or redirect rule. - 200 - Represents a 200 rewrite rule. - 301 - Represents a 301 (moved pemanently) redirect rule. This and all future requests should be directed to the target URL. - 302 - Represents a 302 temporary redirect rule. - 404 - Represents a 404 redirect rule. - 404-200 - Represents a 404 rewrite rule.

  • target (Optional[str]) – The target pattern for a URL rewrite or redirect rule.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-customrule.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_amplify import mixins as amplify_mixins

custom_rule_property = amplify_mixins.CfnAppPropsMixin.CustomRuleProperty(
    condition="condition",
    source="source",
    status="status",
    target="target"
)

Attributes

condition

The condition for a URL rewrite or redirect rule, such as a country code.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-customrule.html#cfn-amplify-app-customrule-condition

source

The source pattern for a URL rewrite or redirect rule.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-customrule.html#cfn-amplify-app-customrule-source

status

The status code for a URL rewrite or redirect rule.

  • 200 - Represents a 200 rewrite rule.

  • 301 - Represents a 301 (moved pemanently) redirect rule. This and all future requests should be directed to the target URL.

  • 302 - Represents a 302 temporary redirect rule.

  • 404 - Represents a 404 redirect rule.

  • 404-200 - Represents a 404 rewrite rule.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-customrule.html#cfn-amplify-app-customrule-status

target

The target pattern for a URL rewrite or redirect rule.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-customrule.html#cfn-amplify-app-customrule-target

EnvironmentVariableProperty

class CfnAppPropsMixin.EnvironmentVariableProperty(*, name=None, value=None)

Bases: object

Environment variables are key-value pairs that are available at build time.

Set environment variables for all branches in your app.

Parameters:
  • name (Optional[str]) – The environment variable name.

  • value (Optional[str]) – The environment variable value.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-environmentvariable.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_amplify import mixins as amplify_mixins

environment_variable_property = amplify_mixins.CfnAppPropsMixin.EnvironmentVariableProperty(
    name="name",
    value="value"
)

Attributes

name

The environment variable name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-environmentvariable.html#cfn-amplify-app-environmentvariable-name

value

The environment variable value.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-environmentvariable.html#cfn-amplify-app-environmentvariable-value

JobConfigProperty

class CfnAppPropsMixin.JobConfigProperty(*, build_compute_type=None)

Bases: object

Describes the configuration details that apply to the jobs for an Amplify app.

Use JobConfig to apply configuration to jobs, such as customizing the build instance size when you create or update an Amplify app. For more information about customizable build instances, see Custom build instances in the Amplify User Guide .

Parameters:

build_compute_type (Optional[str]) – Specifies the size of the build instance. Amplify supports three instance sizes: STANDARD_8GB , LARGE_16GB , and XLARGE_72GB . If you don’t specify a value, Amplify uses the STANDARD_8GB default. The following list describes the CPU, memory, and storage capacity for each build instance type: - STANDARD_8GB - - vCPUs: 4 - Memory: 8 GiB - Disk space: 128 GB - LARGE_16GB - - vCPUs: 8 - Memory: 16 GiB - Disk space: 128 GB - XLARGE_72GB - - vCPUs: 36 - Memory: 72 GiB - Disk space: 256 GB

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-jobconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_amplify import mixins as amplify_mixins

job_config_property = amplify_mixins.CfnAppPropsMixin.JobConfigProperty(
    build_compute_type="buildComputeType"
)

Attributes

build_compute_type

Specifies the size of the build instance.

Amplify supports three instance sizes: STANDARD_8GB , LARGE_16GB , and XLARGE_72GB . If you don’t specify a value, Amplify uses the STANDARD_8GB default.

The following list describes the CPU, memory, and storage capacity for each build instance type:

  • STANDARD_8GB - - vCPUs: 4

  • Memory: 8 GiB

  • Disk space: 128 GB

  • LARGE_16GB - - vCPUs: 8

  • Memory: 16 GiB

  • Disk space: 128 GB

  • XLARGE_72GB - - vCPUs: 36

  • Memory: 72 GiB

  • Disk space: 256 GB

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-jobconfig.html#cfn-amplify-app-jobconfig-buildcomputetype