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

Commit 2a1bece

Browse files
Adding The CFT Resource Objects
**Why:** * These are the files that generate the code gened libraries **This change addresses the need by:** * closes #8
1 parent 42443f1 commit 2a1bece

File tree

4 files changed

+398
-0
lines changed

4 files changed

+398
-0
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
apiVersion: operator.aws/v1alpha1
2+
kind: CloudFormationTemplate
3+
metadata:
4+
name: dynamodb
5+
data:
6+
key: dynamodb.yaml
7+
template: |
8+
AWSTemplateFormatVersion: 2010-09-09
9+
Description: 'AWS Operator - Amazon DynamoDB'
10+
Parameters:
11+
Namespace:
12+
Description: >-
13+
This is the namespace for the Kubernetes object.
14+
Type: String
15+
ResourceVersion:
16+
Type: String
17+
Description: >-
18+
This is the resource version for the Kubernetes object.
19+
ResourceName:
20+
Description: >-
21+
This is the resource name for the Kubernetes object
22+
Type: String
23+
ClusterName:
24+
Description: >-
25+
This is the cluster name for the operator
26+
Type: String
27+
TableName:
28+
Description: >-
29+
Must contain only lowercase letters, numbers and hyphens.
30+
Type: String
31+
HashAttributeName:
32+
Type: String
33+
Description: Name of the Hash key
34+
HashAttributeType:
35+
Type: String
36+
AllowedValues:
37+
- S
38+
- N
39+
- B
40+
Default: "S"
41+
Description: AttributeType for Hash key
42+
RangeAttributeName:
43+
Type: String
44+
Description: Name of the Range key
45+
RangeAttributeType:
46+
Type: String
47+
AllowedValues:
48+
- S
49+
- N
50+
- B
51+
Default: "S"
52+
Description: AttributeType for the Range key
53+
ReadCapacityUnits:
54+
Type: String
55+
Description: Read ReadCapacity Units
56+
Default: "5"
57+
WriteCapacityUnits:
58+
Type: String
59+
Description: Write Capacity Units
60+
Default: "5"
61+
Resources:
62+
DynamoDBTable:
63+
Type: "AWS::DynamoDB::Table"
64+
Properties:
65+
TableName: !Ref TableName
66+
KeySchema:
67+
-
68+
AttributeName: !Ref HashAttributeName
69+
KeyType: "HASH"
70+
-
71+
AttributeName: !Ref RangeAttributeName
72+
KeyType: "RANGE"
73+
AttributeDefinitions:
74+
-
75+
AttributeName: !Ref HashAttributeName
76+
AttributeType: "S"
77+
-
78+
AttributeName: !Ref RangeAttributeName
79+
AttributeType: "S"
80+
ProvisionedThroughput:
81+
ReadCapacityUnits: !Ref ReadCapacityUnits
82+
WriteCapacityUnits: !Ref WriteCapacityUnits
83+
Tags:
84+
- Key: Namespace
85+
Value: !Ref Namespace
86+
- Key: ResourceVersion
87+
Value: !Ref ResourceVersion
88+
- Key: ResourceName
89+
Value: !Ref ResourceName
90+
- Key: ClusterName
91+
Value: !Ref ClusterName
92+
- Key: Heritage
93+
Value: operator.aws
94+
Outputs:
95+
TableName:
96+
Description: Name of the DynamoDB Table
97+
Value: !Ref DynamoDBTable
98+
TableArn:
99+
Description: Arn of the DynamoDB Table
100+
Value: !GetAtt DynamoDBTable.Arn
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
apiVersion: operator.aws/v1alpha1
2+
kind: CloudFormationTemplate
3+
metadata:
4+
name: s3bucket
5+
data:
6+
key: s3bucket.yaml
7+
template: |
8+
AWSTemplateFormatVersion: 2010-09-09
9+
Description: 'AWS Operator - Amazon S3 Bucket'
10+
Parameters:
11+
Namespace:
12+
Description: >-
13+
This is the namespace for the Kubernetes object.
14+
Type: String
15+
ResourceVersion:
16+
Type: String
17+
Description: >-
18+
This is the resource version for the Kubernetes object.
19+
ResourceName:
20+
Description: >-
21+
This is the resource name for the Kubernetes object
22+
Type: String
23+
ClusterName:
24+
Description: >-
25+
This is the cluster name for the operator
26+
Type: String
27+
BucketName:
28+
Description: >-
29+
Must contain only lowercase letters, numbers, periods (.), and hyphens
30+
(-),Cannot end in numbers
31+
Type: String
32+
Default: apps3bucket
33+
LoggingPrefix:
34+
Description: >-
35+
Must contain only lowercase letters, numbers, periods (.), and hyphens
36+
(-),Cannot end in numbers
37+
Type: String
38+
Default: Archive
39+
EnableLogging:
40+
Description: enable or discable S3 logging
41+
Type: String
42+
AllowedValues:
43+
- 'true'
44+
- 'false'
45+
Default: 'true'
46+
EnableGlacierLifeCycle:
47+
Description: enable archiving to Glacier Storage
48+
Type: String
49+
AllowedValues:
50+
- 'true'
51+
- 'false'
52+
Default: 'false'
53+
GlacierLifeCycleTransitionInDays:
54+
Description: Define how many days objects should exist before being moved to Glacier
55+
Type: String
56+
Default: '0'
57+
EnableVersioning:
58+
Description: enable versioning
59+
Type: String
60+
AllowedValues:
61+
- 'true'
62+
- 'false'
63+
Default: 'false'
64+
LifeCyclePrefix:
65+
Description: >-
66+
Must contain only lowercase letters, numbers, periods (.), and hyphens
67+
(-),Cannot end in numbers
68+
Type: String
69+
Default: Archive
70+
BucketAccessControl:
71+
Description: define if the bucket can be accessed from public or private locations
72+
Type: String
73+
AllowedValues:
74+
- Private
75+
- PublicRead
76+
- PublicReadWrite
77+
- AuthenticatedRead
78+
- LogDeliveryWrite
79+
- BucketOwnerRead
80+
- BucketOwnerFullControl
81+
- AwsExecRead
82+
Default: "Private"
83+
Mappings: {}
84+
Conditions:
85+
UseLogging: !Equals
86+
- !Ref EnableLogging
87+
- 'true'
88+
UseGlacierLifeCycle: !Equals
89+
- !Ref EnableGlacierLifeCycle
90+
- 'true'
91+
UseVersioning: !Equals
92+
- !Ref EnableVersioning
93+
- 'true'
94+
Resources:
95+
S3bucket:
96+
Type: 'AWS::S3::Bucket'
97+
Properties:
98+
BucketName: !Ref BucketName
99+
AccessControl: !Ref BucketAccessControl
100+
LifecycleConfiguration:
101+
Rules:
102+
- Id: GlacierRule
103+
Prefix: !Ref LifeCyclePrefix
104+
Status: Enabled
105+
ExpirationInDays: '365'
106+
Transitions:
107+
- TransitionInDays: !Ref GlacierLifeCycleTransitionInDays
108+
StorageClass: Glacier
109+
LoggingConfiguration: !If
110+
- UseLogging
111+
- DestinationBucketName: !Ref LoggingBucket
112+
LogFilePrefix: !Ref LoggingPrefix
113+
- !Ref 'AWS::NoValue'
114+
Tags:
115+
- Key: Namespace
116+
Value: !Ref Namespace
117+
- Key: ResourceVersion
118+
Value: !Ref ResourceVersion
119+
- Key: ResourceName
120+
Value: !Ref ResourceName
121+
- Key: ClusterName
122+
Value: !Ref ClusterName
123+
- Key: Heritage
124+
Value: operator.aws
125+
VersioningConfiguration: !If
126+
- UseVersioning
127+
- Status: Enabled
128+
- !Ref 'AWS::NoValue'
129+
DeletionPolicy: Retain
130+
LoggingBucket:
131+
Condition: UseLogging
132+
Type: 'AWS::S3::Bucket'
133+
DeletionPolicy: Retain
134+
Properties:
135+
AccessControl: LogDeliveryWrite
136+
BucketName: !Join
137+
- ''
138+
- - !Ref BucketName
139+
- logging
140+
Outputs:
141+
BucketName:
142+
Value: !Ref S3bucket
143+
Description: Name of the sample Amazon S3 bucket.
144+
BucketArn:
145+
Value: !GetAtt
146+
- S3bucket
147+
- Arn
148+
Description: Name of the Amazon S3 bucket
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
apiVersion: operator.aws/v1alpha1
2+
kind: CloudFormationTemplate
3+
metadata:
4+
name: sqsqueue
5+
data:
6+
key: sqsqueue.yaml
7+
template: |
8+
AWSTemplateFormatVersion: 2010-09-09
9+
Description: 'AWS Operator - Amazon DynamoDB'
10+
Parameters:
11+
Namespace:
12+
Description: >-
13+
This is the namespace for the Kubernetes object.
14+
Type: String
15+
ResourceVersion:
16+
Type: String
17+
Description: >-
18+
This is the resource version for the Kubernetes object.
19+
ResourceName:
20+
Description: >-
21+
This is the resource name for the Kubernetes object
22+
Type: String
23+
ClusterName:
24+
Description: >-
25+
This is the cluster name for the operator
26+
Type: String
27+
TableName:
28+
Description: >-
29+
Must contain only lowercase letters, numbers and hyphens.
30+
Type: String
31+
HashAttributeName:
32+
Type: String
33+
Description: Name of the Hash key
34+
HashAttributeType:
35+
Type: String
36+
AllowedValues:
37+
- S
38+
- N
39+
- B
40+
Default: "S"
41+
Description: AttributeType for Hash key
42+
RangeAttributeName:
43+
Type: String
44+
Description: Name of the Range key
45+
RangeAttributeType:
46+
Type: String
47+
AllowedValues:
48+
- S
49+
- N
50+
- B
51+
Default: "S"
52+
Description: AttributeType for the Range key
53+
ReadCapacityUnits:
54+
Type: String
55+
Description: Read ReadCapacity Units
56+
Default: "5"
57+
WriteCapacityUnits:
58+
Type: String
59+
Description: Write Capacity Units
60+
Default: "5"
61+
Resources:
62+
DynamoDBTable:
63+
Type: "AWS::DynamoDB::Table"
64+
Properties:
65+
TableName: !Ref TableName
66+
KeySchema:
67+
-
68+
AttributeName: !Ref HashAttributeName
69+
KeyType: "HASH"
70+
-
71+
AttributeName: !Ref RangeAttributeName
72+
KeyType: "RANGE"
73+
AttributeDefinitions:
74+
-
75+
AttributeName: !Ref HashAttributeName
76+
AttributeType: "S"
77+
-
78+
AttributeName: !Ref RangeAttributeName
79+
AttributeType: "S"
80+
ProvisionedThroughput:
81+
ReadCapacityUnits: !Ref ReadCapacityUnits
82+
WriteCapacityUnits: !Ref WriteCapacityUnits
83+
Tags:
84+
- Key: Namespace
85+
Value: !Ref Namespace
86+
- Key: ResourceVersion
87+
Value: !Ref ResourceVersion
88+
- Key: ResourceName
89+
Value: !Ref ResourceName
90+
- Key: ClusterName
91+
Value: !Ref ClusterName
92+
- Key: Heritage
93+
Value: operator.aws
94+
Outputs:
95+
TableName:
96+
Description: Name of the DynamoDB Table
97+
Value: !Ref DynamoDBTable
98+
TableArn:
99+
Description: Arn of the DynamoDB Table
100+
Value: !GetAtt DynamoDBTable.Arn

0 commit comments

Comments
 (0)