Paste the below code in bucket policy.
{
"Version": "2008-10-17",
"Id": "CrossAccountAccessPolicy",
"Statement": [
{
"Sid": "BucketAccess",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::AccountB-ID:root"
},
"Action": [
"s3:ListBucket",
"s3:GetObject",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::cyberbuddybucket",
"arn:aws:s3:::cyberbuddybucket/*"
]}
]}
Change the bucket name and Update the account id in bucket policy.