Set variable with Project Web Interface
Alternatively, you can use the Project Web Interface to add the variable to the appropriate environment.
To add the remote storage variable using the Project Web Interface:
-
In the Project Web Interface, select the environment from the left.
-
Click the Configure environment icon.
-
In the Configure Environment view, click the Variables tab.
-
Click Add Variable.
-
In the Name field, enter
REMOTE_STORAGE
-
In the Value field, add the JSON configuration.
-
Select JSON value and Sensitive; deselect Inheritable by child environments.
-
Click Add Variable.
Use optional authentication
The key
and secret
are optional. When you create the variable, you can hide the key
and secret
by selecting the sensitive
option. With this setting, the values are not visible in the web interface. See Variable visibility in the Commerce on Cloud Infrastructure guide.
If you want to use an a different authentication method, omit the key
and secret
from the JSON configuration,. Configure the alternative authentication method, and verify that the server is authorized to the S3 bucket.
Sync the remote storage
After enabling the Remote Storage module, synchronize the current media files to the remote store location.
To start the synchronization:
-
Use SSH to log in to the remote environment with remote storage configured.
-
Start the sync.
bin/magento remote-storage:sync
Fastly configuration
If you choose to use the remote storage solution with an Adobe Commerce on cloud infrastructure project, use the Amazon S3 guidance in the Fastly documentation to ensure that Fastly Image Optimization works with AWS S3.
Be prepared with your Fastly credentials. On Pro projects, use SSH to connect to your server and get the Fastly credentials from the /mnt/shared/fastly_tokens.txt
file. Staging and Production environments have unique credentials. You must get the credentials for each environment.
Continue setting up remote storage for cloud projects with the following tasks:
-
Configure a Fastly backend integration.
-
Create VCL logic for AWS S3 authentication.
-
Create VCL logic for backend requests to the AWS S3 bucket.