create_application_version
¶
create_application_version(
application_name: ApplicationName,
version_label: VersionLabel,
*,
config_overrides: Optional[ElasticBeanstalkClientConfig] = None,
description: Optional[Description] = None,
source_build_information: Optional[SourceBuildInformation] = None,
source_bundle: Optional[S3Location] = None,
build_configuration: Optional[BuildConfiguration] = None,
auto_create_application: Optional[AutoCreateApplication] = None,
process: Optional[ApplicationVersionProccess] = None,
tags: Optional[Tags] = None,
image_configuration: Optional[ImageConfiguration] = None,
) -> ApplicationVersionDescriptionMessage
Creates an application version for the specified application. You can create an application version from a source bundle in Amazon S3, a commit in CodeCommit, or the output of an CodeBuild build as follows:
Specify a commit in an CodeCommit repository with SourceBuildInformation.
Specify a build in an CodeBuild with SourceBuildInformation and BuildConfiguration.
Specify a source bundle in Amazon S3 with SourceBundle
Omit both SourceBuildInformation and SourceBundle to use the default sample application.
After you create an application version with a specified Amazon S3 bucket and key location, you can't change that Amazon S3 location. If you change the Amazon S3 location, you receive an exception when you attempt to launch an environment from the application version.
Parameters:
-
application_name(ApplicationName) –The name of the application. If no application is found with this name, and
AutoCreateApplicationisfalse, returns anInvalidParameterValueerror. -
version_label(VersionLabel) –A label identifying this version.
Constraint: Must be unique per application. If an application version already exists with this label for the specified application, Elastic Beanstalk returns an
InvalidParameterValueerror. -
description(Optional[Description], default:None) –A description of this application version.
-
source_build_information(Optional[SourceBuildInformation], default:None) –Specify a commit in an CodeCommit Git repository to use as the source code for the application version.
-
source_bundle(Optional[S3Location], default:None) –The Amazon S3 bucket and key that identify the location of the source bundle for this version.
The Amazon S3 bucket must be in the same region as the environment.
Unless you're specifying a source bundle in the bucket that Elastic Beanstalk manages in your account, you must assign a custom policy to your user, and grant
Allowpermission to thes3:Get*actions on your S3 object resource, for example,arn:aws:s3:::your-bucket/your-source-bundle-object.Specify a source bundle in Amazon S3 or a commit in an CodeCommit repository (with
SourceBuildInformation), but not both. If neitherSourceBundlenorSourceBuildInformationare provided, Elastic Beanstalk uses a sample application. -
build_configuration(Optional[BuildConfiguration], default:None) –Settings for an CodeBuild build.
Don't specify
BuildConfigurationtogether withImageConfiguration, which configures a container image build instead. -
auto_create_application(Optional[AutoCreateApplication], default:None) –Set to
trueto create an application with the specified name if it doesn't already exist. -
process(Optional[ApplicationVersionProccess], default:None) –Pre-processes and validates the environment manifest (
env.yaml) and configuration files (*.configfiles in the.ebextensionsfolder) in the source bundle. Validating configuration files can identify issues prior to deploying the application version to an environment.You must turn processing on for application versions that you create using CodeBuild or CodeCommit. For application versions built from a source bundle in Amazon S3, processing is optional.
The
Processoption validates Elastic Beanstalk configuration files. It doesn't validate your application's configuration files, like proxy server or Docker configuration. -
tags(Optional[Tags], default:None) –Specifies the tags applied to the application version.
Elastic Beanstalk applies these tags only to the application version. Environments that use the application version don't inherit the tags.
-
image_configuration(Optional[ImageConfiguration], default:None) –The source of the container image for this application version. You can specify an image that you built and pushed to a container registry yourself, or settings for Elastic Beanstalk to build one from your source bundle. Specify exactly one of the
SourceandBuildmembers.Don't specify
ImageConfigurationtogether withBuildConfiguration, which configures an CodeBuild build instead.
Raises:
-
CodeBuildNotInServiceRegionException–CodeBuild is not available in the specified region.
-
InsufficientPrivilegesException–The specified account does not have sufficient privileges for one or more Amazon Web Services services.
-
S3LocationNotInServiceRegionException–The specified S3 bucket does not belong to the S3 region in which the service is running. The following regions are supported:
-
IAD/us-east-1
-
PDX/us-west-2
-
DUB/eu-west-1
-
-
TooManyApplicationsException–The specified account has reached its limit of applications.
-
TooManyApplicationVersionsException–The specified account has reached its limit of application versions.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create a new application The following operation creates a new version (v1) of an application named my-app:
>>> client.create_application_version(application_name='my-app', version_label='v1', description='my-app-v1', source_bundle={'S3Bucket': 'my-bucket', 'S3Key': 'sample.war'}, auto_create_application=True, process=True)
Source code in docs_src/capo_elastic_beanstalk/_services/elastic_beanstalk.py
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 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 | |