Skip to content

[OC-4962] Add field to store the S3 region used by each instance

Boros Gábor requested to merge guruprasad/store-s3-region into master

Created by: lgp171188

This PR adds a field to store the S3 region used by each instance. Some clients are particular about which regions can be used to store their data and the data stored in this field will help in easily identifying the S3 region used by an instance.

Dependencies: None

Testing instructions:

  1. Pull the code changes in the source branch of this PR.
  2. Create a new instance.
  3. Add the AWS_S3_DEFAULT_REGION configuration setting to the .env file and specify a value for that since the setting will otherwise use '' as the default value. This has to be added to the .env file on OCIM production and stage environments via a separate PR to ansible-secrets repository.
  4. The S3 region field should have the s3_region field set to the configured value or the default value AWS_S3_DEFAULT_REGION. Verify this in the admin interface form for creating an instance as well.
  5. Provision an appserver for the instance. It should use S3 bucket(s) created in the configured region.
  6. Archive an instance and verify that the S3 field still retains its value. The same behaviour should be exhibited when the deprovision_s3() method is directly called.

Reviewers

Merge request reports