Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit e68c63a

Browse files
Adding S3Bucket Resource
**Why:** * This allows you to provision an S3 bucket for usage with your applications **This change addresses the need by:** * close #5
1 parent 60ed6a8 commit e68c63a

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

examples/s3bucket.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: operator.aws/v1alpha1
2+
kind: S3Bucket
3+
metadata:
4+
name: chrishein-test-bucket-104
5+
spec:
6+
bucketName: chrishein-test-bucket-name-104
7+
versioning: false
8+
logging:
9+
enabled: false
10+
prefix: "archive"

models/s3bucket.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
apiVersion: operator.aws/v1alpha1
2+
kind: ModelDefinition
3+
metadata:
4+
name: S3BucketResource
5+
spec:
6+
kind: S3Bucket
7+
type: Spec # can be Spec or Data
8+
queue: true
9+
useCloudFormation: true
10+
resource:
11+
name: s3bucket
12+
plural: s3buckets
13+
shortNames:
14+
- name: s3
15+
- name: bucket
16+
- name: buckets
17+
body:
18+
schema:
19+
type: object
20+
properties:
21+
- key: bucketName
22+
type: string
23+
description: |
24+
BucketName is the name of the S3 Bucket to be created.
25+
structKey: BucketName
26+
templateKey: BucketName
27+
- key: versioning
28+
type: bool
29+
description: |
30+
Versioning specifies if whether you want to automatically enable versioning of the content in the bucket.
31+
structKey: Versioning
32+
templateKey: EnableVersioning
33+
- key: logging
34+
type: object
35+
description: |
36+
Logging defines the options for managing the S3 logging options.
37+
structKey: Logging
38+
templateKey: logging
39+
properties:
40+
- key: enabled
41+
type: bool
42+
description: |
43+
Logging Enabled configures the S3 Bucket to log to a separate Logging bucket
44+
structKey: Enabled
45+
templateKey: EnableLogging
46+
- key: prefix
47+
type: string
48+
description: |
49+
Logging prefix to attach to all logs in the bucket.
50+
structKey: Prefix
51+
templateKey: LoggingPrefix
52+
output:
53+
schema:
54+
type: object
55+
properties:
56+
- key: bucketName
57+
type: string
58+
description: |
59+
BucketName is the output bucketname incase it changed
60+
structKey: BucketName
61+
templateKey: BucketName
62+
- key: bucketARN
63+
type: string
64+
description: |
65+
BucketARN is the full Amazon ARN for the bucket created
66+
structKey: BucketARN
67+
templateKey: BucketArn
68+
# additionalResources:
69+
# services:
70+
# - type: ExternalName
71+
# externalName: "{{.Obj.Spec.BucketName}}.s3-{{.Config.Region}}.amazonaws.com"
72+
# ports:
73+
# - protocol: tcp
74+
# port: 443
75+

0 commit comments

Comments
 (0)