Skip to content

Applies a policy to an image

Description

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.

Usage

imagebuilder_put_image_policy(imageArn, policy)

Arguments

  • imageArn

    [required] The Amazon Resource Name (ARN) of the image that this policy should be applied to.

  • policy

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

Value

A list with the following syntax:

list(
  requestId = "string",
  imageArn = "string"
)

Request syntax

svc$put_image_policy(
  imageArn = "string",
  policy = "string"
)