EC2 / Client / attach_image_watermark

attach_image_watermark

EC2.Client.attach_image_watermark(**kwargs)

Attaches a watermark to a non-public AMI. The watermark is a structured identifier that automatically propagates to all derivative images created through CreateImage, CopyImage, and CreateRestoreImageTask.

Only the AMI owner can attach watermarks. Watermarks cannot be added to public AMIs.

See also: AWS API Documentation

Request Syntax

response = client.attach_image_watermark(
    ImageId='string',
    WatermarkName='string',
    DryRun=True|False
)
Parameters:
  • ImageId (string) –

    [REQUIRED]

    The ID of the AMI.

  • WatermarkName (string) –

    [REQUIRED]

    The name for the watermark. Combined with the caller’s account ID to form the WatermarkKey ( accountId:watermarkName).

    Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes (‘), at-signs (@), or underscores(_)

  • DryRun (boolean) – Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Return type:

dict

Returns:

Response Syntax

{
    'WatermarkKey': 'string'
}

Response Structure

  • (dict) –

    • WatermarkKey (string) –

      The watermark identifier, in accountId:watermarkName format (for example, 123456789012:approvedAmi).