mirror of
https://github.com/Telecominfraproject/wlan-toolsmith.git
synced 2025-11-01 11:27:59 +00:00
[WIFI-10088] Research and install solution to keep coredumps for debugging purposes (#215)
* Add IAM user and bucket for core-dump-handler Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org> * Fix Terraform format Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org> * Add core-dumps-s3 to Atlantis Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org> * Remove outputs.tf and switch to separate S3 ACL resource Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org> * Fix Terraform state key name Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org> * Add core-dump-handler to helmfile Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org> * Commit helmfile.lock Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org> * Enable helmfile deployment of core-dump-handler Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
This commit is contained in:
59
terraform/wifi-289708231103/core-dumps-s3/main.tf
Normal file
59
terraform/wifi-289708231103/core-dumps-s3/main.tf
Normal file
@@ -0,0 +1,59 @@
|
||||
provider "aws" {
|
||||
region = var.aws_region
|
||||
}
|
||||
|
||||
terraform {
|
||||
required_version = ">= 1.0.0, < 2.0.0"
|
||||
|
||||
backend "s3" {
|
||||
region = "us-east-1"
|
||||
bucket = "tip-wifi-tfstate"
|
||||
key = "core-dumps-s3"
|
||||
dynamodb_table = "terraform-state-lock"
|
||||
encrypt = true
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
common_tags = {
|
||||
"ManagedBy" = "terraform"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket" "openwifi-core-dumps" {
|
||||
bucket = "openwifi-core-dumps"
|
||||
tags = local.common_tags
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket_acl" "openwifi-core-dumps" {
|
||||
bucket = aws_s3_bucket.openwifi-core-dumps.id
|
||||
acl = "private"
|
||||
}
|
||||
|
||||
resource "aws_iam_user" "openwifi-core-dump-handler" {
|
||||
name = "openwifi-core-dump-handler"
|
||||
tags = local.common_tags
|
||||
}
|
||||
|
||||
resource "aws_iam_access_key" "openwifi-core-dump-handler" {
|
||||
user = aws_iam_user.openwifi-core-dump-handler.name
|
||||
}
|
||||
|
||||
resource "aws_iam_user_policy" "openwifi-core-dump-handler" {
|
||||
name = "openwifi-core-dump-handler"
|
||||
user = aws_iam_user.openwifi-core-dump-handler.name
|
||||
|
||||
policy = jsonencode({
|
||||
"Version" : "2012-10-17",
|
||||
"Statement" : [
|
||||
{
|
||||
"Effect" : "Allow",
|
||||
"Action" : "s3:*",
|
||||
"Resource" : [
|
||||
aws_s3_bucket.openwifi-core-dumps.arn,
|
||||
"${aws_s3_bucket.openwifi-core-dumps.arn}/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
aws_region = "us-east-1"
|
||||
4
terraform/wifi-289708231103/core-dumps-s3/variables.tf
Normal file
4
terraform/wifi-289708231103/core-dumps-s3/variables.tf
Normal file
@@ -0,0 +1,4 @@
|
||||
variable "aws_region" {
|
||||
description = "AWS region"
|
||||
type = string
|
||||
}
|
||||
Reference in New Issue
Block a user