|
| 1 | +# terraform-aws-eks |
| 2 | +Terraform module for configuring Amazon EKS to integrate with [Expel Workbench](https://workbench.expel.io/). |
| 3 | + |
| 4 | +Configures a CloudWatch subscription filter to send data to a Kinesis data stream that |
| 5 | +[Expel Workbench](https://workbench.expel.io/) consumes. |
| 6 | + |
| 7 | +## Usage |
| 8 | +```hcl |
| 9 | +module "expel_aws_eks" { |
| 10 | + source = "expel-io/cloudtrail/eks" |
| 11 | + version = "1.1.0" |
| 12 | +
|
| 13 | + expel_customer_organization_guid = "Replace with your organization GUID from Expel Workbench" |
| 14 | + region = "AWS region in which Kinesis data stream will be created" |
| 15 | +} |
| 16 | +``` |
| 17 | +Once you have configured your AWS environment, go to |
| 18 | +https://workbench.expel.io/settings/security-devices?setupIntegration=aws and create an AWS EKS |
| 19 | +security device to enable Expel to begin monitoring your AWS environment. |
| 20 | + |
| 21 | +## Permissions |
| 22 | +The permissions allocated by this module allow Expel Workbench to perform investigations and get a broad understanding of your AWS footprint. |
| 23 | + |
| 24 | +## Limitations |
| 25 | +1. Only supports onboarding a single AWS account, not an entire AWS Organization. |
| 26 | +2. Will always create a new CloudWatch subscription filter (AWS has a limit of 2 subscription filters per CloudWatch log group) |
| 27 | +3. Will always create a new Kinesis data stream. |
| 28 | +4. Does not modify cluster configuration to grant Expel's IAM role read-only access (must be done separately) |
| 29 | + |
| 30 | +See Expel's Getting Started Guide for Amazon EKS for options if you |
| 31 | +have an AWS Organization or already have a Kinesis data stream you want to re-use. |
| 32 | + |
| 33 | +<!-- begin-tf-docs --> |
| 34 | +## Requirements |
| 35 | + |
| 36 | +| Name | Version | |
| 37 | +|------|---------| |
| 38 | +| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.1.0 | |
| 39 | +| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0.0 | |
| 40 | +## Providers |
| 41 | + |
| 42 | +| Name | Version | |
| 43 | +|------|---------| |
| 44 | +| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.9.0 | |
| 45 | +## Inputs |
| 46 | + |
| 47 | +| Name | Description | Type | Default | Required | |
| 48 | +|------|-------------|------|---------|:--------:| |
| 49 | +| <a name="input_eks_log_group_name"></a> [eks\_log\_group\_name](#input\_eks\_log\_group\_name) | The EKS log group name to integrate with Expel Workbench. | `string` | n/a | yes | |
| 50 | +| <a name="input_expel_customer_organization_guid"></a> [expel\_customer\_organization\_guid](#input\_expel\_customer\_organization\_guid) | Expel customer's organization GUID assigned to you by Expel. You can find it in your browser URL after navigating to Settings > My Organization in Workbench. | `string` | n/a | yes | |
| 51 | +| <a name="input_enable_stream_encryption"></a> [enable\_stream\_encryption](#input\_enable\_stream\_encryption) | Optionally encrypt data in the Kinesis stream with a Kinesis-owned KMS key. | `bool` | `true` | no | |
| 52 | +| <a name="input_expel_assume_role_session_name"></a> [expel\_assume\_role\_session\_name](#input\_expel\_assume\_role\_session\_name) | The session name Expel will use when authenticating. | `string` | `"ExpelEKSServiceSession"` | no | |
| 53 | +| <a name="input_expel_aws_account_arn"></a> [expel\_aws\_account\_arn](#input\_expel\_aws\_account\_arn) | Expel's AWS Account ARN to allow assuming role to gain EKS access. | `string` | `"arn:aws:iam::012205512454:user/ExpelCloudService"` | no | |
| 54 | +| <a name="input_prefix"></a> [prefix](#input\_prefix) | A prefix to group all Expel integration resources. | `string` | `"expel-aws-eks"` | no | |
| 55 | +| <a name="input_stream_capacity_mode"></a> [stream\_capacity\_mode](#input\_stream\_capacity\_mode) | The data stream capacity mode: ON\_DEMAND (recommended) or PROVISIONED. See: https://docs.aws.amazon.com/streams/latest/dev/how-do-i-size-a-stream.html | `string` | `"ON_DEMAND"` | no | |
| 56 | +| <a name="input_stream_retention_hours"></a> [stream\_retention\_hours](#input\_stream\_retention\_hours) | The number of hours data will be retained in the stream. See: https://docs.aws.amazon.com/streams/latest/dev/kinesis-extended-retention.html | `number` | `1` | no | |
| 57 | +| <a name="input_stream_shard_count"></a> [stream\_shard\_count](#input\_stream\_shard\_count) | The number of shards for the Kinesis stream. Only required if `stream_capacity_mode` is `PROVISIONED`. See: https://docs.aws.amazon.com/streams/latest/dev/how-do-i-size-a-stream.html | `number` | `null` | no | |
| 58 | +| <a name="input_tags"></a> [tags](#input\_tags) | A set of tags to group resources. | `map` | `{}` | no | |
| 59 | +## Outputs |
| 60 | + |
| 61 | +| Name | Description | |
| 62 | +|------|-------------| |
| 63 | +| <a name="output_aws_region"></a> [aws\_region](#output\_aws\_region) | The AWS Region where the Kinesis resources exist | |
| 64 | +| <a name="output_kinesis_stream_name"></a> [kinesis\_stream\_name](#output\_kinesis\_stream\_name) | Name of the Kinesis data stream Expel will consume from | |
| 65 | +| <a name="output_role_arn"></a> [role\_arn](#output\_role\_arn) | IAM Role ARN of the role for Expel to assume to access Kinesis data | |
| 66 | +| <a name="output_role_session_name"></a> [role\_session\_name](#output\_role\_session\_name) | The session name Expel will use when authenticating | |
| 67 | +## Resources |
| 68 | + |
| 69 | +| Name | Type | |
| 70 | +|------|------| |
| 71 | +| [aws_cloudwatch_log_subscription_filter.eks_subscription_filter](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_subscription_filter) | resource | |
| 72 | +| [aws_iam_policy.eks_consumer_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | |
| 73 | +| [aws_iam_policy.eks_producer_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | |
| 74 | +| [aws_iam_role.cloudwatch_assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | |
| 75 | +| [aws_iam_role.expel_assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | |
| 76 | +| [aws_iam_role_policy_attachment.eks_consumer_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | |
| 77 | +| [aws_iam_role_policy_attachment.eks_producer_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | |
| 78 | +| [aws_kinesis_stream.kinesis_data_stream](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kinesis_stream) | resource | |
| 79 | +| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source | |
| 80 | +| [aws_iam_policy_document.assume_role_iam_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | |
| 81 | +| [aws_iam_policy_document.cloudwatch_assume_role_iam_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | |
| 82 | +| [aws_iam_policy_document.eks_consumer_iam_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | |
| 83 | +| [aws_iam_policy_document.eks_producer_iam_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | |
| 84 | +| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source | |
| 85 | +<!-- end-tf-docs --> |
0 commit comments