AWS solutions documentation change
Summary
Removed the entire user guide content for both Lambda and ECS architectures, including demo UI instructions, image editing features, security restrictions, and transformation policies. Replaced the ending section title from 'Developer guide' to 'Lambda architecture'.
Security assessment
The changes involve removal of operational documentation without any mention of security vulnerabilities, weaknesses, or incidents. The deleted content included security-related features (like content moderation and restricted operations), but the removal doesn't indicate a security fix. No evidence of security issues being addressed.
Diff
diff --git a/solutions/latest/dynamic-image-transformation-for-amazon-cloudfront/use-the-solution.md b/solutions/latest/dynamic-image-transformation-for-amazon-cloudfront/use-the-solution.md index 9b861c542..d967c3732 100644 --- a//solutions/latest/dynamic-image-transformation-for-amazon-cloudfront/use-the-solution.md +++ b//solutions/latest/dynamic-image-transformation-for-amazon-cloudfront/use-the-solution.md @@ -5,2 +4,0 @@ -Lambda architectureECS architecture - @@ -11,730 +8,0 @@ This section provides a user guide for utilizing the AWS solution based on your -## Lambda architecture - -This section covers how to use the solution when deployed with the Lambda architecture. - -### Use the demo UI - -The solution provides an optional demo UI that you can deploy into your AWS account to display basic capability and functionality. With this UI, you can interact directly with the new image handler using images from the specified Amazon S3 buckets in your account. - -**Screenshot of demo UI showing image source, original image, editing options, preview, code, and encoded URL.** - - - -Follow this procedure to experiment with the supported image editing features, preview the results, and create example URLs that you can use in your applications: - - 1. Sign in to the [AWS CloudFormation console](https://console.aws.amazon.com/cloudformation/). - - 2. Select the solution’s installation stack. - - 3. Choose the **Outputs** tab, and then select value for the **DemoUrl** key. The Dynamic Image Transformation for Amazon CloudFront Demo UI opens in your browser. - - 4. In the **Image Source** card, perform the following actions: - - 1. Specify a bucket name to use for the demo. The bucket you specify must be listed in the `SOURCE_BUCKETS` environment variable of the AWS Lambda function. - - 2. Specify an image key to use for the demo. You must include the file extension in the key. - - 5. Select **Import**. The original image appears in the **Original Image** card. - - 6. In the **Editor** card, adjust the image settings, and select **Preview** to generate the modified image. You can select **Reset** to revert the settings back to their original values. - - - - -###### Note - -The Dynamic Image Transformation for Amazon CloudFront demo UI offers a limited set of image edits and doesn’t include the full scope of capabilities offered by the Image Handler API and the image URL signature. We recommended using your own [frontend application](./use-the-solution-with-a-frontend-application.html) for image modification. - -### Dynamically resize photos - -This solution offers the following **fit** options to dynamically resize an image: `cover`, `contain`, `fill`, `inside`, and `outside`. Refer to the [sharp documentation](https://sharp.pixelplumbing.com/api-resize) for a description of each fit. For example: - - - const imageRequest = JSON.stringify({ - bucket: "<myImageBucket>", - key: "<myImage.jpeg>", - edits: { - resize: { - width: 200, - height: 250, - fit: "cover" - } - } - }) - -If you use `contain` as the resize **fit** mode, you can specify the color of the fill by providing the hex code of the color you want to use. For example: - - - const imageRequest = JSON.stringify({ - bucket: "<myImageBucket>", - key: "<myImage.jpeg>", - edits: { - resize: { - width: 200, - height: 250, - fit: "contain", - background: { - r: 255, - g: 0, - b: 0, - alpha: 1 - } - } - } - }) - -### Edit images - -You can use this solution to edit your images, such as rotating them or changing the coloring to negative. Refer to the [sharp documentation](https://sharp.pixelplumbing.com/api-operation) for a description of each operation. For example, to produce a negative of an image, enter the following: - - - const imageRequest = JSON.stringify({ - bucket: "<myImageBucket>", - key: "<myImage.jpeg>", - edits: { - negate: true - } - }) - -#### Restricted operations - -Certain Sharp operations are restricted by the solution to help enhance security. This includes (but may not be limited to): - - * clone - - * metadata - - * stats - - * composite (Though this is permitted through the use of overlayWith) - - * certain [output options](https://sharp.pixelplumbing.com/api-output) (Including toFile, toBuffer, tile and raw) - - - - -For an exact list of allow-listed Sharp operations, you can visit [constants.ts](https://github.com/aws-solutions/serverless-image-handler/blob/main/source/image-handler/lib/constants.ts) on the Solution GitHub repository. - -### Use smart cropping - -This solution uses Amazon Rekognition for face detection in images submitted for smart cropping. To activate smart cropping on an image, add the **smartCrop** property to the **edits** property in the [image request](./use-the-solution-with-a-frontend-application.html). - - * **smartCrop(optional, boolean || object)** \- Activates the smart cropping feature for an original image. If the value is `true`, then the feature returns the first face detected from the original image with no additional options. For example: - - const imageRequest = JSON.stringify({ - bucket: "<myImageBucket>", - key: "<myImage.jpeg>", - edits: { - smartCrop: true - } - }) - -The following **smartCrop** variables are shown in the following code sample: - -**smartCrop.faceIndex(optional, number)** \- Specifies which face to focus on if multiple are present within an original image. The solution indexes detected faces in a zero-based array from the largest detected face to the smallest. If this value isn’t specified, Amazon Rekognition returns the largest face detected from the original image. **smartCrop.padding(optional, number)** \- Specifies an amount of padding in pixels to add around the cropped image. The solution applies the padding value to all sides of the cropped image. - - const imageRequest = JSON.stringify({ - bucket: "<myImageBucket>", - key: "<myImage.jpeg>", - edits: { - smartCrop: { - faceIndex: 1, // zero-based index of detected faces - padding: 40, // padding expressed in pixels, applied to all sides - } - } - }) - - - - -###### Note - -**smartCrop** is not supported for animated (such as, GIF) images. - -### Use round cropping - -This solution can crop images in a circular pattern. To activate round cropping on an image, add the **roundCrop** property to the **edits** property in the [image request](./use-the-solution-with-a-frontend-application.html). - - * **roundCrop(optional, boolean || object)** \- Activates the round cropping feature for an original image. If the value is true, then the feature returns a circular cropped image that’s centered from the original image and has a diameter of the smallest edge of the original image. For example: - - const imageRequest = JSON.stringify({ - bucket: "<myImageBucket>", - key: "<myImage.jpeg>", - edits: { - roundCrop: true - } - }) - -The following **roundCrop** variables are shown in the following code sample: - -**roundCrop.rx (optional, number)** \- Specifies the radius along the x-axis of the ellipse. If a value isn’t provided, the image handler defaults to a value that’s half the length of the smallest edge. **roundCrop.ry (optional, number)** \- Specifies the radius along the y-axis of the ellipse. If a value isn’t provided, the image handler defaults to a value that’s half the length of the smallest edge. **roundCrop.top(optional, number)** \- Specifies the offset from the top of the original image to place the center of the ellipse. If a value isn’t provided, the image handler defaults to a value that’s half of the height. **roundCrop.left (optional, number)** \- Specifies the offset from the left-most edge of the original image to place the center of the ellipse. If a value isn’t provided, the image handler defaults to a value that’s half of the width. - - const imageRequest = JSON.stringify({ - bucket: "<myImageBucket>", - key: "<myImage.jpeg>", - edits: { - roundCrop: { - rx: 30, // x-axis radius - ry: 20, // y-axis radius - top: 300, // offset from top edge of original image - left: 500 // offset from left edge of original image - } - } - }) - - - - -###### Note - -**roundCrop** is not supported for animated (such as, GIF) images. - -### Overlay an image - -This solution can overlay images on top of others, for cases like watermarking copyrighted image. To overlay an image, add the **overlayWith** property to the **edits** property in the [image request](./use-the-solution-with-a-frontend-application.html). - -**overlayWith(optional, object)** \- Overlays an image on top of the original. For example: - - - const imageRequest = JSON.stringify({ - bucket: "<myImageBucket>", - key: "<myImage.jpeg>", - edits: {