:doc:`SecretsManager <../../secretsmanager>` / Client / remove_regions_from_replication

*******************************
remove_regions_from_replication
*******************************



.. py:method:: SecretsManager.Client.remove_regions_from_replication(**kwargs)

  

  For a secret that is replicated to other Regions, deletes the secret replicas from the Regions you specify.

   

  Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters because it might be logged. For more information, see `Logging Secrets Manager events with CloudTrail <https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html>`__.

   

  **Required permissions:** ``secretsmanager:RemoveRegionsFromReplication``. For more information, see `IAM policy actions for Secrets Manager <https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions>`__ and `Authentication and access control in Secrets Manager <https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/RemoveRegionsFromReplication>`_  


  **Request Syntax**
  ::

    response = client.remove_regions_from_replication(
        SecretId='string',
        RemoveReplicaRegions=[
            'string',
        ]
    )
    
  :type SecretId: string
  :param SecretId: **[REQUIRED]** 

    The ARN or name of the secret.

    

  
  :type RemoveReplicaRegions: list
  :param RemoveReplicaRegions: **[REQUIRED]** 

    The Regions of the replicas to remove.

    

  
    - *(string) --* 

    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ARN': 'string',
          'ReplicationStatus': [
              {
                  'Region': 'string',
                  'KmsKeyId': 'string',
                  'Status': 'InSync'|'Failed'|'InProgress',
                  'StatusMessage': 'string',
                  'LastAccessedDate': datetime(2015, 1, 1)
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ARN** *(string) --* 

        The ARN of the primary secret.

        
      

      - **ReplicationStatus** *(list) --* 

        The status of replicas for this secret after you remove Regions.

        
        

        - *(dict) --* 

          A replication object consisting of a ``RegionReplicationStatus`` object and includes a Region, KMSKeyId, status, and status message.

          
          

          - **Region** *(string) --* 

            The Region where replication occurs.

            
          

          - **KmsKeyId** *(string) --* 

            Can be an ``ARN``, ``Key ID``, or ``Alias``.

            
          

          - **Status** *(string) --* 

            The status can be ``InProgress``, ``Failed``, or ``InSync``.

            
          

          - **StatusMessage** *(string) --* 

            Status message such as "*Secret with this name already exists in this region*".

            
          

          - **LastAccessedDate** *(datetime) --* 

            The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`SecretsManager.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`SecretsManager.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`SecretsManager.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`SecretsManager.Client.exceptions.InternalServiceError`

  