퍼블릭 클라우드 관련/AWS

[AWS] a 계정에 있는 S3 버킷에 b계정 firehose로 데이터 전송하기

호레 2025. 3. 18. 14:18
반응형

1️⃣ Cloud Shell에서 Firehose 계정의 Canonical ID 확인

aws s3api list-buckets --query "Owner.ID"


"b8a1f3d1e58c9d07b3e12abcd567890abcdef1234567890abc1234567890def"

 

2️⃣ s3 액세스 제어 목록 -> 다른 aws 계정에 대한 엑세스 입력 후 권한 부여 

3️⃣ s3 에 firehose에서 쓸수 있도록 권한 부여 

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowFirehoseAccess",
            "Effect": "Allow",
            "Principal": {
                "Service": "firehose.amazonaws.com"
            },
            "Action": "s3:PutObject",
            "Resource": "arn:aws:s3:::aes-siem-log/*",
            "Condition": {
                "ArnLike": {
                    "aws:SourceArn": "arn:aws:firehose:us-east-1:111518325286:deliverystream/aws-waf-logs"
                }
            }
        },
        {
            "Sid": "AllowFirehoseBucketAccess",
            "Effect": "Allow",
            "Principal": {
                "Service": "firehose.amazonaws.com"
            },
            "Action": [
                "s3:ListBucket",
                "s3:GetBucketLocation"
            ],
            "Resource": "arn:aws:s3:::aes-siem-log",
            "Condition": {
                "StringEquals": {
                    "aws:SourceAccount": "111518325286"
                }
            }
        }
    ]
}
반응형