I have a dataframe as follows:
bucket_name tags
name1 tag1
name2 tag2
name3 tag3
I want to use the above to insert tags into the respective s3 bucket. How can I do this using boto3?
import boto3
s3_client = boto3.client('s3')
bucket_tags = {'bucket_name': 'tag',...}
for bucket, tag in bucket_tags.items():
response = s3_client.put_bucket_tagging(
Bucket = bucket,
Tagging={
'TagSet': [
{
'Key': 'mykey',
'Value': tag
},
]
},
)