Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zawac002 committed Sep 11, 2023
0 parents commit 5c9cdbc
Show file tree
Hide file tree
Showing 11 changed files with 634 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Local .terraform directories
**/.terraform/*

# terraform lock file.
**/.terraform.lock.hcl

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log
crash.*.log

# Exclude all .tfvars files, which are likely to contain sensitive data,
# such as password, private keys, and other secrets. These should not be
# part of version control as they are data points which are potentially
# sensitive and subject to change depending on the environment.
*.tfvars
*.tfvars.json

# Ignore override files as they are usually used to override resources
# locally and so are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

# Ignore CLI configuration files
.terraformrc
terraform.rc

# It's a module, shouldn't have a providers.tf
provider*.tf
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# tfmod-loki

Installs the loki as the log aggregation sink, and promtail to forward the logs
to loki.


# tfmod-loki
12 changes: 12 additions & 0 deletions aws_data.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

data "aws_caller_identity" "current" {}

data "aws_arn" "current" {
arn = data.aws_caller_identity.current.arn
}

data "aws_iam_openid_connect_provider" "openid" {
url = data.aws_eks_cluster.cluster.identity[0].oidc[0].issuer
}


65 changes: 65 additions & 0 deletions copy_images.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
locals {
loki_key = format("%v#%v", "grafana/loki", var.loki_tag)
kubectl_key = format("%v#%v", "grafana/kubectl", var.kubectl_image_tag)
provisioner_key = format("%v#%v", "grafana/enterprise-logs-provisioner", var.enterprise_logs_provisioner_tag)
gateway_key = format("%v#%v", "grafana/nginx-unprivileged", var.gateway_tag)

image_config = [
{
enabled = true
dest_path = null
name = "grafana/loki"
source_image = "grafana/loki"
source_registry = "docker.io"
source_tag = var.loki_tag
tag = var.loki_tag
},
{
enabled = true
dest_path = null
name = "grafana/kubectl"
source_image = "bitnami/kubectl"
source_registry = "docker.io"
source_tag = var.kubectl_image_tag
tag = var.kubectl_image_tag
},
{
enabled = true
dest_path = null
name = "grafana/enterprise-logs-provisioner"
source_image = "grafana/enterprise-logs-provisioner"
source_registry = "docker.io"
source_tag = var.enterprise_logs_provisioner_tag
tag = var.enterprise_logs_provisioner_tag
},
{
enabled = true
dest_path = null
name = "grafana/nginx-unprivileged"
source_image = "nginxinc/nginx-unprivileged"
source_registry = "docker.io"
source_tag = var.gateway_tag
tag = var.gateway_tag
},
]
}

module "images" {
source = "git@github.e.it.census.gov:terraform-modules/aws-ecr-copy-images.git/?ref=2.0.2"

profile = var.profile
application_name = var.cluster_name
image_config = local.image_config
tags = {}

### optional
## account_alias = ""
## account_id = ""
## destination_password = ""
## destination_username = ""
## override_prefixes = {}
## region = ""
## source_password = ""
## source_username = ""
}

Loading

0 comments on commit 5c9cdbc

Please sign in to comment.