Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple policies to be attached to an s3 bucket #10543

Closed
evanstachowiak opened this issue Dec 5, 2016 · 6 comments
Closed

Allow multiple policies to be attached to an s3 bucket #10543

evanstachowiak opened this issue Dec 5, 2016 · 6 comments

Comments

@evanstachowiak
Copy link

Hi there,

Terraform Version

0.7.13

Affected Resource(s)

  • aws_s3_bucket_policy

Expected Behavior

Instead of using a different bucket for different logs, I'm trying to use one bucket with different prefixes. The issue with this is that I cannot use more than one aws_s3_bucket_policy. If I specify this resource multiple times, the previous gets overwritten and only the last one is used. Ideally, there would be something like aws_iam_policy_attachment resource.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Try to use multiple s3 policies on a bucket.
@akerl
Copy link

akerl commented Dec 8, 2016

AWS only supports a single bucket policy on a bucket. You can combine multiple Statements into a single policy, but not attach multiple policies.

@jemmyw
Copy link

jemmyw commented Feb 4, 2017

I've also run across this problem. The issue is that I can't assemble a policy from resources in different modules unless I output all those policies. It's be nice to have a resource like "aws_s3_bucket_policy_statement"

@rajiv2205
Copy link

Can anybody suggest workaround for this? I have multiple environments (some are already existing and some I create with terraform). My requirement is that the bucket should be accessible to old infra and new one's. When I tier down new terraform infra.. the policy will get updated automatically and remove the ips of recently removed infra. However, the old infra ips should be there.

@ghost
Copy link

ghost commented May 30, 2017

+1 @rajiv2205 I have exactly the same problem.

@rajiv2205
Copy link

@hwscell I changed my approach to aws roles. Now, the instances that have the role attached on it can access s3 bucket. The IAM role has permissions to access the bucket. Hope this will help.

@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants