cancel
Showing results for 
Search instead for 
Did you mean: 

Consume s3 Connections property inside Python3 operator

382

Hii,

I want to consume the properties/Parameter values which is already there in the connection management specifically for S3 bucket Access keys and secret access key.

I saw somewhere that we can do the same for HanaDB using api.config (Something like this).

The Use is when putting the objects inside s3, We have to provide Tags to those objects. Now I am currently doing it by hardcoding those values inside Python operator and and using Boto3 for the process. Now this is not recommended in further developments.

So If there is a way to consume those values from the connection that we have already made in Connection management for the same S3 bucket, then there won't be need of hardcoding values.

Hoping to hear some suggestions from the community!

Thanks,

Samarth

Accepted Solutions (0)

Answers (2)

Answers (2)

andy_yin
Product and Topic Expert
Product and Topic Expert

Hi Samarth,

This link Managed Connections in Script Operators maybe useful to you.

0 Kudos

Hey Andy,

Thanks for a showing direction.

I followed all steps showing in that link but i changed the Connection type from OPENAPI to S3.

I am monitoring the output at the wiretap but its showing no response.(No output)

Any idea what is the reason?

Thanks,

Samarth

andy_yin
Product and Topic Expert
Product and Topic Expert
0 Kudos

Samarth,

  1. Check and verify if you S3 connection is in the returned list from https://YOUR_DI_INSTANCE/app/datahub-app-connection/connections?connectionTypes=s3.
  2. Check Status in connection manager to verify if your S3 connection is OK.
  3. Try to change the code host = managedConnectionProperties['host'] to host = managedConnectionProperties['endpoint'] if you did not do this previously.

Hope this helpful.