Reputation: 4511
I have set up one Kinesis Firehose stream under account A. As per our requirement this stream should write data to s3 bucket owned by different aws account B, that involves:
Till now, I have added following policy to s3 bucket under account B (id 2) that I want to write from firehose under account A (id 1).
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "avs-bi-access",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::1:root"
]
},
"Action": [
"s3:ListBucket",
"s3:GetObject",
“s3:PutObject”
],
"Resource": [
"arn:aws:s3:::testBucket",
"arn:aws:s3:::testBucket/*"
]
}
]
}
Apart from it, in the role used by Firehose under account A (id 1), trust relationship is as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "firehose.amazonaws.com",
"AWS": "arn:aws:iam::2:root"
},
"Action": "sts:AssumeRole"
}
]
}
Even after that, I cannot select the given bucket in Firehose configuration page. I think, I am missing something.
Upvotes: 2
Views: 5519
Reputation: 270184
You should follow the directions on:
Basically:
AWS
value in the Role principalYou will never get a bucket from another account showing in the pull-down list in the console. Instead, you will need to choose the bucket when creating the Firehose Delivery Stream via an API/CLI call, or you can use the update-destination
API call to change the destination:
aws firehose update-destination --delivery-stream-name foo --current-delivery-stream-version-id 1 --destination-id 'destinationId-000000000001' --extended-s3-destination-update '{"BucketARN":"arn:aws:s3:::YOUR-BUCKET"}'
You can obtain the version
and destination-id
via:
aws firehose describe-delivery-stream --delivery-stream-name foo
Disclaimer: I tried all of the above and managed to get the bucket selected. However, I didn't get any data delivered to the bucket. Perhaps you'll have more success than I did.
Upvotes: 3