[OC-4962] Add field to store the S3 region used by each instance
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:
- Pull the code changes in the source branch of this PR.
- Create a new instance.
- 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 toansible-secrets
repository. - The S3 region field should have the
s3_region
field set to the configured value or the default valueAWS_S3_DEFAULT_REGION
. Verify this in the admin interface form for creating an instance as well. - Provision an appserver for the instance. It should use S3 bucket(s) created in the configured region.
- 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