Module:Integration With Amazon S3
This module provides an attachment method that stores the attachments in the Amazon S3 object storage service. It can be used as an alternative for the core attachment method which by default stores the files in the Openbravo server itself.
It is possible to add, update and remove attachments by handling them as objects stored in Amazon S3.
The configuration for the integration with Amazon S3 is done in the same way as it is done for any attachment method: through the Attachment Configuration window. This configuration is done at Client level.
To configure this new attachment method, the Files stored in Amazon S3 object storage platform option must be selected as the attachment method and the active checkbox must be checked off.
When selecting this option, the following field will be displayed to be populated:
- Amazon S3 Configuration: The Amazon S3 configuration that defines the bucket where the attachments should be stored, together with the required connection settings.
To create an Amazon S3 Configuration, a new record should be created in the Amazon S3 Configuration window.
The following fields can be found in this window:
- Search Key: A name that identifies the configuration. It is a value that is unique for all the configurations.
- Bucket: Amazon S3 stores data as objects within resources called buckets. It is possible to write, read and delete objects within a bucket. This is the name of the bucket where the attachments will be stored. Visit here to know more about bucket restriction and limitations.
- Region: The identifier of the region that will be used to determine both the Amazon service endpoint and signing region. See here for the complete list of Amazon Web Services regions and endpoints.
- Is EC2 Instance: Indicates whether the application is running on an Amazon EC2 instance. This determines the way of retrieving the Amazon Web Services credentials required to connect with Amazon S3.
If the Is EC2 Instance field is not selected, then the authentication credentials must be provided. Thus, the following two fields will be displayed in order to allow specifying the Access Key. Access Keys are used to sign programmatic requests to Amazon Web Services and consist of an Access Key ID and a Secret Access Key.
- AWS Access ID Key: the Access Key ID.
- AWS Secret Access Key: the Secret Access Key.
Besides, there is a process that allows to verify if the defined configuration is correct. This process can be launched by clicking on the Verify Configuration button.
This module provides a process that allows to migrate the attachments generated with the core attachment method (files stored in Openbravo server) to Amazon S3.
The process is named Amazon S3 Migration Process and it can be scheduled as a background process to be executed in hours of less usage of the application (for example, during the night). It requires to have the Amazon S3 attachment method configured as the active attachment method of the Client.
In addition, this process allows to configure the maximum duration of every single execution, when selecting it in the Process Request window. This can be done by populating the Migration Max. Time field which is available for this process in particular.
When the process detects that its execution is lasting more than the amount of time specified in that field (in minutes), then its execution will be stopped. In case this field is left empty, the process is defaulted to last, at most, one hour. And if it is set with a value of 0, then the process will last until all the attachments have been migrated into S3.