Skip to main content

Using Amazon S3

in External services
Authors list
Published: Aug 15, 2022|Last updated: Nov 29, 2023

Configuring your S3 BucketCopy link to Configuring your S3 Bucket to clipboard

Before you start, you need to configure your S3 Bucket Policy to enable public access to your bucket, but block unauthorized access to private attachments.

Within your bucket configuration, select the Permissions tab:

S3 Configuration
Turn off Block public access to allow access to the public assets, and add the following to the Bucket policy to restrict private assets:
{ "Version": "2008-10-17", "Statement": [ { "Sid": "AllowPublicReadWhereAuthNotRequired", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": "s3:GetObject", "NotResource": [ "arn:aws:s3:::<bucket_name>/*/*T-*", "arn:aws:s3:::<bucket_name>/*/*PD-*", "arn:aws:s3:::<bucket_name>/v2/*" ] } ] }
copy

You must replace <bucket_name> with the name of your bucket.

Configure S3 via the WebguiCopy link to Configure S3 via the Webgui to clipboard

Within the OPC webGUI, select the Instance page for the instance you wish to configure, scroll to the Services section and select File Storage

Services

In the File Storage settings, click Change Storage Mechanism

Change Storage Mechanism

In the Changing Storage Mechanism section, select Amazon S3 from the Storage Mechanism drop down, then enter your Amazon S3 settings in the fields below.

S3 Settings

You must click Validate Details which will confirm your S3 bucket is accessible and configured correctly. Once the details are validated click Save Changes to apply.

Deskpro will automatically start migrating your files over to the S3 storage.

Configure S3 via the CLICopy link to Configure S3 via the CLI to clipboard

The following OPC command will configure your instance to use S3, and begin the migration process:

opc inst -i {instanceID} config set file-storage s3 --s3-cred-source key --s3-bucket-name {bucket_name} --s3-region {bucket_region} --s3-key {access_key} --s3-secret {secret_key}
copy

The variables need to be changed with the following:

  • {instanceID} - The ID of your instance

  • {bucket_name} - The name of your S3 bucket

  • {bucket_region} - The region your S3 bucket is in

  • {access_key} - The access key for your S3 bucket

  • {secret_key} - The secret paired with your access key

Once configured, the OPC will begin the migration to S3. To check the status of the migration, you can run the following command:

opc inst -i {instanceID} php -- dpv5/bin/console dp:move-blobs
copy

This will output a table showing the number of blobs and their location, and if any blobs are in the process of migrating.

HelpfulUnhelpful
next pageUsing an external database [Manual]

Please log in or register to submit a comment.