

# CreateStorageLocation
<a name="API_CreateStorageLocation"></a>

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.

## Response Elements
<a name="API_CreateStorageLocation_ResponseElements"></a>

The following element is returned by the service.

 ** S3Bucket **   
The name of the Amazon S3 bucket created.  
Type: String  
Length Constraints: Maximum length of 255.

## Errors
<a name="API_CreateStorageLocation_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InsufficientPrivileges **   
The specified account does not have sufficient privileges for one or more Amazon services.  
HTTP Status Code: 403

 ** S3SubscriptionRequired **   
The specified account does not have a subscription to Amazon S3.  
HTTP Status Code: 400

 ** TooManyBuckets **   
The specified account has reached its limit of Amazon S3 buckets.  
HTTP Status Code: 400

## Examples
<a name="API_CreateStorageLocation_Examples"></a>

### Example
<a name="API_CreateStorageLocation_Example_1"></a>

This example illustrates one usage of CreateStorageLocation.

#### Sample Request
<a name="API_CreateStorageLocation_Example_1_Request"></a>

```
https://elasticbeanstalk.us-west-2.amazonaws.com/?Operation=CreateStorageLocation
&AuthParams
```

#### Sample Response
<a name="API_CreateStorageLocation_Example_1_Response"></a>

```
          <CreateStorageLocationResponse xmlns="https://elasticbeanstalk.amazonaws.com/docs/2010-12-01/">
  <CreateStorageLocationResult>
    <S3Bucket>elasticbeanstalk-us-east-1-780612358023</S3Bucket>
  </CreateStorageLocationResult>
  <ResponseMetadata>
    <RequestId>ef51b94a-f1d6-11df-8a78-9f77047e0d0c</RequestId>
  </ResponseMetadata>
</CreateStorageLocationResponse>
```

## See Also
<a name="API_CreateStorageLocation_SeeAlso"></a>

For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/elasticbeanstalk-2010-12-01/CreateStorageLocation) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/elasticbeanstalk-2010-12-01/CreateStorageLocation) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/elasticbeanstalk-2010-12-01/CreateStorageLocation) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/elasticbeanstalk-2010-12-01/CreateStorageLocation) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/elasticbeanstalk-2010-12-01/CreateStorageLocation) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/elasticbeanstalk-2010-12-01/CreateStorageLocation) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/elasticbeanstalk-2010-12-01/CreateStorageLocation) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/elasticbeanstalk-2010-12-01/CreateStorageLocation) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/elasticbeanstalk-2010-12-01/CreateStorageLocation) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/elasticbeanstalk-2010-12-01/CreateStorageLocation) 