Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ackeecz/terraform-aws-fargate-logs
Terraform module for setting up EKS Fargate logging to AWS Cloudwatch
https://github.com/ackeecz/terraform-aws-fargate-logs
aws eks fluentd terraform
Last synced: 2 months ago
JSON representation
Terraform module for setting up EKS Fargate logging to AWS Cloudwatch
- Host: GitHub
- URL: https://github.com/ackeecz/terraform-aws-fargate-logs
- Owner: AckeeCZ
- Created: 2021-03-08T16:25:45.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-08T17:40:39.000Z (almost 4 years ago)
- Last Synced: 2024-04-15T00:06:29.012Z (9 months ago)
- Topics: aws, eks, fluentd, terraform
- Language: HCL
- Homepage:
- Size: 2.93 KB
- Stars: 4
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Terraform AWS Fargate logging to CloudWatch
In case you'd like to log from your Fargate pods directly to CloudWatch, use this module. It's an implementation of
this article https://docs.aws.amazon.com/eks/latest/userguide/fargate-logging.htmlThis setup is used for JSON logs, in case your application does not logging in JSON, adjust the `parsers.conf` file.
## Before you do anything in this module
Install pre-commit hooks by running following commands:
```shell script
brew install pre-commit terraform-docs
pre-commit install
```## Terragrunt snippet
In case you would like to use the module in Terragrunt setup, don't forget to initialize with correct providers:
```hcl
# setup local variables, this part is omitted
# ...
# ...dependency "eks" {
config_path = "../eks/" # eks module from git::[email protected]:terraform-aws-modules/terraform-aws-eks.git?ref=v14.0.0
}terraform {
source = ".//eks-fargate-logging" # use public terraform registry
}include {
path = find_in_parent_folders()
}
inputs = {
project = "fabulous-project"
fargate_role_name = dependency.eks.outputs.fargate_iam_role_name
region = local.region_vars.locals.aws_region
}generate "k8s_provider" {
path = "providers.tf"
if_exists = "overwrite_terragrunt"
contents = <
## Requirements| Name | Version |
|------|---------|
| aws | 3.27.0 |
| kubernetes | 2.0.2 |## Providers
| Name | Version |
|------|---------|
| aws | 3.27.0 |
| kubernetes | 2.0.2 |## Modules
No Modules.
## Resources
| Name |
|------|
| [aws_iam_policy](https://registry.terraform.io/providers/hashicorp/aws/3.27.0/docs/resources/iam_policy) |
| [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/3.27.0/docs/data-sources/iam_policy_document) |
| [aws_iam_role_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/3.27.0/docs/resources/iam_role_policy_attachment) |
| [kubernetes_config_map](https://registry.terraform.io/providers/hashicorp/kubernetes/2.0.2/docs/resources/config_map) |
| [kubernetes_namespace](https://registry.terraform.io/providers/hashicorp/kubernetes/2.0.2/docs/resources/namespace) |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| fargate\_role\_name | Role name assigned to fargate pod runtime, used here to enable access to CloudWatch logging | `any` | n/a | yes |
| project | Project name, e.g. customer-portal, used for cloudwatch entities names | `any` | n/a | yes |
| region | AWS region where EKS is running | `any` | n/a | yes |## Outputs
No output.