Skip to content

Commit c4c70e6

Browse files
author
Dersim Davaod
committed
Add cloudformation template.
1 parent 36f47fd commit c4c70e6

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

cloudformation/ci.template.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
var cf = require('@mapbox/cloudfriend');
2+
3+
module.exports = {
4+
AWSTemplateFormatVersion: '2010-09-09',
5+
Resources: {
6+
User: {
7+
Type: 'AWS::IAM::User',
8+
Properties: {
9+
Policies: [
10+
{
11+
PolicyName: 'List-objects-in-S3-bucket',
12+
PolicyDocument: {
13+
Statement: [
14+
{
15+
Action: [
16+
's3:GetObject',
17+
's3:GetObjectAcl',
18+
's3:ListBucket',
19+
's3:ListAllMyBuckets'
20+
],
21+
Effect: 'Allow',
22+
Resource: [
23+
'arn:aws:s3:::mapbox/*'
24+
],
25+
Condition: {
26+
StringLike: {
27+
's3:prefix': '/vision/travis/ios-builds*'
28+
}
29+
}
30+
}
31+
]
32+
}
33+
}
34+
]
35+
}
36+
},
37+
AccessKey: {
38+
Type: 'AWS::IAM::AccessKey',
39+
Properties: {
40+
UserName: cf.ref('User')
41+
}
42+
}
43+
},
44+
Outputs: {
45+
AccessKeyId: { Value: cf.ref('AccessKey') },
46+
SecretAccessKey: { Value: cf.getAtt('AccessKey', 'SecretAccessKey') }
47+
}
48+
};
49+

0 commit comments

Comments
 (0)