Extended S3 connector
The Hybrid Assets module lets you transfer content to external S3 storage and return hybrid asset content to be stored in Magnolia.
Prerequisites
-
Magnolia
6.2
-
AWS credentials with:
-
AWS access key ID
-
AWS secret access key
-
A public bucket (if you want the versioning function, you need a enabled bucket versioning).
-
-
A light module in your Magnolia instance for decorations
Step 1: Configure AWS credentials
Please follow the steps from Configuration the AWS connection.
Step 2: Update config.yaml
for Hybrid Assets
In your light module, create or edit /modules/hybrid-assets/config.yaml
to reference the credentials and configure the S3 store and reference factory.
For a full list of properties for S3, see S3 external content store.
displayPdfAndVideoPreview: false
referenceFactory: (1)
class: info.magnolia.dam.hybrid.mapping.SimpleReferenceFactory
mappings:
referenceS3:
class: info.magnolia.dam.hybrid.mapping.TransformReferenceMapping
referenceTemplate: s3://CONFIGUREBUCKET/${baseName}-${nodeId}-${timestamp}.${extension} (2)
voters: (3)
mgnlDam:
class: info.magnolia.dam.hybrid.voters.NodeWorkspaceVoter
stores:
storeS3: (4)
class: info.magnolia.dam.hybrid.store.S3AssetStore
description: S3 asset store
enabled: true (5)
1 | The referenceFactory defines how Azure assets are referenced in Magnolia using a referenceTemplate . |
2 | The referenceTemplate specifies the storage URL format for assets.
Ensure the |
3 | voters determine when the mapping applies.
The NodeWorkspaceVoter ensures assets are in the DAM workspace. |
4 | storeS3 configures the S3 connection. |
5 | Ensure enabled is true . |
S3 external content store
The Hybrid Assets module includes an S3 external content store, which also works with S3 compatible storage: info.magnolia.dam.hybrid.store.S3AssetStore
.
The following are configurable properties of an S3 external content store:
Property | Description | ||
---|---|---|---|
|
required Must be |
||
|
required The name of the external content store. |
||
|
required Set to |
||
|
optional A brief description of the external content store. |
||
|
required A Java regular expression, the external content stores whose referencePattern match the storage URL of a hybrid asset may be used to content. |
||
|
optional The buffering policy when reading or writing content to S3. Valid values:
|
||
|
optional The maximum buffer size in bytes. The default is |
||
|
optional If If
|
||
|
optional The maximum time in milliseconds a cached S3 will be kept. Connections older than The default value is |
Step 3: Register the light module
Ensure your light module is registered by including a module.yaml
file in the root of your light module.
This file ensures Magnolia applies your decorations in the correct order.
version: 1.0
dependencies:
hybrid-assets-advanced:
version: "*"
Step 4: Test your configuration
-
Restart your Magnolia instance.
-
In the Hybrid Assets app, use the Link external content action to connect to S3 assets.
-
Verify that assets from your S3 bucket appear and can be linked.
Troubleshooting
-
Credentials error: Ensure your AWS credentials are correct.
-
Action not available: Confirm the
hybridAssets.subApps.yaml
decoration is applied correctly. -
Can not transfer asset: Ensure your credentials have the correct permissions on the configured
bucket
. -
Asset conflicts: Ensure the
referenceTemplate
generates unique URLs to avoid overwriting assets. See External reference factory for guidance on unique templates.
For advanced users
For custom reference mappings, voters, or additional Azure store parameters, refer to External reference factory.