Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarl committed May 21, 2019
1 parent 81b077d commit 51fc264
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 8 deletions.
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Kinesis Firehose - Elasticsearch Terraform Module

Kinesis Firehose - Elasticsearch Terraform Module provision an Amazon Elasticsearch Service and a Kinesis Foirehose delivery stream that load streaming data into Amazon S3 and Amazon Elasticsearch Service.

## Module

The module will create a Kinesis Foirehose delivery stream and an Amazon Elasticsearch Service. Additionally it will create one S3 bucket for the compressed json logs and configure Kinesis Firehose to load the streaming data into the S3 bucket and into the Elasticsearch cluster. All IAM roles and access policies will be configured in order to work.

### Input Variables

The following table list the configurable parameters and their default values.

| Name | Description | Default |
| --- | --- | --- |
| region | AWS Region | eu-west-1 |
| es_name | Domain name for Elasticsearch | cxcloud |
| es_ver | Elasticsearch Version | 6.5 |
| es_instance_type | Instance type for Elasticsearch | t2.small.elasticsearch |
| es_instance_count | Amount of Elasticsearch nodes | 1 |
| es_dedicated_master_enabled | Use dedicated master | false |
| es_ebs_size | Size of EBS volume per instance | 35 |
| es_snapshot_start_hour | Start time of snapshot | 23 |
| es_name_tag | Name tag | cxcloud |
| es_whitelisted_ips | Whitelisted IPs to access ES | [] |
| stream_name | Kinesis Firehose Stream Name | cxcloud |
| s3_bucket | S3 bucket name for logs | "" |
| s3_buffer_size | S3 Buffer Size | 10 |
| s3_buffer_interval | S3 buffer interval | 60 |
| s3_compression_format | S3 log compression format | GZIP |
| es_index_name | Elasticsearch index name | cxcloud |
| es_type_name | Elasticsearch index type | logs |
| es_buffering_size | Elasticsearch buffering size | 10 |
| es_buffering_interval | Elasticsearch buffering interval | 60 |
| s3_backup_mode | S3 backup mode | AllDocuments |
| whitelisted_aws_account_arns | Whitelisted AWS ARNs to assume role for Kinesis Firehose access | [] |

### Output Variables

The following table list the output variables

| Name | Description |
| --- | --- |
| es_arn | Elasticsearch AWS ARN |
| endpoint | Elasticsearch Endpoint |
| domain_id | Elasticsearch domain id |
| domain_name | Elasticsearch Domain Name |
| kinesis_arn | Kineses Firehose Stream ARN |

### Example

The following example show how the module can be used. In this example release 1.0.0 is used.

```console
module "kinesis-firehose-elasticsearch" {
source = "github.com/cxcloud/terraform-kinesis-firehose-elasticsearch?ref=1.0.0"
region = "eu-west-1"
es_name = "cxcloud"
es_ver = 6.5
es_instance_type = "t2.small.elasticsearch"
es_instance_count = 1
es_dedicated_master_enabled = false
es_ebs_size = 35
es_snapshot_start_hour = 23
es_name_tag = "CX Cloud"
es_whitelisted_ips = ["34.240.135.89/32"]
stream_name = "cxcloud"
s3_bucket = "sandbox-logging"
s3_buffer_size = 10
s3_buffer_interval = 60
s3_compression_format = "GZIP"
es_index_name = "cxcloud"
es_type_name = "logs"
es_buffering_size = 10
es_buffering_interval = 60
s3_backup_mode = "AllDocuments"
whitelisted_aws_account_arns = ["arn:aws:iam::012345678901:root"]
}
```
8 changes: 4 additions & 4 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
output "es_arn" {
description = "ES ARN"
description = "Elasticsearch ARN"
value = "${module.es.arn}"
}

output "endpoint" {
description = "ES Endpoint"
description = "Elasticsearch Endpoint"
value = "${module.es.endpoint}"
}

output "domain_id" {
description = "ES ARN"
description = "Elasticsearch Domain ID"
value = "${module.es.domain_id}"
}

output "domain_name" {
description = "ES ARN"
description = "Elasticsearch Domain Name"
value = "${module.es.domain_name}"
}

Expand Down
12 changes: 8 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,32 @@
variable "region" {
type = "string"
description = "AWS Region"
default = "eu-west-1"
}

# Elasticsearch variables

variable "es_name" {
type = "string"
description = "Domain name for Elasticsearch"
description = "Cluster name for Elasticsearch"
default = "cxcloud"
}

variable "es_ver" {
type = "string"
description = "Elasticsearch Version"
description = "Elasticsearch version"
default = 6.5
}

variable "es_instance_type" {
type = "string"
description = "Instance type for ES"
description = "Instance type for Elasticsearch"
default = "t2.small.elasticsearch"
}

variable "es_instance_count" {
type = "string"
description = "Amount of ES nodes"
description = "Amount of Elasticsearch nodes"
default = 1
}

Expand All @@ -39,6 +41,7 @@ variable "es_dedicated_master_enabled" {
variable "es_ebs_size" {
type = "string"
description = "Size of EBS volume per instance"
default = 35
}

variable "es_snapshot_start_hour" {
Expand All @@ -56,6 +59,7 @@ variable "es_name_tag" {
variable "es_whitelisted_ips" {
type = "list"
description = "Whitelisted IPs to access ES"
default = []
}

# Kinesis Firehose variables
Expand Down

0 comments on commit 51fc264

Please sign in to comment.