geoHeil
05/15/2022, 3:24 PM_credentials
attribute is None
for the readily initialized s3
resource. I do not know why it is not initialized.jamie
05/16/2022, 6:38 PMget_credentials
function, I think that only applies to a generic aws session (ie the return of boto3.Session()
) in the S3 resource we are returning an instance of an S3 client. The docs for the S3 client (here) don't indicate any way to get the credentials from the S3 client. One option would be to write a simple AWS session resource that can return credentials and add that as a required resource to your opgeoHeil
05/16/2022, 9:20 PMgeoHeil
05/16/2022, 9:20 PMjamie
05/16/2022, 9:23 PM_credentials
wouldn't be populated. i'll get back to youjamie
05/16/2022, 9:48 PM@op(
required_resource_keys={"s3_resource"}
)
def get_s3_creds(context):
s3 = context.resources.s3_resource
creds = s3._request_signer._credentials
<http://context.log.info|context.log.info>(f"CREDENTIALS {creds.secret_key} {creds.token} {creds.access_key}")
@job(
resource_defs={"s3_resource": s3_resource}
)
def s3_job():
get_s3_creds()
the _credentials
attr is under _request_signer
geoHeil
05/18/2022, 8:00 AM