From f8d38a75f5ac313626ba90bea211855f6645ffe3 Mon Sep 17 00:00:00 2001 From: xss Date: Mon, 23 Oct 2023 16:25:28 +1100 Subject: [PATCH] IAM cleanup --- es.tf | 265 ++++++++++++++++++++++------------------------- ham_aprs.tf | 58 ++++------- ham_ingestion.tf | 148 ++++++++++++-------------- ham_predictor.tf | 98 ++++++++---------- historic.tf | 171 ++++++++++++------------------ iam.tf | 19 ++++ ingestion.tf | 143 +++++++++++-------------- main.tf | 115 +++++++++----------- predictor.tf | 183 ++++++++++++++------------------ recovered.tf | 77 ++++++-------- sqs_to_elk.tf | 151 ++++++++++++--------------- websockets.tf | 237 +++++++++++++----------------------------- 12 files changed, 695 insertions(+), 970 deletions(-) create mode 100644 iam.tf diff --git a/es.tf b/es.tf index 130e149..7d71502 100644 --- a/es.tf +++ b/es.tf @@ -1,4 +1,14 @@ +data "aws_iam_policy_document" "es_access_policy" { + statement { + resources = ["arn:aws:es:us-east-1:${data.aws_caller_identity.current.account_id}:domain/sondes-v2*"] + actions = ["es:*"] + principals { + type = "AWS" + identifiers = ["*"] + } + } +} resource "aws_elasticsearch_domain" "ElasticsearchDomain" { domain_name = "sondes-v2-7-9" @@ -21,24 +31,12 @@ resource "aws_elasticsearch_domain" "ElasticsearchDomain" { enforce_https = true tls_security_policy = "Policy-Min-TLS-1-2-2019-07" custom_endpoint = "es.v2.sondehub.org" - custom_endpoint_certificate_arn = "arn:aws:acm:us-east-1:143841941773:certificate/a7da821c-bdbc-404b-aa12-bce28d86cdeb" + custom_endpoint_certificate_arn = "arn:aws:acm:us-east-1:${data.aws_caller_identity.current.account_id}:certificate/a7da821c-bdbc-404b-aa12-bce28d86cdeb" custom_endpoint_enabled = true } - access_policies = <