create_branch
async
¶
create_branch(
app_id: AppId,
branch_name: BranchName,
*,
config_overrides: Optional[AsyncAmplifyClientConfig] = None,
description: Optional[Description] = None,
stage: Optional[Stage] = None,
framework: Optional[Framework] = None,
enable_notification: Optional[EnableNotification] = None,
enable_auto_build: Optional[EnableAutoBuild] = None,
enable_skew_protection: Optional[EnableSkewProtection] = None,
environment_variables: Optional[EnvironmentVariables] = None,
basic_auth_credentials: Optional[BasicAuthCredentials] = None,
enable_basic_auth: Optional[EnableBasicAuth] = None,
enable_performance_mode: Optional[EnablePerformanceMode] = None,
tags: Optional[TagMap] = None,
build_spec: Optional[BuildSpec] = None,
ttl: Optional[TTL] = None,
display_name: Optional[DisplayName] = None,
enable_pull_request_preview: Optional[EnablePullRequestPreview] = None,
pull_request_environment_name: Optional[PullRequestEnvironmentName] = None,
backend_environment_arn: Optional[BackendEnvironmentArn] = None,
backend: Optional[Backend] = None,
compute_role_arn: Optional[ComputeRoleArn] = None,
) -> CreateBranchResult
Creates a new branch for an Amplify app.
Parameters:
-
app_id(AppId) –The unique ID for an Amplify app.
-
branch_name(BranchName) –The name for the branch.
-
description(Optional[Description], default:None) –The description for the branch.
-
stage(Optional[Stage], default:None) –Describes the current stage for the branch.
-
framework(Optional[Framework], default:None) –The framework for the branch.
-
enable_notification(Optional[EnableNotification], default:None) –Enables notifications for the branch.
-
enable_auto_build(Optional[EnableAutoBuild], default:None) –Enables auto building for the branch.
-
enable_skew_protection(Optional[EnableSkewProtection], default:None) –Specifies whether the skew protection feature is enabled for the branch.
Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see Skew protection for Amplify deployments in the Amplify User Guide.
-
environment_variables(Optional[EnvironmentVariables], default:None) –The environment variables for the branch.
-
basic_auth_credentials(Optional[BasicAuthCredentials], default:None) –The basic authorization credentials for the branch. You must base64-encode the authorization credentials and provide them in the format
user:password. -
enable_basic_auth(Optional[EnableBasicAuth], default:None) –Enables basic authorization for the branch.
-
enable_performance_mode(Optional[EnablePerformanceMode], default: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.
-
tags(Optional[TagMap], default:None) –The tag for the branch.
-
build_spec(Optional[BuildSpec], default:None) –The build specification (build spec) for the branch.
-
ttl(Optional[TTL], default:None) –The content Time To Live (TTL) for the website in seconds.
-
display_name(Optional[DisplayName], default:None) –The display name for a branch. This is used as the default domain prefix.
-
enable_pull_request_preview(Optional[EnablePullRequestPreview], default:None) –Enables pull request previews for this branch.
-
pull_request_environment_name(Optional[PullRequestEnvironmentName], default:None) –The Amplify environment name for the pull request.
-
backend_environment_arn(Optional[BackendEnvironmentArn], default:None) –The Amazon Resource Name (ARN) for a backend environment that is part of a Gen 1 Amplify app.
This field is available to Amplify Gen 1 apps only where the backend is created using Amplify Studio or the Amplify command line interface (CLI).
-
backend(Optional[Backend], default:None) –The backend for a
Branchof an Amplify app. Use for a backend created from an CloudFormation stack.This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.
-
compute_role_arn(Optional[ComputeRoleArn], default:None) –The Amazon Resource Name (ARN) of the IAM role to assign to a branch of an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific Amazon Web Services resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide.
Raises:
-
BadRequestException–A request contains unexpected data.
-
DependentServiceFailureException–An operation failed because a dependent service threw an exception.
-
InternalFailureException–The service failed to perform an operation due to an internal issue.
-
LimitExceededException–A resource could not be created because service quotas were exceeded.
-
NotFoundException–An entity was not found during an operation.
-
UnauthorizedException–An operation failed due to a lack of access.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_amplify/_services/async_amplify.py
520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 | |