简体   繁体   English

Amazon Advertising API不适用于S3的自定义VPC终端节点策略

[英]Amazon Advertising API is not working with custom VPC endpoint policy for S3

Amazon Advertising API is not working with custom VPC endpoint policy for S3. Amazon Advertising API不适用于S3的自定义VPC终端节点策略。

I have two S3 buckets and two EC2 instances in two VPCs. 我在两个VPC中有两个S3存储桶和两个EC2实例。 Created VPC endpoints to access S3 bucket. 创建了VPC端点以访问S3存储桶。

I need to connect bucket test1 from EC2-1 in VPC1 and bucket test2 from EC2-2 in VPC2 . 我需要斗连接test1EC2-1VPC1和铲斗test2EC2-2VPC2 Need to block access from EC2-1 to bucket test2 and EC2-2 to bucket test1 . 需要阻止访问EC2-1到斗test2EC2-2到斗test1

These 2 buckets are under an AWS account and using same IAM user credentials to access these buckets. 这两个存储桶都在一个AWS账户下,并且使用相同的IAM用户凭据访问这些存储桶。

Policy which I used for VPC Endpoint for S3 in VPC1 : 我在VPC1用于S3的VPC端点的VPC1

{
    "Statement": [
        {
            "Sid": "Access-to-specific-bucket-only",
            "Principal": "*",
            "Action": [
                "s3:GetObject",
                "s3:ListBucket",
                "s3:PutObject"
            ],
            "Effect": "Allow",
            "Resource": [
                "arn:aws:s3:::test1",
                "arn:aws:s3:::test1/*"
            ]
        }
    ]
}

This policy is working fine. 这项政策运作良好。 But, I need to access Amazon Advertising API from my EC2 instances. 但是,我需要从我的EC2实例访问Amazon Advertising API。 Now, which gives a connection error. 现在,这给出了连接错误。 It will work when I give Full Access, that I do not want. 当我授予完全不需要的权限时,它将起作用。 Please help me to set up a custom policy. 请帮助我设置自定义政策。

Note: Amazon Advertising API URL start with https://amazon-advertising-api-reports-prod-usamazon.s3.amazonaws.com 注意: Amazon Advertising API URL以https://amazon-advertising-api-reports-prod-usamazon.s3.amazonaws.com开头

That looks like a URL where you can retrieve reports rather than an actual URL to the Advertising API. 看起来像是您可以在其中检索报告的URL,而不是广告API的实际URL。

Your VPC Endpoint for S3 policy is permitting access to the test1 bucket, but it is not granting access to the amazon-advertising-api-reports-prod-usamazon bucket. 您的S3的VPC端点策略允许访问test1存储桶,但不授予对amazon-advertising-api-reports-prod-usamazon存储桶的访问权限。

If you add that to your policy it be able to access the reports. 如果将其添加到策略中,则可以访问报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM