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

Commit

Permalink
Merge pull request #48 from christopherhein/feature/47-additional-ser…
Browse files Browse the repository at this point in the history
…vices

Adding S3 Bucket Service Using ExternalName
  • Loading branch information
Christopher Hein committed Aug 22, 2018
2 parents c6a8e67 + 4f40351 commit 79aefff
Show file tree
Hide file tree
Showing 8 changed files with 418 additions and 9 deletions.
93 changes: 93 additions & 0 deletions cloudformation/dynamodb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
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
141 changes: 141 additions & 0 deletions cloudformation/s3bucket.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
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
31 changes: 31 additions & 0 deletions cloudformation/snstopic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
AWSTemplateFormatVersion: 2010-09-09
Description: 'AWS Service Broker - Amazon SNS (qs-1nt0fs93c)'
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
DisplayName:
Type: String
Description: >-
What should the SNS Topics name display as.
Resources:
SNSTopic:
Type: 'AWS::SNS::Topic'

Outputs:
TopicName:
Value: !Ref SNSTopic
Description: Name of the topic
Loading

0 comments on commit 79aefff

Please sign in to comment.