imagebuilder / Client / start_resource_state_update

start_resource_state_update#

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

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'
)
Parameters:
  • resourceArn (string) –

    [REQUIRED]

    The ARN of the Image Builder resource that is updated. The state update might also impact associated resources.

  • state (dict) –

    [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.

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

  • includeResources (dict) –

    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.

  • exclusionRules (dict) –

    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) –

  • updateAt (datetime) – The timestamp that indicates when resources are updated by a lifecycle action.

  • clientToken (string) –

    [REQUIRED]

    Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.

    This field is autopopulated if not provided.

Return type:

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 ARN of the Image Builder resource for the asynchronous update.

Exceptions

  • imagebuilder.Client.exceptions.ServiceException

  • imagebuilder.Client.exceptions.ClientException

  • imagebuilder.Client.exceptions.ServiceUnavailableException

  • imagebuilder.Client.exceptions.InvalidRequestException

  • imagebuilder.Client.exceptions.ResourceNotFoundException

  • imagebuilder.Client.exceptions.IdempotentParameterMismatchException

  • imagebuilder.Client.exceptions.ForbiddenException

  • imagebuilder.Client.exceptions.CallRateLimitExceededException

  • imagebuilder.Client.exceptions.ResourceInUseException