{"id":27858,"date":"2022-02-09T22:24:40","date_gmt":"2022-02-09T22:24:40","guid":{"rendered":"http:\/\/Transform-Images-Stored-on-Amplify-Storage"},"modified":"2025-03-30T02:37:22","modified_gmt":"2025-03-30T09:37:22","slug":"transform-images-stored-on-amplify-storage","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/","title":{"rendered":"Transform Images Stored on Amplify Storage"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p><a href=\"https:\/\/aws.amazon.com\/amplify\/\">AWS Amplify<\/a> enables developers of all skill levels to create, deploy, and maintain full-stack applications more effectively. Speaking of services, we will be using the Amplify CLI to create an S3 bucket and upload images from a React app. Next, we\u2019ll use Cloudinary\u2019s rich media transformation tools to retrieve images stored on the S3 bucket and apply some transformations to them.<\/p>\n<p>Here is a <a href=\"https:\/\/codesandbox.io\/s\/transform-images-on-amplify-storage-with-cloudinary-jli2m\">link<\/a> to the demo on CodeSandbox.<\/p>\n<\/div>\n  \n  <div class=\"wp-block-cloudinary-code-sandbox \">\n    <iframe\n      src=\"https:\/\/codesandbox.io\/embed\/transform-images-on-amplify-storage-with-cloudinary-jli2m?theme=dark&amp;codemirror=1&amp;highlights=&amp;editorsize=50&amp;fontsize=14&amp;expanddevtools=0&amp;hidedevtools=0&amp;eslint=0&amp;forcerefresh=0&amp;hidenavigation=0&amp;initialpath=%2F&amp;module=&amp;moduleview=0&amp;previewwindow=&amp;view=&amp;runonclick=1\"\n      height=\"500\"\n      style=\"width: 100%;\"\n      title=\"transform-images-on-amplify-storage-with-cloudinary-jli2m\"\n      loading=\"lazy\"\n      allow=\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\"\n      sandbox=\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\"\n    ><\/iframe>\n  <\/div>\n\n  <div class=\"wp-block-cloudinary-markdown \"><h2>Project Setup<\/h2>\n<p>Run the following command in your terminal to set up a React application:<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">    npx create-react-app my-amplify-project\n<\/code><\/span><\/pre>\n<p>Let\u2019s create a file that\u2019ll hold the logic for handling image transformation. Run this command in your terminal to create a file named <code>TransformImage.js<\/code>:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\">    <span class=\"hljs-selector-tag\">cd<\/span> <span class=\"hljs-selector-tag\">my-amplify-project<\/span>\n    <span class=\"hljs-selector-tag\">cd<\/span> <span class=\"hljs-selector-tag\">src<\/span>\n    <span class=\"hljs-selector-tag\">mkdir<\/span> <span class=\"hljs-selector-tag\">components<\/span>\n    <span class=\"hljs-selector-tag\">cd<\/span> <span class=\"hljs-selector-tag\">components<\/span>\n    <span class=\"hljs-selector-tag\">touch<\/span> <span class=\"hljs-selector-tag\">TransformImage<\/span><span class=\"hljs-selector-class\">.js<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Our application will require some dependencies. To keep things simple, we will be installing them when we need them.<\/p>\n<h2>Setting up AWS Amplify<\/h2>\n<p>To initialize our React application, integrate, create and provision the AWS services required in our app, let\u2019s install and configure the Amplify CLI tool. Run the following command in your terminal:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\">    <span class=\"hljs-selector-tag\">npm<\/span> <span class=\"hljs-selector-tag\">i<\/span> <span class=\"hljs-selector-tag\">-g<\/span> <span class=\"hljs-keyword\">@aws-amplify<\/span>\/cli\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>The installed tool must be linked to your AWS account; to do so, run the following command in your terminal:<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">    amplify configure\n<\/code><\/span><\/pre>\n<p>AWS discourages using your Root-level credentials (i.e., email and password) to manage your account\u2019s resources and instead suggests utilizing an IAM user account to specify permissions. You will be sent to your dashboard to fill up your information. We gave the IAM user account <code>AdministratorAccess<\/code> in the permissions area.<\/p>\n<p>Once this is successful, you will receive an access key ID and a secret key, as shown below:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641492726923_CleanShot+2022-01-06+at+22.11.402x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"531\"\/><\/p>\n<p>You will be prompted in the CLI to insert these credentials to complete the configuration step. Finally, select a name that will be bound to the profile of the IAM user you just created \u2014 I used \u201cdefault\u201d.<\/p>\n<h2>Setting up Cloudinary<\/h2>\n<p>Login to your Cloudinary account or create one <a href=\"https:\/\/cloudinary.com\/users\/register\/free\">here<\/a> if you don\u2019t have one already. You can get your credentials in the <strong>Account details<\/strong> section on your dashboard.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641493322316_CleanShot+2022-01-06+at+22.19.512x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"727\"\/><\/p>\n<p>We only need our public credentials \u2013 our cloud name and API key. Take note of their values; we will use them later to set up the Cloudinary SDK to transform our images.<\/p>\n<h2>Uploading an Image to an S3 Bucket<\/h2>\n<p>At the moment, our project is just a basic CRA application. To make it amplify compatible, we need to initialize it by running this command:<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">    amplify init\n<\/code><\/span><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641494153942_CleanShot+2022-01-06+at+22.35.332x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1984\" height=\"1062\"\/><\/p>\n<p>In the prompt, you will be required to choose the name of your Amplify project. It will also detect the framework you\u2019re using (React) and other project-specific information. We are also required to authenticate using an IAM account, so we use the one created earlier. If this is successful, this tool does several things, the most important ones are as follows:<\/p>\n<ul>\n<li>It initializes our project in the cloud. You can see the app we just created in the AWS Amplify service section on your dashboard, as seen below:<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641494822739_CleanShot+2022-01-06+at+22.46.432x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"578\"\/><\/p>\n<ul>\n<li>It creates an <code>amplify<\/code> folder in our working directory containing all the local code representing our backend infrastructure (code representing all the AWS services we need). It also creates an <code>aws-exports.js<\/code> file in the src folder. This config file holds data that we will use later to configure and integrate the services we include in our backend in our react app. As we add more services to our backend, the contents of the <code>amplify<\/code> folder and the <code>aws-exports.js<\/code> file will be updated accordingly to reflect this change.<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641495106013_CleanShot+2022-01-06+at+22.51.172x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"620\" height=\"1322\"\/><\/p>\n<h2>Create S3 Bucket<\/h2>\n<p>Run this command in your terminal:<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">    amplify add storage\n<\/code><\/span><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641495582923_CleanShot+2022-01-06+at+22.59.142x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"682\"\/><\/p>\n<p>The command above adds a simple storage service to the backend of our application. First, we choose the content service &#8211; S3 bucket in the prompts above. Although we are not adding login or signup functionality to our app, creating an S3 bucket requires adding the authentication service (we are using Cognito) to our backend.<\/p>\n<p>Setting up Cognito involves choosing how we want users to signup for our application; in our case, we select <code>Username<\/code> and <code>Password<\/code>. We have also specified permissions for different operations (create, read, update, delete). Since our application doesn\u2019t need authentication from users to upload files, our upload operations will be unauthenticated.<\/p>\n<p>So far, we\u2019ve set up Auth and storage on our local application. We need to replicate the changes we have on the cloud. To do that, run this command in your terminal:<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">    amplify push\n<\/code><\/span><\/pre>\n<h2>Upload logic<\/h2>\n<p>Run this command in your terminal to install the amplify dependency:<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">    npm i -s aws-amplify\n<\/code><\/span><\/pre>\n<p>This main amplify module will provide us with useful classes and functions. we need to configure and use the services in our back-end and in our React application. Add the following to your <code>App.js<\/code> file:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">    import <span class=\"hljs-string\">\".\/App.css\"<\/span>;\n    import { useState } from <span class=\"hljs-string\">\"react\"<\/span>;\n    import Amplify, { Storage } from <span class=\"hljs-string\">\"aws-amplify\"<\/span>;\n    import config from <span class=\"hljs-string\">\".\/aws-exports\"<\/span>;\n    import TransformImage from <span class=\"hljs-string\">\".\/components\/TransformImage\"<\/span>;\n    Amplify.configure(config);\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">App<\/span><span class=\"hljs-params\">()<\/span> <\/span>{\n      <span class=\"hljs-keyword\">const<\/span> &#91;loading, setLoading] = useState(<span class=\"hljs-keyword\">false<\/span>);\n      <span class=\"hljs-keyword\">const<\/span> &#91;file, setFile] = useState(<span class=\"hljs-keyword\">null<\/span>);\n      <span class=\"hljs-keyword\">const<\/span> &#91;key, setKey] = useState(<span class=\"hljs-string\">\"\"<\/span>);\n      <span class=\"hljs-keyword\">const<\/span> handleSelectFile = (e) =&gt; setFile(e.target.files&#91;<span class=\"hljs-number\">0<\/span>]);\n      <span class=\"hljs-keyword\">const<\/span> handleUpload = async () =&gt; {\n        <span class=\"hljs-keyword\">try<\/span> {\n          setLoading(<span class=\"hljs-keyword\">true<\/span>);\n          <span class=\"hljs-keyword\">const<\/span> res = await Storage.put(`${file.name}`, file);\n          console.log({ res });\n          setKey(res.key);\n          alert(<span class=\"hljs-string\">\"upload successful\"<\/span>);\n        } <span class=\"hljs-keyword\">catch<\/span> (error) {\n          alert(error.message);\n        } <span class=\"hljs-keyword\">finally<\/span> {\n          setLoading(<span class=\"hljs-keyword\">false<\/span>);\n        }\n      };\n      let choosenFileURL;\n      <span class=\"hljs-keyword\">if<\/span> (file) {\n        choosenFileURL = window.URL.createObjectURL(file);\n      }\n      <span class=\"hljs-comment\">\/\/ console.log({ URL: choosenFileURL, file });<\/span>\n      <span class=\"hljs-keyword\">return<\/span> (\n        &lt;div className=<span class=\"hljs-string\">\"App\"<\/span>&gt;\n          &lt;label htmlFor=<span class=\"hljs-string\">\"file\"<\/span> className=<span class=\"hljs-string\">\"btn-grey\"<\/span>&gt;\n            {<span class=\"hljs-string\">\" \"<\/span>}\n            select image\n          &lt;\/label&gt;\n          {file &amp;&amp; (\n            &lt;div&gt;\n              &lt;img width={<span class=\"hljs-number\">300<\/span>} alt=<span class=\"hljs-string\">\"sample\"<\/span> src={choosenFileURL} \/&gt;\n              &lt;center&gt; {file.name}&lt;\/center&gt;\n            &lt;\/div&gt;\n          )}\n          &lt;input\n            id=<span class=\"hljs-string\">\"file\"<\/span>\n            type=<span class=\"hljs-string\">\"file\"<\/span>\n            onChange={handleSelectFile}\n            multiple={<span class=\"hljs-keyword\">false<\/span>}\n          \/&gt;\n          {file &amp;&amp; (\n            &lt;&gt;\n              &lt;button onClick={handleUpload} className=<span class=\"hljs-string\">\"btn-green\"<\/span>&gt;\n                {loading ? <span class=\"hljs-string\">\"uploading...\"<\/span> : <span class=\"hljs-string\">\"upload to s3 bucket\"<\/span>}\n              &lt;\/button&gt;\n            &lt;\/&gt;\n          )}\n          {key &amp;&amp; &lt;TransformImage imageKey={key} \/&gt;}\n        &lt;\/div&gt;\n      );\n    }\n    export <span class=\"hljs-keyword\">default<\/span> App;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>We start by configuring our application using the <code>configure<\/code> method of the <code>Amplify<\/code> class. Next, we define and export our <code>App<\/code> component, which returns some JSX. It includes an input field that allows you to select an image and store it in a state before it is rendered to the screen. We also have a button that triggers the <code>handleUpload<\/code> function, which toggles the loading state and attempts to upload the file using the <code>Storage<\/code> class provided by the Amplify module. If the upload is successful, in the response object, we get an object with a key property whose value is the same as the first parameter we specified in the <code>put<\/code> call. This key is stored in state and passed as props to the <code>TransformImage<\/code> component.<\/p>\n<p>Add the following styles to your <code>App.css<\/code> file:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\">    * {\n      <span class=\"hljs-attribute\">box-sizing<\/span>: border-box;\n    }\n    <span class=\"hljs-selector-class\">.App<\/span> {\n      <span class=\"hljs-attribute\">text-align<\/span>: center;\n      <span class=\"hljs-attribute\">display<\/span>: grid;\n      <span class=\"hljs-attribute\">gap<\/span>: <span class=\"hljs-number\">2rem<\/span>;\n      <span class=\"hljs-attribute\">max-width<\/span>: <span class=\"hljs-number\">470px<\/span>;\n      <span class=\"hljs-attribute\">padding<\/span>: <span class=\"hljs-number\">1.5rem<\/span>;\n      <span class=\"hljs-attribute\">margin<\/span>: auto;\n      <span class=\"hljs-attribute\">margin-top<\/span>: <span class=\"hljs-number\">4rem<\/span>;\n    }\n    <span class=\"hljs-selector-tag\">label<\/span>,\n    <span class=\"hljs-selector-tag\">button<\/span> {\n      <span class=\"hljs-attribute\">font-size<\/span>: <span class=\"hljs-number\">1.2rem<\/span>;\n      <span class=\"hljs-attribute\">color<\/span>: <span class=\"hljs-number\">#fff<\/span>;\n      <span class=\"hljs-attribute\">padding<\/span>: <span class=\"hljs-number\">0.5em<\/span> <span class=\"hljs-number\">0.9em<\/span>;\n      <span class=\"hljs-attribute\">cursor<\/span>: pointer;\n      <span class=\"hljs-attribute\">border<\/span>: none;\n    }\n    <span class=\"hljs-selector-attr\">&#91;type=<span class=\"hljs-string\">\"file\"<\/span>]<\/span> {\n      <span class=\"hljs-attribute\">display<\/span>: none;\n    }\n    <span class=\"hljs-selector-attr\">&#91;class*=<span class=\"hljs-string\">\"btn\"<\/span>]<\/span> {\n      <span class=\"hljs-attribute\">border-radius<\/span>: <span class=\"hljs-number\">5px<\/span>;\n      <span class=\"hljs-attribute\">text-transform<\/span>: capitalize;\n    }\n    <span class=\"hljs-selector-class\">.btn-grey<\/span> {\n      <span class=\"hljs-attribute\">background-color<\/span>: <span class=\"hljs-number\">#f2f2f2<\/span>;\n      <span class=\"hljs-attribute\">color<\/span>: <span class=\"hljs-number\">#333<\/span>;\n      <span class=\"hljs-attribute\">border<\/span>: <span class=\"hljs-number\">1px<\/span> solid <span class=\"hljs-number\">#888<\/span>;\n    }\n    <span class=\"hljs-selector-class\">.btn-green<\/span> {\n      <span class=\"hljs-attribute\">background-color<\/span>: <span class=\"hljs-number\">#63dd47<\/span>;\n    }\n    <span class=\"hljs-selector-class\">.btn-blue<\/span> {\n      <span class=\"hljs-attribute\">background-color<\/span>: <span class=\"hljs-number\">#0e80c9<\/span>;\n    }\n    <span class=\"hljs-selector-tag\">p<\/span> {\n      <span class=\"hljs-attribute\">display<\/span>: block;\n      <span class=\"hljs-attribute\">width<\/span>: <span class=\"hljs-number\">60%<\/span>;\n      <span class=\"hljs-attribute\">font-family<\/span>: monospace;\n      <span class=\"hljs-attribute\">font-size<\/span>: <span class=\"hljs-number\">1.2rem<\/span>;\n      <span class=\"hljs-attribute\">background-color<\/span>: <span class=\"hljs-number\">#000<\/span>;\n      <span class=\"hljs-attribute\">color<\/span>: <span class=\"hljs-number\">#f00<\/span>;\n      <span class=\"hljs-attribute\">margin<\/span>: auto;\n      <span class=\"hljs-attribute\">text-overflow<\/span>: ellipsis;\n    }\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>To see the running application run the following command in your terminal:<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">    npm start\n<\/code><\/span><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641918755080_CleanShot+2022-01-11+at+20.32.11.gif\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"800\" height=\"451\"\/><\/p>\n<h2>Preview Uploaded Images<\/h2>\n<p>We can preview images uploaded to our bucket on the cloud console via the following steps:<\/p>\n<ol>\n<li>\n<p>Search for <strong>s3<\/strong> in the search bar and click on <strong>Buckets.<\/strong>\n<img decoding=\"async\" src=\"\/static\/img\/pixel.gif\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\" \/><\/p>\n<\/li>\n<li>\n<p>Next, select the bucket\u2019s name from the list and click on the public folder.\n<img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641920681520_CleanShot+2022-01-11+at+21.04.162x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"1166\"\/><\/p>\n<\/li>\n<li>\n<p>When you click on the image, you should see a unique URL that points to the image.\n<img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641921071220_CleanShot+2022-01-11+at+21.10.502x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"1150\"\/><\/p>\n<\/li>\n<\/ol>\n<p>If you click the URL of your image now, you will get a 403 message, as seen below:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641921376649_CleanShot+2022-01-11+at+21.16.002x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"583\"\/><\/p>\n<h2>Make Images on S3 Bucket Publicly Available<\/h2>\n<p>By default, all newly created s3 buckets block anonymous access to stored files(objects). This is normal because we don\u2019t want unauthorized access to our assets. We need to change that because there are no confidential files in our bucket, and we need to use the URL of our files to fetch and transform our images using Cloudinary\u2019s SDK.<\/p>\n<ol>\n<li>Click on the newly created bucket and click on the <strong>Permissions<\/strong> tab.<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641921958908_CleanShot+2022-01-11+at+21.24.522x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"661\"\/><\/p>\n<ol start=\"2\">\n<li>Scroll down to <strong>Bucket policy<\/strong> and click the <strong>Edit<\/strong> button.<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641925306189_CleanShot+2022-01-11+at+22.18.482x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"771\"\/><\/p>\n<p>The bucket policy is just <code>JSON<\/code> written using amazon policy language. For our bucket, this data looks like this:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JSON \/ JSON with Comments\" data-shcb-language-slug=\"json\"><span><code class=\"hljs language-json shcb-wrap-lines\">    {\n      <span class=\"hljs-attr\">\"Version\"<\/span>: <span class=\"hljs-string\">\"2012-10-17\"<\/span>,\n      <span class=\"hljs-attr\">\"Statement\"<\/span>: &#91;\n          {\n              <span class=\"hljs-attr\">\"Effect\"<\/span>: <span class=\"hljs-string\">\"Allow\"<\/span>,\n              <span class=\"hljs-attr\">\"Principal\"<\/span>: <span class=\"hljs-string\">\"*\"<\/span>,\n              <span class=\"hljs-attr\">\"Action\"<\/span>: <span class=\"hljs-string\">\"s3:GetObject\"<\/span>,\n              <span class=\"hljs-attr\">\"Resource\"<\/span>: <span class=\"hljs-string\">\"arn:aws:s3:::ADD-BUCKET-NAME-HERE\/public\/*\"<\/span>\n          }\n      ]\n    }\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JSON \/ JSON with Comments<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">json<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>This information provided above states that we want to allow everyone to read ( s3:GetObject) only the public folder contents on our s3 bucket. Copy and paste the bucket policy in the field provided, add your bucket name, and click <strong>Save changes<\/strong> as shown below.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1641978815721_CleanShot+2022-01-12+at+13.12.452x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"1114\"\/><\/p>\n<p>Now, if you click the URL of the file in your public folder, you should see the image.<\/p>\n<h2>Transform Images Using Cloudinary<\/h2>\n<p>We now understand the structure of object URLs that live on an s3 bucket and how to make its contents accessible. We will now see how to transform these images using Cloudinary in our React app.<\/p>\n<p>Let\u2019s install our Cloudinary SDK. Run this command in your terminal:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\">    <span class=\"hljs-selector-tag\">npm<\/span> <span class=\"hljs-selector-tag\">install<\/span> <span class=\"hljs-keyword\">@cloudinary<\/span>\/url-gen\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>This dependency will provide us with the tools to build delivery URLs and apply transformations to the images on our bucket.<\/p>\n<p>Add the following to the <code>TransformImage.js<\/code> file in the <code>components<\/code> folder.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">    <span class=\"hljs-keyword\">import<\/span> { useState } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"react\"<\/span>;\n    <span class=\"hljs-keyword\">import<\/span> { Cloudinary } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"@cloudinary\/url-gen\"<\/span>;\n    <span class=\"hljs-keyword\">import<\/span> {\n      Effect,\n      RoundCorners,\n      Rotate,\n      Resize,\n      Overlay,\n    } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"@cloudinary\/url-gen\/actions\"<\/span>;\n    <span class=\"hljs-keyword\">import<\/span> { Position, Source } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"@cloudinary\/url-gen\/qualifiers\"<\/span>;\n    <span class=\"hljs-keyword\">import<\/span> { TextStyle } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"@cloudinary\/url-gen\/qualifiers\/textStyle\"<\/span>;\n    <span class=\"hljs-keyword\">import<\/span> Transformation <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"@cloudinary\/url-gen\/backwards\/transformation\"<\/span>;\n    \n    <span class=\"hljs-keyword\">const<\/span> myCld = <span class=\"hljs-keyword\">new<\/span> Cloudinary({\n      <span class=\"hljs-attr\">cloud<\/span>: {\n        <span class=\"hljs-attr\">cloudName<\/span>: <span class=\"hljs-string\">\"YOUR-CLOUD-NAME\"<\/span>,\n        <span class=\"hljs-attr\">apiKey<\/span>: <span class=\"hljs-string\">\"YOUR-API-KEY\"<\/span>,\n      },\n    });\n    <span class=\"hljs-keyword\">const<\/span> TransformImage = <span class=\"hljs-function\">(<span class=\"hljs-params\">{ imageKey }<\/span>) =&gt;<\/span> {\n      <span class=\"hljs-keyword\">const<\/span> &#91;URL, setURL] = useState(<span class=\"hljs-string\">\"\"<\/span>);\n      <span class=\"hljs-keyword\">const<\/span> getURLofS3Object = <span class=\"hljs-function\">(<span class=\"hljs-params\">tag<\/span>) =&gt;<\/span> {\n        <span class=\"hljs-keyword\">const<\/span> S3BucketName = <span class=\"hljs-string\">\"YOUR-STORAGE-BUCKET-NAME\"<\/span>;\n        <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-string\">`https:\/\/<span class=\"hljs-subst\">${S3BucketName}<\/span>.s3.amazonaws.com\/<span class=\"hljs-subst\">${tag}<\/span>`<\/span>;\n      };\n      <span class=\"hljs-keyword\">const<\/span> getImage = <span class=\"hljs-keyword\">async<\/span> () =&gt; {\n        <span class=\"hljs-keyword\">const<\/span> objectURL = getURLofS3Object(<span class=\"hljs-string\">`public\/<span class=\"hljs-subst\">${imageKey}<\/span>`<\/span>);\n        <span class=\"hljs-keyword\">let<\/span> image = myCld.image(objectURL).setDeliveryType(<span class=\"hljs-string\">\"fetch\"<\/span>);\n        image\n          .resize(Resize.fill().width(<span class=\"hljs-number\">340<\/span>))\n          .effect(Effect.artisticFilter(<span class=\"hljs-string\">\"frost\"<\/span>))\n          .roundCorners(RoundCorners.byRadius().radius(<span class=\"hljs-number\">40<\/span>))\n          .rotate(Rotate.byAngle(<span class=\"hljs-number\">20<\/span>))\n          .overlay(\n            Overlay.source(\n              Source.text(\n                imageKey.replace(<span class=\"hljs-regexp\">\/\\.\\w+$\/<\/span>, <span class=\"hljs-string\">\"\"<\/span>),\n                <span class=\"hljs-keyword\">new<\/span> TextStyle(<span class=\"hljs-string\">\"Cookie\"<\/span>, <span class=\"hljs-number\">50<\/span>).fontWeight(<span class=\"hljs-number\">800<\/span>)\n              )\n                .textColor(<span class=\"hljs-string\">\"#0C0C14\"<\/span>)\n                .transformation(\n                  <span class=\"hljs-keyword\">new<\/span> Transformation().effect(Effect.shadow(<span class=\"hljs-number\">4<\/span>).color(<span class=\"hljs-string\">\"#FFCC43\"<\/span>))\n                )\n            ).position(<span class=\"hljs-keyword\">new<\/span> Position().offsetY(<span class=\"hljs-string\">\"160\"<\/span>).offsetX(<span class=\"hljs-string\">\"20\"<\/span>))\n          );\n        setURL(image.toURL());\n      };\n      <span class=\"hljs-keyword\">return<\/span> (\n        <span class=\"xml\"><span class=\"hljs-tag\">&lt;&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span> <span class=\"hljs-attr\">onClick<\/span>=<span class=\"hljs-string\">{getImage}<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">\"btn-blue\"<\/span>&gt;<\/span>\n            transform image\n          <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\n          {URL &amp;&amp; <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">img<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">{URL}<\/span> <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\">\"some_random_img\"<\/span> \/&gt;<\/span>}\n        <span class=\"hljs-tag\">&lt;\/&gt;<\/span><\/span>\n      );\n    };\n    <span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">default<\/span> TransformImage;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>In the code above, we created an instance of the Cloudinary class and configured it using our Cloudinary credentials. Next, we define and export the <code>TransformImage<\/code> component, which accepts an <code>imageKey<\/code> &#8211; a string representing a key to a file on an s3bucket. In the component, we defined a variable that will hold the URL of our transformed image &#8211; Cloudinary calls this the delivery URL.<\/p>\n<p>Next, we define a method, <code>getURLofS3Object<\/code>, which expects the key to a file of an S3 bucket as its parameter, and returns a URL to the object. We also defined a <code>getImageURL<\/code> function which generates a Cloudinary delivery\/transformation URL of our s3 image. <code>getImageURL<\/code> starts by getting the s3 object URL, and then it uses our Cloudinary instance to create an image object. The call to <code>setDeliveryType<\/code>, set to <code>fetch<\/code> specifies that the image we want to transform is a remote file.<\/p>\n<p>Next, we build the transformation section of the delivery URL, which follows a series of chained function calls. Here we resized the image to a width of <code>300px<\/code> and rotated it by 20 degrees. We also applied the artistic filter with the <code>frost<\/code> qualifier value and added a text overlay formed from the image\u2019s key without its file extension.<\/p>\n<p>This function calls result in one big delivery URL that we can access by calling the <code>toURL<\/code> function on the image object and storing it in a state variable passed to a traditional HTML image tag to be rendered to the screen.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_3DDF286BDD90A75CC597E39CDEDE3B18775990BC45FE5781B937D78CB51F7F79_1641338715762_Untitled+Diagram-Page-4.drawio.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"472\"\/><\/p>\n<p>The image above shows the various components that make up this URL and where the URL of an S3 file will be embedded.<\/p>\n<blockquote>\n<p>The strategy employed here applies transformations on-the-fly. This means the image is only transformed when we request it. The original untransformed version is cached on our Cloudinary account.<\/p>\n<\/blockquote>\n<p>We can select, upload, and transform our images as expected.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams\/s_2CE719BF138C8D402C733E02AECECDAAE7959A2766E9E9576DD6B7559DDC530C_1643109292199_CleanShot+2022-01-25+at+15.14.352x.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"927\"\/><\/p>\n<p>You can find the complete project <a href=\"https:\/\/github.com\/ifeoma-imoh\/Transform-Images-Stored-on-Amplify-Storage-Using-Cloudinary\">here<\/a> on GitHub.<\/p>\n<p><strong>Resources you may find helpful:<\/strong><\/p>\n<ul>\n<li>\n<a href=\"https:\/\/aws.amazon.com\/s3\/\">Amazon S3<\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/docs.amplify.aws\/cli\/\">Amplify CLI<\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/cloudinary.com\/documentation\/javascript_quick_start\">Cloudinary JavaScript SDK<\/a>\n<\/li>\n<\/ul>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":27859,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[392,134,370,246,371],"class_list":["post-27858","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-amplify-aws","tag-guest-post","tag-image","tag-react","tag-under-review"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Transform Images Stored on Amplify Storage<\/title>\n<meta name=\"description\" content=\"This article shows how to use Cloudinary&#039;s rich media transformation tools to retrieve images stored on Amplify storage and apply some transformations to them.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Transform Images Stored on Amplify Storage\" \/>\n<meta property=\"og:description\" content=\"This article shows how to use Cloudinary&#039;s rich media transformation tools to retrieve images stored on Amplify storage and apply some transformations to them.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-09T22:24:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-30T09:37:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681926080\/Web_Assets\/blog\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6-jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"4032\" \/>\n\t<meta property=\"og:image:height\" content=\"2234\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Transform Images Stored on Amplify Storage\",\"datePublished\":\"2022-02-09T22:24:40+00:00\",\"dateModified\":\"2025-03-30T09:37:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/\"},\"wordCount\":6,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926080\/Web_Assets\/blog\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6.jpg?_i=AA\",\"keywords\":[\"Amplify (AWS)\",\"Guest Post\",\"Image\",\"React\",\"Under Review\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2022\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/\",\"url\":\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/\",\"name\":\"Transform Images Stored on Amplify Storage\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926080\/Web_Assets\/blog\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6.jpg?_i=AA\",\"datePublished\":\"2022-02-09T22:24:40+00:00\",\"dateModified\":\"2025-03-30T09:37:22+00:00\",\"description\":\"This article shows how to use Cloudinary's rich media transformation tools to retrieve images stored on Amplify storage and apply some transformations to them.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926080\/Web_Assets\/blog\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926080\/Web_Assets\/blog\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6.jpg?_i=AA\",\"width\":4032,\"height\":2234},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Transform Images Stored on Amplify Storage\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Transform Images Stored on Amplify Storage","description":"This article shows how to use Cloudinary's rich media transformation tools to retrieve images stored on Amplify storage and apply some transformations to them.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/","og_locale":"en_US","og_type":"article","og_title":"Transform Images Stored on Amplify Storage","og_description":"This article shows how to use Cloudinary's rich media transformation tools to retrieve images stored on Amplify storage and apply some transformations to them.","og_url":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/","og_site_name":"Cloudinary Blog","article_published_time":"2022-02-09T22:24:40+00:00","article_modified_time":"2025-03-30T09:37:22+00:00","og_image":[{"width":4032,"height":2234,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681926080\/Web_Assets\/blog\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6-jpg?_i=AA","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/"},"author":{"name":"","@id":""},"headline":"Transform Images Stored on Amplify Storage","datePublished":"2022-02-09T22:24:40+00:00","dateModified":"2025-03-30T09:37:22+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/"},"wordCount":6,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926080\/Web_Assets\/blog\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6.jpg?_i=AA","keywords":["Amplify (AWS)","Guest Post","Image","React","Under Review"],"inLanguage":"en-US","copyrightYear":"2022","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/","url":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/","name":"Transform Images Stored on Amplify Storage","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926080\/Web_Assets\/blog\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6.jpg?_i=AA","datePublished":"2022-02-09T22:24:40+00:00","dateModified":"2025-03-30T09:37:22+00:00","description":"This article shows how to use Cloudinary's rich media transformation tools to retrieve images stored on Amplify storage and apply some transformations to them.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926080\/Web_Assets\/blog\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926080\/Web_Assets\/blog\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6.jpg?_i=AA","width":4032,"height":2234},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/transform-images-stored-on-amplify-storage\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Transform Images Stored on Amplify Storage"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926080\/Web_Assets\/blog\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6\/efe61a9728bf6c1e499ce8982d79b6886a6b5991-4032x2234-1_278592dbc6.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=27858"}],"version-history":[{"count":1,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27858\/revisions"}],"predecessor-version":[{"id":37301,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27858\/revisions\/37301"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/27859"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=27858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=27858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=27858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}