:doc:`MailManager <../../mailmanager>` / Client / create_relay

************
create_relay
************



.. py:method:: MailManager.Client.create_relay(**kwargs)

  

  Creates a relay resource which can be used in rules to relay incoming emails to defined relay destinations.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/mailmanager-2023-10-17/CreateRelay>`_  


  **Request Syntax**
  ::

    response = client.create_relay(
        ClientToken='string',
        RelayName='string',
        ServerName='string',
        ServerPort=123,
        Authentication={
            'SecretArn': 'string',
            'NoAuthentication': {}
            
        },
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type ClientToken: string
  :param ClientToken: 

    A unique token that Amazon SES uses to recognize subsequent retries of the same request.

    This field is autopopulated if not provided.

  
  :type RelayName: string
  :param RelayName: **[REQUIRED]** 

    The unique name of the relay resource.

    

  
  :type ServerName: string
  :param ServerName: **[REQUIRED]** 

    The destination relay server address.

    

  
  :type ServerPort: integer
  :param ServerPort: **[REQUIRED]** 

    The destination relay server port.

    

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

    Authentication for the relay destination server—specify the secretARN where the SMTP credentials are stored.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``SecretArn``, ``NoAuthentication``. 

  
    - **SecretArn** *(string) --* 

      The ARN of the secret created in secrets manager where the relay server's SMTP credentials are stored.

      

    
    - **NoAuthentication** *(dict) --* 

      Keep an empty structure if the relay destination server does not require SMTP credential authentication.

      

    
    
  
  :type Tags: list
  :param Tags: 

    The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.

    

  
    - *(dict) --* 

      A key-value pair (the value is optional), that you can define and assign to Amazon Web Services resources.

      

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

        The key of the key-value tag.

        

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

        The value of the key-value tag.

        

      
    

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

    
    ::

      {
          'RelayId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **RelayId** *(string) --* 

        A unique identifier of the created relay resource.

        
  
  **Exceptions**
  
  *   :py:class:`MailManager.Client.exceptions.ValidationException`

  
  *   :py:class:`MailManager.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`MailManager.Client.exceptions.ConflictException`

  