From 16d540668cb629d4ceb113ee00f098f5cde9936f Mon Sep 17 00:00:00 2001 From: Dan Pantry Date: Wed, 21 Feb 2024 17:45:01 -0800 Subject: [PATCH] Remove Terraform from this project We no longer produce Terraform in this repository, instead producing just artifacts - Docker images. Please feel free to deploy the Terraform as you see fit. --- .../modules/frontend/.terraform.lock.hcl | 25 ------- terraform/modules/frontend/bucket.tf | 45 ------------ terraform/modules/frontend/cloudfront.tf | 50 ------------- terraform/modules/frontend/outputs.tf | 3 - terraform/modules/frontend/variables.tf | 23 ------ terraform/modules/frontend/versions.tf | 9 --- terraform/modules/frontend/wafclassic.tf | 19 ----- .../modules/kitchensink/.terraform.lock.hcl | 25 ------- terraform/modules/kitchensink/iam.tf | 42 ----------- terraform/modules/kitchensink/main.tf | 61 ---------------- terraform/modules/kitchensink/outputs.tf | 7 -- terraform/modules/kitchensink/variables.tf | 71 ------------------- terraform/modules/kitchensink/versions.tf | 9 --- .../list_applications/.terraform.lock.hcl | 25 ------- terraform/modules/list_applications/lambda.tf | 20 ------ .../modules/list_applications/loadbalancer.tf | 32 --------- .../modules/list_applications/variables.tf | 28 -------- .../modules/list_applications/versions.tf | 9 --- .../modules/loadbalancer/.terraform.lock.hcl | 25 ------- .../modules/loadbalancer/loadbalancer.tf | 39 ---------- terraform/modules/loadbalancer/outputs.tf | 7 -- terraform/modules/loadbalancer/variables.tf | 11 --- terraform/modules/loadbalancer/versions.tf | 9 --- 23 files changed, 594 deletions(-) delete mode 100644 terraform/modules/frontend/.terraform.lock.hcl delete mode 100644 terraform/modules/frontend/bucket.tf delete mode 100644 terraform/modules/frontend/cloudfront.tf delete mode 100644 terraform/modules/frontend/outputs.tf delete mode 100644 terraform/modules/frontend/variables.tf delete mode 100644 terraform/modules/frontend/versions.tf delete mode 100644 terraform/modules/frontend/wafclassic.tf delete mode 100644 terraform/modules/kitchensink/.terraform.lock.hcl delete mode 100644 terraform/modules/kitchensink/iam.tf delete mode 100644 terraform/modules/kitchensink/main.tf delete mode 100644 terraform/modules/kitchensink/outputs.tf delete mode 100644 terraform/modules/kitchensink/variables.tf delete mode 100644 terraform/modules/kitchensink/versions.tf delete mode 100644 terraform/modules/list_applications/.terraform.lock.hcl delete mode 100644 terraform/modules/list_applications/lambda.tf delete mode 100644 terraform/modules/list_applications/loadbalancer.tf delete mode 100644 terraform/modules/list_applications/variables.tf delete mode 100644 terraform/modules/list_applications/versions.tf delete mode 100644 terraform/modules/loadbalancer/.terraform.lock.hcl delete mode 100644 terraform/modules/loadbalancer/loadbalancer.tf delete mode 100644 terraform/modules/loadbalancer/outputs.tf delete mode 100644 terraform/modules/loadbalancer/variables.tf delete mode 100644 terraform/modules/loadbalancer/versions.tf diff --git a/terraform/modules/frontend/.terraform.lock.hcl b/terraform/modules/frontend/.terraform.lock.hcl deleted file mode 100644 index ea5e241c..00000000 --- a/terraform/modules/frontend/.terraform.lock.hcl +++ /dev/null @@ -1,25 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/aws" { - version = "4.52.0" - constraints = "4.52.0" - hashes = [ - "h1:Ofm8syFCBU8MFOiU+zg+vnTWkSdozpmvaA9xukNvcBg=", - "zh:00c865de3a0e7643f4e2e5c8d4ba91eee94a46d41090eb134baca6b58c107172", - "zh:1430682e26eba25d8ace19fa780361187f474153e455545235b4fe30637fdcc2", - "zh:1b9a4e5c889bd2022bd59fb924dc78e189f1b7a4fd718fcacda0f0a4cb74d6eb", - "zh:2485260141608f1d386d0f68934092bbf68a27d96f0d83c73222d0382aee02f5", - "zh:2fe67ee94e2df7dabee7e474356f8e907e7c8011533f9d71df8702d59f9060b2", - "zh:37babd1b7ff96ff1f42aa56d7575cacabda6f9f460ff651d70662bfd90076341", - "zh:54aa8d39f22ecab6613169f49d37d2ccfaf417e59dd7a8c8fc6bf92600c3384f", - "zh:5bf4a84b962a8d2da8f4ccf2a7de56fb6c7a1f566e8393b563977fc7872a8740", - "zh:8cb4a51f209a3cc497e53f09188c15c6675697587fe2ea14a6c7fff10c8c8476", - "zh:91f6bdcbb1e36471140982e9048b7ced437d3290b2cc21079e5429cc84fed2fd", - "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:9f8c01c3f677bc64ddefa41e59c6fc98860c11875d7f148af55969d3e3847f77", - "zh:b6b4fc0bd6f3c0adcd9531da3ccf8c25787ccd6ccc568f13ebbff1336d71a9e1", - "zh:d52a428bd92cc319088685ecac63b9f7d12d4cd6725604edb20d0c4f37a9936e", - "zh:e20252a851a0d38548a3c01a006bfc59ee1fc84217bf9eb95b22724769601b2b", - ] -} diff --git a/terraform/modules/frontend/bucket.tf b/terraform/modules/frontend/bucket.tf deleted file mode 100644 index f04df9d5..00000000 --- a/terraform/modules/frontend/bucket.tf +++ /dev/null @@ -1,45 +0,0 @@ -resource "aws_s3_bucket" "keyconjurer_frontend" { - bucket = var.bucket_name -} - -data "aws_iam_policy_document" "frontend_bucket_policy" { - statement { - sid = "Cloudfront Access" - actions = ["s3:GetObject"] - resources = ["${aws_s3_bucket.keyconjurer_frontend.arn}/*"] - principals { - type = "CanonicalUser" - identifiers = [aws_cloudfront_origin_access_identity.keyconjurer_identity.s3_canonical_user_id] - } - } - - statement { - sid = "CI Upload" - actions = ["s3:PutObject"] - resources = ["${aws_s3_bucket.keyconjurer_frontend.arn}/*"] - principals { - type = "AWS" - identifiers = ["arn:aws:iam::${var.account_number}:role/infosec_ci"] - } - } -} - -resource "aws_s3_bucket_policy" "frontend_bucket" { - bucket = aws_s3_bucket.keyconjurer_frontend.bucket - policy = data.aws_iam_policy_document.frontend_bucket_policy.json -} - - -resource "aws_s3_bucket_acl" "frontend_bucket" { - bucket = aws_s3_bucket.keyconjurer_frontend.bucket - acl = "private" -} - -resource "aws_s3_bucket_server_side_encryption_configuration" "frontend_bucket" { - bucket = aws_s3_bucket.keyconjurer_frontend.bucket - rule { - apply_server_side_encryption_by_default { - sse_algorithm = "AES256" - } - } -} diff --git a/terraform/modules/frontend/cloudfront.tf b/terraform/modules/frontend/cloudfront.tf deleted file mode 100644 index 449fd130..00000000 --- a/terraform/modules/frontend/cloudfront.tf +++ /dev/null @@ -1,50 +0,0 @@ -resource "aws_cloudfront_origin_access_identity" "keyconjurer_identity" { - comment = "Key Conjurer bucket access" -} - -resource "aws_cloudfront_distribution" "keyconjurer_distribution" { - enabled = true - default_root_object = "index.html" - // US, Canada, Europe only - price_class = "PriceClass_100" - aliases = [var.domain] - - origin { - domain_name = aws_s3_bucket.keyconjurer_frontend.bucket_regional_domain_name - origin_id = "keyconjurer-origin" - - s3_origin_config { - origin_access_identity = aws_cloudfront_origin_access_identity.keyconjurer_identity.cloudfront_access_identity_path - } - } - - default_cache_behavior { - allowed_methods = ["GET", "HEAD"] - cached_methods = ["GET", "HEAD"] - default_ttl = 300 // 5 minutes - max_ttl = 300 // 5 minutes - target_origin_id = "keyconjurer-origin" - viewer_protocol_policy = "redirect-to-https" - - forwarded_values { - query_string = false - - cookies { - forward = "none" - } - } - } - - restrictions { - geo_restriction { - restriction_type = "none" - } - } - - viewer_certificate { - acm_certificate_arn = var.certificate_arn - ssl_support_method = "sni-only" - } - - web_acl_id = var.create_waf_acl ? aws_waf_web_acl.keyconjurer_waf_acl[0].id : var.waf_acl_id -} diff --git a/terraform/modules/frontend/outputs.tf b/terraform/modules/frontend/outputs.tf deleted file mode 100644 index e704f62c..00000000 --- a/terraform/modules/frontend/outputs.tf +++ /dev/null @@ -1,3 +0,0 @@ -output "domain_name" { - value = aws_cloudfront_distribution.keyconjurer_distribution.domain_name -} diff --git a/terraform/modules/frontend/variables.tf b/terraform/modules/frontend/variables.tf deleted file mode 100644 index ad78f0c8..00000000 --- a/terraform/modules/frontend/variables.tf +++ /dev/null @@ -1,23 +0,0 @@ -variable "create_waf_acl" { - type = bool -} - -variable "bucket_name" { - type = string -} - -variable "certificate_arn" { - type = string -} - -variable "domain" { - type = string -} - -variable "account_number" { - type = string -} - -variable "waf_acl_id" { - type = string -} diff --git a/terraform/modules/frontend/versions.tf b/terraform/modules/frontend/versions.tf deleted file mode 100644 index f5aca969..00000000 --- a/terraform/modules/frontend/versions.tf +++ /dev/null @@ -1,9 +0,0 @@ -terraform { - required_version = ">= 1.3.7" - required_providers { - aws = { - source = "hashicorp/aws" - version = "4.52.0" - } - } -} diff --git a/terraform/modules/frontend/wafclassic.tf b/terraform/modules/frontend/wafclassic.tf deleted file mode 100644 index a211776f..00000000 --- a/terraform/modules/frontend/wafclassic.tf +++ /dev/null @@ -1,19 +0,0 @@ -resource "aws_waf_ipset" "ipset" { - count = var.create_waf_acl == true ? 1 : 0 - name = "keyconjurer-tfIPSet" - - ip_set_descriptors { - type = "IPV4" - value = "127.0.0.1/32" - } -} - -resource "aws_waf_web_acl" "keyconjurer_waf_acl" { - count = var.create_waf_acl == true ? 1 : 0 - name = "KeyConjurerWAFWebACL" - metric_name = "KeyConjurerWAFWebACL" - - default_action { - type = "BLOCK" - } -} diff --git a/terraform/modules/kitchensink/.terraform.lock.hcl b/terraform/modules/kitchensink/.terraform.lock.hcl deleted file mode 100644 index ea5e241c..00000000 --- a/terraform/modules/kitchensink/.terraform.lock.hcl +++ /dev/null @@ -1,25 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/aws" { - version = "4.52.0" - constraints = "4.52.0" - hashes = [ - "h1:Ofm8syFCBU8MFOiU+zg+vnTWkSdozpmvaA9xukNvcBg=", - "zh:00c865de3a0e7643f4e2e5c8d4ba91eee94a46d41090eb134baca6b58c107172", - "zh:1430682e26eba25d8ace19fa780361187f474153e455545235b4fe30637fdcc2", - "zh:1b9a4e5c889bd2022bd59fb924dc78e189f1b7a4fd718fcacda0f0a4cb74d6eb", - "zh:2485260141608f1d386d0f68934092bbf68a27d96f0d83c73222d0382aee02f5", - "zh:2fe67ee94e2df7dabee7e474356f8e907e7c8011533f9d71df8702d59f9060b2", - "zh:37babd1b7ff96ff1f42aa56d7575cacabda6f9f460ff651d70662bfd90076341", - "zh:54aa8d39f22ecab6613169f49d37d2ccfaf417e59dd7a8c8fc6bf92600c3384f", - "zh:5bf4a84b962a8d2da8f4ccf2a7de56fb6c7a1f566e8393b563977fc7872a8740", - "zh:8cb4a51f209a3cc497e53f09188c15c6675697587fe2ea14a6c7fff10c8c8476", - "zh:91f6bdcbb1e36471140982e9048b7ced437d3290b2cc21079e5429cc84fed2fd", - "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:9f8c01c3f677bc64ddefa41e59c6fc98860c11875d7f148af55969d3e3847f77", - "zh:b6b4fc0bd6f3c0adcd9531da3ccf8c25787ccd6ccc568f13ebbff1336d71a9e1", - "zh:d52a428bd92cc319088685ecac63b9f7d12d4cd6725604edb20d0c4f37a9936e", - "zh:e20252a851a0d38548a3c01a006bfc59ee1fc84217bf9eb95b22724769601b2b", - ] -} diff --git a/terraform/modules/kitchensink/iam.tf b/terraform/modules/kitchensink/iam.tf deleted file mode 100644 index 48e800b9..00000000 --- a/terraform/modules/kitchensink/iam.tf +++ /dev/null @@ -1,42 +0,0 @@ -resource "aws_iam_role" "keyconjurer-lambda" { - name = var.lambda_execution_role_name - description = "Used by KeyConjurer Lambda functions to access protected resources" - assume_role_policy = <