Give @lnl7 upload access to the tarballs bucket
Eelco Dolstra committed
Jun 29, 2018 at 17:28 UTC
cce47a224aeb66c013f7998a70e624a5a0afdc44
1 file changed
+24
-29
nixos-org/network.nix
+24
-29
@@ -36,6 +36,25 @@ in
36
37
resources.s3Buckets.nixpkgs-tarballs =
38
{ config, ... }:
39
+ let
40
+ allowUser = name: arn:
41
+ [
42
+ {
43
+ Sid = "${name}AllowUpload";
44
+ Effect = "Allow";
45
+ Principal.AWS = arn;
46
+ Action = [ "s3:PutObject" "s3:PutObjectAcl" ];
47
+ Resource = [ "${config.arn}/*" ];
48
+ }
49
+ {
50
+ Sid = "${name}AllowUpload2";
51
+ Effect = "Allow";
52
+ Principal.AWS = arn;
53
+ Action = [ "s3:ListBucket" ];
54
+ Resource = [ "${config.arn}" ];
55
+ }
56
+ ];
57
+ in
58
{ inherit region accessKeyId;
59
name = "nixpkgs-tarballs";
60
# All files are readable but not listable.
@@ -65,35 +84,11 @@ in
84
Action = [ "s3:ListBucket" ];
85
Resource = [ "${config.arn}" ];
86
}
68
- {
69
- Sid = "CopumpkinAllowUpload";
70
- Effect = "Allow";
71
- Principal.AWS = "arn:aws:iam::390897850978:root";
72
- Action = [ "s3:PutObject" "s3:PutObjectAcl" ];
73
- Resource = [ "${config.arn}/*" ];
74
- }
75
- {
76
- Sid = "CopumpkinAllowUpload2";
77
- Effect = "Allow";
78
- Principal.AWS = "arn:aws:iam::390897850978:root";
79
- Action = [ "s3:ListBucket" ];
80
- Resource = [ "${config.arn}" ];
81
- }
82
- {
83
- Sid = "ShlevyAllowUpload";
84
- Effect = "Allow";
85
- Principal.AWS = "arn:aws:iam::976576280863:user/shlevy";
86
- Action = [ "s3:PutObject" "s3:PutObjectAcl" ];
87
- Resource = [ "${config.arn}/*" ];
88
- }
89
- {
90
- Sid = "ShlevyAllowUpload2";
91
- Effect = "Allow";
92
- Principal.AWS = "arn:aws:iam::976576280863:user/shlevy";
93
- Action = [ "s3:ListBucket" ];
94
- Resource = [ "${config.arn}" ];
95
- }
96
- ];
87
+ ]
88
+ ++ allowUser "Copumpkin" "arn:aws:iam::390897850978:root"
89
+ ++ allowUser "Shlevy" "arn:aws:iam::976576280863:user/shlevy"
90
+ ++ allowUser "Daiderd" "arn:aws:iam::014292808257:user/lnl7"
91
+ ;
92
};
93
website.enabled = true;
94
};