Skip to content

create_storage_location async

create_storage_location(
    *, config_overrides: Optional[AsyncElasticBeanstalkClientConfig] = None
) -> CreateStorageLocationResultMessage

Creates a bucket in Amazon S3 to store application versions, logs, and other files used by Elastic Beanstalk environments. The Elastic Beanstalk console and EB CLI call this API the first time you create an environment in a region. If the storage location already exists, CreateStorageLocation still returns the bucket name but does not create a new bucket.

Raises:

Examples:

To create a new environment for an application The following operation creates a new environment for version v1 of a java application named my-app:

>>> await client.create_storage_location()
Source code in docs_src/capo_elastic_beanstalk/_services/async_elastic_beanstalk.py
async def create_storage_location(
    self, *, config_overrides: Optional[AsyncElasticBeanstalkClientConfig] = None
) -> "capo_elastic_beanstalk.types.create_storage_location_result_message.CreateStorageLocationResultMessage":
    """<p>Creates a bucket in Amazon S3 to store application versions, logs, and other files used by Elastic Beanstalk environments. The Elastic Beanstalk console and EB CLI call this API the first time you create an environment in a region. If the storage location already exists, <code>CreateStorageLocation</code> still returns the bucket name but does not create a new bucket.</p>

    Raises:
        capo_elastic_beanstalk.errors.insufficient_privileges_exception.InsufficientPrivilegesException: <p>The specified account does not have sufficient privileges for one or more Amazon Web Services services.</p>
        capo_elastic_beanstalk.errors.s3_subscription_required_exception.S3SubscriptionRequiredException: <p>The specified account does not have a subscription to Amazon S3.</p>
        capo_elastic_beanstalk.errors.too_many_buckets_exception.TooManyBucketsException: <p>The specified account has reached its limit of Amazon S3 buckets.</p>
        capo_elastic_beanstalk.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To create a new environment for an application
        The following operation creates a new environment for version v1 of a java application named my-app:

        >>> await client.create_storage_location()
    """

    async def _handler(
        req: "AsyncOperationRequest[None]",
    ) -> AsyncOperationResponse[
        "capo_elastic_beanstalk.types.create_storage_location_result_message.CreateStorageLocationResultMessage"
    ]:
        import capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.create_storage_location

        (
            output,
            http_response,
        ) = await capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.create_storage_location.async_create_storage_location(
            req.options
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateStorageLocation")
    )

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=None, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output