:doc:`VPCLattice <../../vpc-lattice>` / Client / create_access_log_subscription

******************************
create_access_log_subscription
******************************



.. py:method:: VPCLattice.Client.create_access_log_subscription(**kwargs)

  

  Enables access logs to be sent to Amazon CloudWatch, Amazon S3, and Amazon Kinesis Data Firehose. The service network owner can use the access logs to audit the services in the network. The service network owner can only see access logs from clients and services that are associated with their service network. Access log entries represent traffic originated from VPCs associated with that network. For more information, see `Access logs <https://docs.aws.amazon.com/vpc-lattice/latest/ug/monitoring-access-logs.html>`__ in the *Amazon VPC Lattice User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateAccessLogSubscription>`_  


  **Request Syntax**
  ::

    response = client.create_access_log_subscription(
        clientToken='string',
        resourceIdentifier='string',
        destinationArn='string',
        serviceNetworkLogType='SERVICE'|'RESOURCE',
        tags={
            'string': 'string'
        }
    )
    
  :type clientToken: string
  :param clientToken: 

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails.

    This field is autopopulated if not provided.

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

    The ID or ARN of the service network or service.

    

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

    The Amazon Resource Name (ARN) of the destination. The supported destination types are CloudWatch Log groups, Kinesis Data Firehose delivery streams, and Amazon S3 buckets.

    

  
  :type serviceNetworkLogType: string
  :param serviceNetworkLogType: 

    The type of log that monitors your Amazon VPC Lattice service networks.

    

  
  :type tags: dict
  :param tags: 

    The tags for the access log subscription.

    

  
    - *(string) --* 

      The key of the tag.

       

      Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with ``aws:``.

      

    
      - *(string) --* 

        The value of the tag.

         

        Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

        

      


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

    
    ::

      {
          'id': 'string',
          'arn': 'string',
          'resourceId': 'string',
          'resourceArn': 'string',
          'serviceNetworkLogType': 'SERVICE'|'RESOURCE',
          'destinationArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **id** *(string) --* 

        The ID of the access log subscription.

        
      

      - **arn** *(string) --* 

        The Amazon Resource Name (ARN) of the access log subscription.

        
      

      - **resourceId** *(string) --* 

        The ID of the service network or service.

        
      

      - **resourceArn** *(string) --* 

        The Amazon Resource Name (ARN) of the service network or service.

        
      

      - **serviceNetworkLogType** *(string) --* 

        The type of log that monitors your Amazon VPC Lattice service networks.

        
      

      - **destinationArn** *(string) --* 

        The Amazon Resource Name (ARN) of the log destination.

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

  
  *   :py:class:`VPCLattice.Client.exceptions.AccessDeniedException`

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

  
  *   :py:class:`VPCLattice.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`VPCLattice.Client.exceptions.ThrottlingException`

  
  *   :py:class:`VPCLattice.Client.exceptions.InternalServerException`

  