forked from s3-wagon-private/s3-wagon-private
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudformation-template.yml
59 lines (54 loc) · 1.48 KB
/
cloudformation-template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Description: Creates a bucket to go with the s3-wagon-private
Parameters:
UserArn:
Description: the ARN of your AWS user entity
Type: String
BucketName:
Description: The name of the bucket for your maven repo
Type: String
Default: MavenRepo
MinLength: 1
MaxLength: 64
AllowedPattern: ^[a-zA-Z0-9_-]*$
Resources:
MavenRepoBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref BucketName
DeletionPolicy: Retain
MavenRepoBucketPolicy:
Type: 'AWS::S3::BucketPolicy'
Properties:
Bucket: !Ref BucketName
PolicyDocument:
Statement:
- Effect: Allow
Action:
- s3:ListBucket
- s3:GetBucketLocation
Resource:
- !Sub "arn:aws:s3:::${BucketName}"
Principal:
AWS:
- !Ref UserArn
- Effect: Allow
Action:
- s3:GetObject
- s3:GetObjectVersion
- s3:PutObject
Resource:
- !Sub "arn:aws:s3:::${BucketName}/*"
Principal:
AWS:
- !Ref UserArn
Outputs:
MavenRepoBucketName:
Value: !Ref MavenRepoBucket
Description: The name of your maven repo bucket
Export:
Name: "MavenRepoBucketName"
MavenRepoBucketDomainName:
Value: !GetAtt MavenRepoBucket.DomainName
Description: The domain name of your maven repo bucket
Export:
Name: "MavenRepoBucketDomainName"