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

Commit

Permalink
Adding The CFT Resource Objects
Browse files Browse the repository at this point in the history
**Why:**

* These are the files that generate the code gened libraries

**This change addresses the need by:**

* closes #8
  • Loading branch information
christopherhein committed Aug 2, 2018
1 parent 42443f1 commit 2a1bece
Show file tree
Hide file tree
Showing 4 changed files with 398 additions and 0 deletions.
100 changes: 100 additions & 0 deletions examples/cloudformationtemplates/dynamodb.yaml
@@ -0,0 +1,100 @@
apiVersion: operator.aws/v1alpha1
kind: CloudFormationTemplate
metadata:
name: dynamodb
data:
key: dynamodb.yaml
template: |
AWSTemplateFormatVersion: 2010-09-09
Description: 'AWS Operator - Amazon DynamoDB'
Parameters:
Namespace:
Description: >-
This is the namespace for the Kubernetes object.
Type: String
ResourceVersion:
Type: String
Description: >-
This is the resource version for the Kubernetes object.
ResourceName:
Description: >-
This is the resource name for the Kubernetes object
Type: String
ClusterName:
Description: >-
This is the cluster name for the operator
Type: String
TableName:
Description: >-
Must contain only lowercase letters, numbers and hyphens.
Type: String
HashAttributeName:
Type: String
Description: Name of the Hash key
HashAttributeType:
Type: String
AllowedValues:
- S
- N
- B
Default: "S"
Description: AttributeType for Hash key
RangeAttributeName:
Type: String
Description: Name of the Range key
RangeAttributeType:
Type: String
AllowedValues:
- S
- N
- B
Default: "S"
Description: AttributeType for the Range key
ReadCapacityUnits:
Type: String
Description: Read ReadCapacity Units
Default: "5"
WriteCapacityUnits:
Type: String
Description: Write Capacity Units
Default: "5"
Resources:
DynamoDBTable:
Type: "AWS::DynamoDB::Table"
Properties:
TableName: !Ref TableName
KeySchema:
-
AttributeName: !Ref HashAttributeName
KeyType: "HASH"
-
AttributeName: !Ref RangeAttributeName
KeyType: "RANGE"
AttributeDefinitions:
-
AttributeName: !Ref HashAttributeName
AttributeType: "S"
-
AttributeName: !Ref RangeAttributeName
AttributeType: "S"
ProvisionedThroughput:
ReadCapacityUnits: !Ref ReadCapacityUnits
WriteCapacityUnits: !Ref WriteCapacityUnits
Tags:
- Key: Namespace
Value: !Ref Namespace
- Key: ResourceVersion
Value: !Ref ResourceVersion
- Key: ResourceName
Value: !Ref ResourceName
- Key: ClusterName
Value: !Ref ClusterName
- Key: Heritage
Value: operator.aws
Outputs:
TableName:
Description: Name of the DynamoDB Table
Value: !Ref DynamoDBTable
TableArn:
Description: Arn of the DynamoDB Table
Value: !GetAtt DynamoDBTable.Arn
148 changes: 148 additions & 0 deletions examples/cloudformationtemplates/s3bucket.yaml
@@ -0,0 +1,148 @@
apiVersion: operator.aws/v1alpha1
kind: CloudFormationTemplate
metadata:
name: s3bucket
data:
key: s3bucket.yaml
template: |
AWSTemplateFormatVersion: 2010-09-09
Description: 'AWS Operator - Amazon S3 Bucket'
Parameters:
Namespace:
Description: >-
This is the namespace for the Kubernetes object.
Type: String
ResourceVersion:
Type: String
Description: >-
This is the resource version for the Kubernetes object.
ResourceName:
Description: >-
This is the resource name for the Kubernetes object
Type: String
ClusterName:
Description: >-
This is the cluster name for the operator
Type: String
BucketName:
Description: >-
Must contain only lowercase letters, numbers, periods (.), and hyphens
(-),Cannot end in numbers
Type: String
Default: apps3bucket
LoggingPrefix:
Description: >-
Must contain only lowercase letters, numbers, periods (.), and hyphens
(-),Cannot end in numbers
Type: String
Default: Archive
EnableLogging:
Description: enable or discable S3 logging
Type: String
AllowedValues:
- 'true'
- 'false'
Default: 'true'
EnableGlacierLifeCycle:
Description: enable archiving to Glacier Storage
Type: String
AllowedValues:
- 'true'
- 'false'
Default: 'false'
GlacierLifeCycleTransitionInDays:
Description: Define how many days objects should exist before being moved to Glacier
Type: String
Default: '0'
EnableVersioning:
Description: enable versioning
Type: String
AllowedValues:
- 'true'
- 'false'
Default: 'false'
LifeCyclePrefix:
Description: >-
Must contain only lowercase letters, numbers, periods (.), and hyphens
(-),Cannot end in numbers
Type: String
Default: Archive
BucketAccessControl:
Description: define if the bucket can be accessed from public or private locations
Type: String
AllowedValues:
- Private
- PublicRead
- PublicReadWrite
- AuthenticatedRead
- LogDeliveryWrite
- BucketOwnerRead
- BucketOwnerFullControl
- AwsExecRead
Default: "Private"
Mappings: {}
Conditions:
UseLogging: !Equals
- !Ref EnableLogging
- 'true'
UseGlacierLifeCycle: !Equals
- !Ref EnableGlacierLifeCycle
- 'true'
UseVersioning: !Equals
- !Ref EnableVersioning
- 'true'
Resources:
S3bucket:
Type: 'AWS::S3::Bucket'
Properties:
BucketName: !Ref BucketName
AccessControl: !Ref BucketAccessControl
LifecycleConfiguration:
Rules:
- Id: GlacierRule
Prefix: !Ref LifeCyclePrefix
Status: Enabled
ExpirationInDays: '365'
Transitions:
- TransitionInDays: !Ref GlacierLifeCycleTransitionInDays
StorageClass: Glacier
LoggingConfiguration: !If
- UseLogging
- DestinationBucketName: !Ref LoggingBucket
LogFilePrefix: !Ref LoggingPrefix
- !Ref 'AWS::NoValue'
Tags:
- Key: Namespace
Value: !Ref Namespace
- Key: ResourceVersion
Value: !Ref ResourceVersion
- Key: ResourceName
Value: !Ref ResourceName
- Key: ClusterName
Value: !Ref ClusterName
- Key: Heritage
Value: operator.aws
VersioningConfiguration: !If
- UseVersioning
- Status: Enabled
- !Ref 'AWS::NoValue'
DeletionPolicy: Retain
LoggingBucket:
Condition: UseLogging
Type: 'AWS::S3::Bucket'
DeletionPolicy: Retain
Properties:
AccessControl: LogDeliveryWrite
BucketName: !Join
- ''
- - !Ref BucketName
- logging
Outputs:
BucketName:
Value: !Ref S3bucket
Description: Name of the sample Amazon S3 bucket.
BucketArn:
Value: !GetAtt
- S3bucket
- Arn
Description: Name of the Amazon S3 bucket
100 changes: 100 additions & 0 deletions examples/cloudformationtemplates/sqsqueue.yaml
@@ -0,0 +1,100 @@
apiVersion: operator.aws/v1alpha1
kind: CloudFormationTemplate
metadata:
name: sqsqueue
data:
key: sqsqueue.yaml
template: |
AWSTemplateFormatVersion: 2010-09-09
Description: 'AWS Operator - Amazon DynamoDB'
Parameters:
Namespace:
Description: >-
This is the namespace for the Kubernetes object.
Type: String
ResourceVersion:
Type: String
Description: >-
This is the resource version for the Kubernetes object.
ResourceName:
Description: >-
This is the resource name for the Kubernetes object
Type: String
ClusterName:
Description: >-
This is the cluster name for the operator
Type: String
TableName:
Description: >-
Must contain only lowercase letters, numbers and hyphens.
Type: String
HashAttributeName:
Type: String
Description: Name of the Hash key
HashAttributeType:
Type: String
AllowedValues:
- S
- N
- B
Default: "S"
Description: AttributeType for Hash key
RangeAttributeName:
Type: String
Description: Name of the Range key
RangeAttributeType:
Type: String
AllowedValues:
- S
- N
- B
Default: "S"
Description: AttributeType for the Range key
ReadCapacityUnits:
Type: String
Description: Read ReadCapacity Units
Default: "5"
WriteCapacityUnits:
Type: String
Description: Write Capacity Units
Default: "5"
Resources:
DynamoDBTable:
Type: "AWS::DynamoDB::Table"
Properties:
TableName: !Ref TableName
KeySchema:
-
AttributeName: !Ref HashAttributeName
KeyType: "HASH"
-
AttributeName: !Ref RangeAttributeName
KeyType: "RANGE"
AttributeDefinitions:
-
AttributeName: !Ref HashAttributeName
AttributeType: "S"
-
AttributeName: !Ref RangeAttributeName
AttributeType: "S"
ProvisionedThroughput:
ReadCapacityUnits: !Ref ReadCapacityUnits
WriteCapacityUnits: !Ref WriteCapacityUnits
Tags:
- Key: Namespace
Value: !Ref Namespace
- Key: ResourceVersion
Value: !Ref ResourceVersion
- Key: ResourceName
Value: !Ref ResourceName
- Key: ClusterName
Value: !Ref ClusterName
- Key: Heritage
Value: operator.aws
Outputs:
TableName:
Description: Name of the DynamoDB Table
Value: !Ref DynamoDBTable
TableArn:
Description: Arn of the DynamoDB Table
Value: !GetAtt DynamoDBTable.Arn

0 comments on commit 2a1bece

Please sign in to comment.