Skip to content

Commit

Permalink
Merge 868ec89 into 324e5b6
Browse files Browse the repository at this point in the history
  • Loading branch information
Avantol13 committed Mar 2, 2020
2 parents 324e5b6 + 868ec89 commit d455aa4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
4 changes: 2 additions & 2 deletions fence/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ def _check_s3_buckets(app):
Function to ensure that all s3_buckets have a valid credential.
Additionally, if there is no region it will produce a warning then trys to fetch and cache the region.
"""
buckets = config.get("S3_BUCKETS", {})
aws_creds = config.get("AWS_CREDENTIALS", {})
buckets = config.get("S3_BUCKETS") or {}
aws_creds = config.get("AWS_CREDENTIALS") or {}

for bucket_name, bucket_details in buckets.items():
cred = bucket_details.get("cred")
Expand Down
44 changes: 23 additions & 21 deletions fence/config-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -476,30 +476,32 @@ STORAGE_CREDENTIALS: []
# AWS BUCKETS AND CREDENTIALS
# - Support `/data` endpoints
# //////////////////////////////////////////////////////////////////////////////////////
AWS_CREDENTIALS:
'CRED1':
aws_access_key_id: ''
aws_secret_access_key: ''
'CRED2':
aws_access_key_id: ''
aws_secret_access_key: ''
AWS_CREDENTIALS: []
# NOTE: Remove the [] and supply creds if needed. Example in comments below
# 'CRED1':
# aws_access_key_id: ''
# aws_secret_access_key: ''
# 'CRED2':
# aws_access_key_id: ''
# aws_secret_access_key: ''

# NOTE: the region is optonal for s3_buckets, however it should be specified to avoid a
# call to GetBucketLocation which you make lack the AWS ACLs for.
S3_BUCKETS:
bucket1:
cred: 'CRED1'
region: 'us-east-1'
bucket2:
cred: 'CRED2'
region: 'us-east-1'
bucket3:
cred: '*'
region: 'us-east-1'
bucket4:
cred: 'CRED1'
region: 'us-east-1'
role-arn: 'arn:aws:iam::role1'
S3_BUCKETS: []
# NOTE: Remove the [] and supply buckets if needed. Example in comments below
# bucket1:
# cred: 'CRED1'
# region: 'us-east-1'
# bucket2:
# cred: 'CRED2'
# region: 'us-east-1'
# bucket3:
# cred: '*'
# region: 'us-east-1'
# bucket4:
# cred: 'CRED1'
# region: 'us-east-1'
# role-arn: 'arn:aws:iam::role1'

# `DATA_UPLOAD_BUCKET` specifies an S3 bucket to which data files are uploaded,
# using the `/data/upload` endpoint. This must be one of the first keys under
Expand Down

0 comments on commit d455aa4

Please sign in to comment.