:doc:`S3 <../../s3>` / Client / create_bucket_metadata_configuration

************************************
create_bucket_metadata_configuration
************************************



.. py:method:: S3.Client.create_bucket_metadata_configuration(**kwargs)

  

  Creates an S3 Metadata V2 metadata configuration for a general purpose bucket. For more information, see `Accelerating data discovery with S3 Metadata <https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html>`__ in the *Amazon S3 User Guide*.

    Permissions  

  To use this operation, you must have the following permissions. For more information, see `Setting up permissions for configuring metadata tables <https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html>`__ in the *Amazon S3 User Guide*.

   

  If you want to encrypt your metadata tables with server-side encryption with Key Management Service (KMS) keys (SSE-KMS), you need additional permissions in your KMS key policy. For more information, see `Setting up permissions for configuring metadata tables <https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html>`__ in the *Amazon S3 User Guide*.

   

  If you also want to integrate your table bucket with Amazon Web Services analytics services so that you can query your metadata table, you need additional permissions. For more information, see `Integrating Amazon S3 Tables with Amazon Web Services analytics services <https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-integrating-aws.html>`__ in the *Amazon S3 User Guide*.

   

  To query your metadata tables, you need additional permissions. For more information, see `Permissions for querying metadata tables <https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-bucket-query-permissions.html>`__ in the *Amazon S3 User Guide*.

   

  
  * ``s3:CreateBucketMetadataTableConfiguration`` 

  .. note::

    The IAM policy action name is the same for the V1 and V2 API operations.

  
   
  * ``s3tables:CreateTableBucket``
   
  * ``s3tables:CreateNamespace``
   
  * ``s3tables:GetTable``
   
  * ``s3tables:CreateTable``
   
  * ``s3tables:PutTablePolicy``
   
  * ``s3tables:PutTableEncryption``
   
  * ``kms:DescribeKey``
  

     

  The following operations are related to ``CreateBucketMetadataConfiguration``:

   

  
  * `DeleteBucketMetadataConfiguration <https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetadataConfiguration.html>`__
   
  * `GetBucketMetadataConfiguration <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataConfiguration.html>`__
   
  * `UpdateBucketMetadataInventoryTableConfiguration <https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateBucketMetadataInventoryTableConfiguration.html>`__
   
  * `UpdateBucketMetadataJournalTableConfiguration <https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateBucketMetadataJournalTableConfiguration.html>`__
  

   

  .. warning::

     

    You must URL encode any signed header values that contain spaces. For example, if your header value is ``my file.txt``, containing two spaces after ``my``, you must URL encode this value to ``my%20%20file.txt``.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucketMetadataConfiguration>`_  


  **Request Syntax**
  ::

    response = client.create_bucket_metadata_configuration(
        Bucket='string',
        ContentMD5='string',
        ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME',
        MetadataConfiguration={
            'JournalTableConfiguration': {
                'RecordExpiration': {
                    'Expiration': 'ENABLED'|'DISABLED',
                    'Days': 123
                },
                'EncryptionConfiguration': {
                    'SseAlgorithm': 'aws:kms'|'AES256',
                    'KmsKeyArn': 'string'
                }
            },
            'InventoryTableConfiguration': {
                'ConfigurationState': 'ENABLED'|'DISABLED',
                'EncryptionConfiguration': {
                    'SseAlgorithm': 'aws:kms'|'AES256',
                    'KmsKeyArn': 'string'
                }
            }
        },
        ExpectedBucketOwner='string'
    )
    
  :type Bucket: string
  :param Bucket: **[REQUIRED]** 

    The general purpose bucket that you want to create the metadata configuration for.

    

  
  :type ContentMD5: string
  :param ContentMD5: 

    The ``Content-MD5`` header for the metadata configuration.

    

  
  :type ChecksumAlgorithm: string
  :param ChecksumAlgorithm: 

    The checksum algorithm to use with your metadata configuration.

    

  
  :type MetadataConfiguration: dict
  :param MetadataConfiguration: **[REQUIRED]** 

    The contents of your metadata configuration.

    

  
    - **JournalTableConfiguration** *(dict) --* **[REQUIRED]** 

      The journal table configuration for a metadata configuration.

      

    
      - **RecordExpiration** *(dict) --* **[REQUIRED]** 

        The journal table record expiration settings for the journal table.

        

      
        - **Expiration** *(string) --* **[REQUIRED]** 

          Specifies whether journal table record expiration is enabled or disabled.

          

        
        - **Days** *(integer) --* 

          If you enable journal table record expiration, you can set the number of days to retain your journal table records. Journal table records must be retained for a minimum of 7 days. To set this value, specify any whole number from ``7`` to ``2147483647``. For example, to retain your journal table records for one year, set this value to ``365``.

          

        
      
      - **EncryptionConfiguration** *(dict) --* 

        The encryption configuration for the journal table.

        

      
        - **SseAlgorithm** *(string) --* **[REQUIRED]** 

          The encryption type specified for a metadata table. To specify server-side encryption with Key Management Service (KMS) keys (SSE-KMS), use the ``aws:kms`` value. To specify server-side encryption with Amazon S3 managed keys (SSE-S3), use the ``AES256`` value.

          

        
        - **KmsKeyArn** *(string) --* 

          If server-side encryption with Key Management Service (KMS) keys (SSE-KMS) is specified, you must also specify the KMS key Amazon Resource Name (ARN). You must specify a customer-managed KMS key that's located in the same Region as the general purpose bucket that corresponds to the metadata table configuration.

          

        
      
    
    - **InventoryTableConfiguration** *(dict) --* 

      The inventory table configuration for a metadata configuration.

      

    
      - **ConfigurationState** *(string) --* **[REQUIRED]** 

        The configuration state of the inventory table, indicating whether the inventory table is enabled or disabled.

        

      
      - **EncryptionConfiguration** *(dict) --* 

        The encryption configuration for the inventory table.

        

      
        - **SseAlgorithm** *(string) --* **[REQUIRED]** 

          The encryption type specified for a metadata table. To specify server-side encryption with Key Management Service (KMS) keys (SSE-KMS), use the ``aws:kms`` value. To specify server-side encryption with Amazon S3 managed keys (SSE-S3), use the ``AES256`` value.

          

        
        - **KmsKeyArn** *(string) --* 

          If server-side encryption with Key Management Service (KMS) keys (SSE-KMS) is specified, you must also specify the KMS key Amazon Resource Name (ARN). You must specify a customer-managed KMS key that's located in the same Region as the general purpose bucket that corresponds to the metadata table configuration.

          

        
      
    
  
  :type ExpectedBucketOwner: string
  :param ExpectedBucketOwner: 

    The expected owner of the general purpose bucket that corresponds to your metadata configuration.

    

  
  
  :returns: None