Commit 40392f53 authored by Spencer Sutton's avatar Spencer Sutton
Browse files

Merge

parents c8f5b8f2 351322ec
Pipeline #69446 passed with stage
in 1 minute and 12 seconds
......@@ -12,5 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = '0.0.3'
__version__ = '0.0.4'
......@@ -126,18 +126,21 @@ class AwsStorage(BlobStorageBase):
""" get credentials to access s3 bucket for tenant's folder """
# all tenants in one bucket(self._bucket_name). Each tenant.bucket_name is in fact, a folder in self._bucket_name
folder = tenant.bucket_name
data_partition_id = tenant.data_partition_id
ssm = boto3.client('ssm', region_name=self._region)
if(self._bucket_name == ""):
# get bucket name from ssm
response = ssm.get_parameter(Name='/osdu/'+self._aws_env+'/wellbore-ddms/wellbore-ddms-s3-bucket-name',WithDecryption=True)
response = ssm.get_parameter(
Name=f'/osdu/{self._aws_env}/{data_partition_id}/wellbore-ddms/WellboreDDMSBucket/name',
WithDecryption=True)
self._bucket_name = response['Parameter']['Value']
bucket_policy = self.getPolicy(self._bucket_name, folder)
response =ssm.get_parameter(Name='/osdu/' + self._aws_env + '/wellbore-ddms/iam/s3-access-role-arn')
response =ssm.get_parameter(Name=f'/osdu/{self._aws_env}/{data_partition_id}/wellbore-ddms/iam/s3-access-role-arn')
roleArn = response['Parameter']['Value']
response = ssm.get_parameter(Name='/osdu/' + self._aws_env + '/wellbore-ddms/temp-cred-expiration-duration')
response = ssm.get_parameter(Name=f'/osdu/{self._aws_env}/{data_partition_id}/wellbore-ddms/temp-cred-expiration-duration')
exp = response['Parameter']['Value']
sts_client = boto3.client('sts', region_name=self._region)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment