imagebuilder / Client / put_component_policy

put_component_policy

imagebuilder.Client.put_component_policy(**kwargs)

Applies a policy to a component. The preferred way to share resources is with the RAM API CreateResourceShare. If you use the PutComponentPolicy operation instead, you must also call the RAM API PromoteResourceShareCreatedFromPolicy. Otherwise, the resource isn’t visible to the principals that it’s shared with.

See also: AWS API Documentation

Request Syntax

response = client.put_component_policy(
    componentArn='string',
    policy='string'
)
Parameters:
  • componentArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the component that this policy should be applied to.

  • policy (string) –

    [REQUIRED]

    The policy to apply.

Return type:

dict

Returns:

Response Syntax

{
    'requestId': 'string',
    'componentArn': 'string'
}

Response Structure

  • (dict) –

    • requestId (string) –

      The request ID that uniquely identifies this request.

    • componentArn (string) –

      The Amazon Resource Name (ARN) of the component that this policy was applied to.

Exceptions

  • imagebuilder.Client.exceptions.ServiceException

  • imagebuilder.Client.exceptions.ClientException

  • imagebuilder.Client.exceptions.ServiceUnavailableException

  • imagebuilder.Client.exceptions.InvalidRequestException

  • imagebuilder.Client.exceptions.InvalidParameterValueException

  • imagebuilder.Client.exceptions.ResourceNotFoundException

  • imagebuilder.Client.exceptions.ForbiddenException

  • imagebuilder.Client.exceptions.CallRateLimitExceededException