imagebuilder / Client / put_image_policy
put_image_policy¶
- imagebuilder.Client.put_image_policy(**kwargs)¶
Applies a policy to an image. The preferred way to share resources is with the RAM API CreateResourceShare. If you use the PutImagePolicy 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_image_policy( imageArn='string', policy='string' )
- Parameters:
imageArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) of the image that this policy should be applied to.
policy (string) –
[REQUIRED]
The resource policy to apply to the image, as a JSON policy document. Image Builder validates the policy with Amazon Web Services RAM before applying it, and rejects invalid policies with
InvalidParameterValueException.
- Return type:
dict
- Returns:
Response Syntax
{ 'requestId': 'string', 'imageArn': 'string' }
Response Structure
(dict) –
requestId (string) –
The request ID that uniquely identifies this request.
imageArn (string) –
The Amazon Resource Name (ARN) of the image that this policy was applied to.
Exceptions