:doc:`imagebuilder <../../imagebuilder>` / Client / start_resource_state_update

***************************
start_resource_state_update
***************************



.. py:method:: imagebuilder.Client.start_resource_state_update(**kwargs)

  

  Begin asynchronous resource state update for lifecycle changes to the specified image resources.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/StartResourceStateUpdate>`_  


  **Request Syntax**
  ::

    response = client.start_resource_state_update(
        resourceArn='string',
        state={
            'status': 'AVAILABLE'|'DELETED'|'DEPRECATED'|'DISABLED'
        },
        executionRole='string',
        includeResources={
            'amis': True|False,
            'snapshots': True|False,
            'containers': True|False
        },
        exclusionRules={
            'amis': {
                'isPublic': True|False,
                'regions': [
                    'string',
                ],
                'sharedAccounts': [
                    'string',
                ],
                'lastLaunched': {
                    'value': 123,
                    'unit': 'DAYS'|'WEEKS'|'MONTHS'|'YEARS'
                },
                'tagMap': {
                    'string': 'string'
                }
            }
        },
        updateAt=datetime(2015, 1, 1),
        clientToken='string'
    )
    
  :type resourceArn: string
  :param resourceArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the Image Builder resource that is updated. The state update might also impact associated resources.

    

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

    Indicates the lifecycle action to take for this request.

    

  
    - **status** *(string) --* 

      Shows the current lifecycle policy action that was applied to an impacted resource.

      

    
  
  :type executionRole: string
  :param executionRole: 

    The name or Amazon Resource Name (ARN) of the IAM role that’s used to update image state.

    

  
  :type includeResources: dict
  :param includeResources: 

    A list of image resources to update state for.

    

  
    - **amis** *(boolean) --* 

      Specifies whether the lifecycle action should apply to distributed AMIs

      

    
    - **snapshots** *(boolean) --* 

      Specifies whether the lifecycle action should apply to snapshots associated with distributed AMIs.

      

    
    - **containers** *(boolean) --* 

      Specifies whether the lifecycle action should apply to distributed containers.

      

    
  
  :type exclusionRules: dict
  :param exclusionRules: 

    Skip action on the image resource and associated resources if specified exclusion rules are met.

    

  
    - **amis** *(dict) --* 

      Defines criteria for AMIs that are excluded from lifecycle actions.

      

    
      - **isPublic** *(boolean) --* 

        Configures whether public AMIs are excluded from the lifecycle action.

        

      
      - **regions** *(list) --* 

        Configures Amazon Web Services Regions that are excluded from the lifecycle action.

        

      
        - *(string) --* 

        
    
      - **sharedAccounts** *(list) --* 

        Specifies Amazon Web Services accounts whose resources are excluded from the lifecycle action.

        

      
        - *(string) --* 

        
    
      - **lastLaunched** *(dict) --* 

        Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle actions.

        

      
        - **value** *(integer) --* **[REQUIRED]** 

          The integer number of units for the time period. For example ``6`` (months).

          

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

          Defines the unit of time that the lifecycle policy uses to calculate elapsed time since the last instance launched from the AMI. For example: days, weeks, months, or years.

          

        
      
      - **tagMap** *(dict) --* 

        Lists tags that should be excluded from lifecycle actions for the AMIs that have them.

        

      
        - *(string) --* 

        
          - *(string) --* 

          
    
  
    
  
  :type updateAt: datetime
  :param updateAt: 

    The timestamp that indicates when resources are updated by a lifecycle action.

    

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

    Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see `Ensuring idempotency <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html>`__ in the *Amazon EC2 API Reference*.

    This field is autopopulated if not provided.

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

    
    ::

      {
          'lifecycleExecutionId': 'string',
          'resourceArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **lifecycleExecutionId** *(string) --* 

        Identifies the lifecycle runtime instance that started the resource state update.

        
      

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

        The requested Amazon Resource Name (ARN) of the Image Builder resource for the asynchronous update.

        
  
  **Exceptions**
  
  *   :py:class:`imagebuilder.Client.exceptions.ServiceException`

  
  *   :py:class:`imagebuilder.Client.exceptions.ClientException`

  
  *   :py:class:`imagebuilder.Client.exceptions.ServiceUnavailableException`

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

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

  
  *   :py:class:`imagebuilder.Client.exceptions.IdempotentParameterMismatchException`

  
  *   :py:class:`imagebuilder.Client.exceptions.ForbiddenException`

  
  *   :py:class:`imagebuilder.Client.exceptions.CallRateLimitExceededException`

  
  *   :py:class:`imagebuilder.Client.exceptions.ResourceInUseException`

  