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:
>>> client.create_storage_location()
Source code in docs_src/capo_elastic_beanstalk/_services/elastic_beanstalk.py
| def create_storage_location(
self, *, config_overrides: Optional[ElasticBeanstalkClientConfig] = 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:
>>> client.create_storage_location()
"""
def _handler(
req: "OperationRequest[None]",
) -> OperationResponse[
"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 = (
capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.create_storage_location.create_storage_location(
req.options
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateStorageLocation")
)
response = execute_pipeline(
OperationRequest(input=None, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|