-
Notifications
You must be signed in to change notification settings - Fork 0
/
multiple_s3-bucket.yaml
77 lines (67 loc) · 1.44 KB
/
multiple_s3-bucket.yaml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
AWSTemplateFormatVersion: 2010-09-09
Description: This template provisions a multiple s3 buckets
## Parameters
Parameters:
MyBucketName:
Type: String
Default: ''
Description: Enter your bucket name
MyBucketName2:
Type: String
Default: ''
TeamValue:
Type: String
Default: "dev"
Description: Enter
OwnerValue:
Type: String
Default: ""
Description: Enter your name
S3Versioning:
Type: String
Default: "Enabled"
AllowedValues:
- Enabled
- Suspended
## Resources
Resources:
# S3 bucket 1
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref MyBucketName
VersioningConfiguration:
Status: !Ref S3Versioning
Tags:
- Key: Team
Value: !Ref TeamValue
- Key: Owner
Value: !Ref OwnerValue
# S3 bucket 2
MyS3Bucket2:
DependsOn:
- MyS3Bucket
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref MyBucketName2
VersioningConfiguration:
Status: !Ref S3Versioning
Tags:
- Key: Team
Value: !Ref TeamValue
- Key: Owner
Value: !Ref OwnerValue
## Outputs
Outputs:
SampleBucketName:
Description: S3 bucket name
Value: !Ref MyS3Bucket
SampleBucketName2:
Description: S3 bucket name and region
Value:
Fn::Join:
- ''
- - 'bucket:'
- Ref: AWS::Region
- ':'
- Ref: MyS3Bucket2