From b5d64b0af4978998565cee420f6fc07dc2bb8ed9 Mon Sep 17 00:00:00 2001 From: xpk Date: Mon, 5 Sep 2022 14:04:45 +0800 Subject: [PATCH] DEL: deleted old example code --- .../.terraform.lock.hcl | 20 ---------- .../cloudtrail_cloudwatchlogs/main.tf | 12 ------ .../cloudtrail_cloudwatchlogs/provider.tf | 13 ------- .../terraform.tfvars | 6 --- .../cloudtrail_cloudwatchlogs/variables.tf | 22 ----------- .../iam_roles/.terraform.lock.hcl | 20 ---------- .../iam_roles/main.tf | 14 ------- .../iam_roles/provider.tf | 13 ------- .../iam_roles/terraform.tfvars | 6 --- .../iam_roles/variables.tf | 22 ----------- .../security_services/.terraform.lock.hcl | 37 ------------------- .../security_services/aws-config.tf | 16 -------- .../security_services/guardduty.tf | 13 ------- .../security_services/main.tf | 1 - .../security_services/provider.tf | 13 ------- .../security_services/terraform.tfvars | 6 --- .../security_services/variables.tf | 22 ----------- 17 files changed, 256 deletions(-) delete mode 100644 layers/security_identity_compliance/cloudtrail_cloudwatchlogs/.terraform.lock.hcl delete mode 100644 layers/security_identity_compliance/cloudtrail_cloudwatchlogs/main.tf delete mode 100644 layers/security_identity_compliance/cloudtrail_cloudwatchlogs/provider.tf delete mode 100644 layers/security_identity_compliance/cloudtrail_cloudwatchlogs/terraform.tfvars delete mode 100644 layers/security_identity_compliance/cloudtrail_cloudwatchlogs/variables.tf delete mode 100644 layers/security_identity_compliance/iam_roles/.terraform.lock.hcl delete mode 100644 layers/security_identity_compliance/iam_roles/main.tf delete mode 100644 layers/security_identity_compliance/iam_roles/provider.tf delete mode 100644 layers/security_identity_compliance/iam_roles/terraform.tfvars delete mode 100644 layers/security_identity_compliance/iam_roles/variables.tf delete mode 100644 layers/security_identity_compliance/security_services/.terraform.lock.hcl delete mode 100644 layers/security_identity_compliance/security_services/aws-config.tf delete mode 100644 layers/security_identity_compliance/security_services/guardduty.tf delete mode 100644 layers/security_identity_compliance/security_services/main.tf delete mode 100644 layers/security_identity_compliance/security_services/provider.tf delete mode 100644 layers/security_identity_compliance/security_services/terraform.tfvars delete mode 100644 layers/security_identity_compliance/security_services/variables.tf diff --git a/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/.terraform.lock.hcl b/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/.terraform.lock.hcl deleted file mode 100644 index eda0e78..0000000 --- a/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/.terraform.lock.hcl +++ /dev/null @@ -1,20 +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 = "3.25.0" - constraints = ">= 3.25.0" - hashes = [ - "h1:9bXU5cFO/2DX8z5whaGMA7wcCalKQJZrBm89AuePuEM=", - "zh:2d3c65461bc63ec39bce7b5afdbed9a3b4dd5c2c8ee94616ad1866e24cf9b8f0", - "zh:2fb2ea6ccac30b909b603e183433737a30c58ec1f9a6a8b5565f0f051490c07a", - "zh:31a5f192c8cf29fb677cd639824f9a685578a2564c6b790517db33ea56229045", - "zh:437a12cf9a4d7bc92c9bf14ee7e224d5d3545cbd2154ba113ae82c4bb68edc27", - "zh:4bbdc3155a5dea90b2d50adfa460b0759c4dd959efaf7f66b2a0385a53b469b2", - "zh:63a8cd523ba31358692a34a06e111d88769576ac6d0e5adad8e0b4ae0a2d8882", - "zh:c4301ce86e8cb2c464949bb99e729ffe7b0c55eaf34b82ba526bb5039bca36f3", - "zh:c97b84861c6c550b8d2feb12d089660fffbf51dc7d660dcc9d54d4a7b3c2c882", - "zh:d6a103570e2d5c387b068fac4b88654dfa21d44ca1bdfa4bc8ab94c88effd71a", - "zh:f08cf2faf960a8ca374ac860f37c31c88ed2bab460116ac74678e0591babaac5", - ] -} diff --git a/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/main.tf b/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/main.tf deleted file mode 100644 index f8a0556..0000000 --- a/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/main.tf +++ /dev/null @@ -1,12 +0,0 @@ -data aws_caller_identity this {} - -module cloudtrail-cwl { - source = "../../../modules/security_identity_compliance/cloudtrail_cwlogs" - application = var.application - environment = var.environment - customer-name = var.customer-name - project = var.project - aws-region-short = var.aws-region-short - default-tags = local.default-tags - cloudtrail-retain-days = 90 -} \ No newline at end of file diff --git a/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/provider.tf b/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/provider.tf deleted file mode 100644 index 4e906ad..0000000 --- a/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/provider.tf +++ /dev/null @@ -1,13 +0,0 @@ -provider "aws" { - region = var.aws-region -} - -terraform { - required_version = ">= 0.14" - required_providers { - aws = { - source = "hashicorp/aws" - version = ">= 3.25" - } - } -} \ No newline at end of file diff --git a/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/terraform.tfvars b/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/terraform.tfvars deleted file mode 100644 index 9f12b0d..0000000 --- a/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/terraform.tfvars +++ /dev/null @@ -1,6 +0,0 @@ -aws-region = "ap-northeast-1" -aws-region-short = "apne1" -customer-name = "racken" -environment = "lab" -project = "cleanslate" -application = "infra" \ No newline at end of file diff --git a/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/variables.tf b/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/variables.tf deleted file mode 100644 index b705e28..0000000 --- a/layers/security_identity_compliance/cloudtrail_cloudwatchlogs/variables.tf +++ /dev/null @@ -1,22 +0,0 @@ -variable "aws-region" {} -variable "aws-region-short" {} -variable "customer-name" {} -variable "environment" {} -variable "project" {} -variable "application" {} - -locals { - default-tags = { - ServiceProvider = "RackspaceTechnology" - Environment = var.environment - Project = var.project - Application = var.application - TerraformMode = "managed" - TerraformDir = trimprefix(path.cwd, "/my/work/xpk-git/") - CreatedBy = data.aws_caller_identity.this.arn - BuildDate = formatdate("YYYYMMDD", timestamp()) - } - ct-bucket-name = "${var.environment}-${var.aws-region-short}-${var.customer-name}-${var.project}-ctbucket-${data.aws_caller_identity.this.account_id}" - resource-prefix = "${var.environment}-${var.aws-region-short}-${var.customer-name}-${var.project}" -} - diff --git a/layers/security_identity_compliance/iam_roles/.terraform.lock.hcl b/layers/security_identity_compliance/iam_roles/.terraform.lock.hcl deleted file mode 100644 index eda0e78..0000000 --- a/layers/security_identity_compliance/iam_roles/.terraform.lock.hcl +++ /dev/null @@ -1,20 +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 = "3.25.0" - constraints = ">= 3.25.0" - hashes = [ - "h1:9bXU5cFO/2DX8z5whaGMA7wcCalKQJZrBm89AuePuEM=", - "zh:2d3c65461bc63ec39bce7b5afdbed9a3b4dd5c2c8ee94616ad1866e24cf9b8f0", - "zh:2fb2ea6ccac30b909b603e183433737a30c58ec1f9a6a8b5565f0f051490c07a", - "zh:31a5f192c8cf29fb677cd639824f9a685578a2564c6b790517db33ea56229045", - "zh:437a12cf9a4d7bc92c9bf14ee7e224d5d3545cbd2154ba113ae82c4bb68edc27", - "zh:4bbdc3155a5dea90b2d50adfa460b0759c4dd959efaf7f66b2a0385a53b469b2", - "zh:63a8cd523ba31358692a34a06e111d88769576ac6d0e5adad8e0b4ae0a2d8882", - "zh:c4301ce86e8cb2c464949bb99e729ffe7b0c55eaf34b82ba526bb5039bca36f3", - "zh:c97b84861c6c550b8d2feb12d089660fffbf51dc7d660dcc9d54d4a7b3c2c882", - "zh:d6a103570e2d5c387b068fac4b88654dfa21d44ca1bdfa4bc8ab94c88effd71a", - "zh:f08cf2faf960a8ca374ac860f37c31c88ed2bab460116ac74678e0591babaac5", - ] -} diff --git a/layers/security_identity_compliance/iam_roles/main.tf b/layers/security_identity_compliance/iam_roles/main.tf deleted file mode 100644 index e259f9e..0000000 --- a/layers/security_identity_compliance/iam_roles/main.tf +++ /dev/null @@ -1,14 +0,0 @@ -data aws_caller_identity this {} - -module iam-module { - source = "../../../modules/security_identity_compliance/roles_iam_resources" - application = var.application - environment = var.environment - customer-name = var.customer-name - project = var.project - aws-region-short = var.aws-region-short - default-tags = local.default-tags - create-cloudhealth-resources = false - cloudheath-ext-id1 = "87adcc8d76e0bc18ac67e1c4a7acbc" - cloudheath-ext-id2 = "68c32aa2f429c59528ae79c713159f" -} \ No newline at end of file diff --git a/layers/security_identity_compliance/iam_roles/provider.tf b/layers/security_identity_compliance/iam_roles/provider.tf deleted file mode 100644 index 4e906ad..0000000 --- a/layers/security_identity_compliance/iam_roles/provider.tf +++ /dev/null @@ -1,13 +0,0 @@ -provider "aws" { - region = var.aws-region -} - -terraform { - required_version = ">= 0.14" - required_providers { - aws = { - source = "hashicorp/aws" - version = ">= 3.25" - } - } -} \ No newline at end of file diff --git a/layers/security_identity_compliance/iam_roles/terraform.tfvars b/layers/security_identity_compliance/iam_roles/terraform.tfvars deleted file mode 100644 index 9f12b0d..0000000 --- a/layers/security_identity_compliance/iam_roles/terraform.tfvars +++ /dev/null @@ -1,6 +0,0 @@ -aws-region = "ap-northeast-1" -aws-region-short = "apne1" -customer-name = "racken" -environment = "lab" -project = "cleanslate" -application = "infra" \ No newline at end of file diff --git a/layers/security_identity_compliance/iam_roles/variables.tf b/layers/security_identity_compliance/iam_roles/variables.tf deleted file mode 100644 index b705e28..0000000 --- a/layers/security_identity_compliance/iam_roles/variables.tf +++ /dev/null @@ -1,22 +0,0 @@ -variable "aws-region" {} -variable "aws-region-short" {} -variable "customer-name" {} -variable "environment" {} -variable "project" {} -variable "application" {} - -locals { - default-tags = { - ServiceProvider = "RackspaceTechnology" - Environment = var.environment - Project = var.project - Application = var.application - TerraformMode = "managed" - TerraformDir = trimprefix(path.cwd, "/my/work/xpk-git/") - CreatedBy = data.aws_caller_identity.this.arn - BuildDate = formatdate("YYYYMMDD", timestamp()) - } - ct-bucket-name = "${var.environment}-${var.aws-region-short}-${var.customer-name}-${var.project}-ctbucket-${data.aws_caller_identity.this.account_id}" - resource-prefix = "${var.environment}-${var.aws-region-short}-${var.customer-name}-${var.project}" -} - diff --git a/layers/security_identity_compliance/security_services/.terraform.lock.hcl b/layers/security_identity_compliance/security_services/.terraform.lock.hcl deleted file mode 100644 index eb93526..0000000 --- a/layers/security_identity_compliance/security_services/.terraform.lock.hcl +++ /dev/null @@ -1,37 +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 = "3.26.0" - constraints = ">= 3.25.0" - hashes = [ - "h1:0i78FItlPeiomd+4ThZrtm56P5K33k7/6dnEe4ZePI0=", - "zh:26043eed36d070ca032cf04bc980c654a25821a8abc0c85e1e570e3935bbfcbb", - "zh:2fe68f3f78d23830a04d7fac3eda550eef1f627dfc130486f70a65dc5c254300", - "zh:3d66484c608c64678e639db25d63872783ce60363a1246e30317f21c9c23b84b", - "zh:46ffd755cfd4cf94fe66342797b5afdcef010a24e126c67fee141b357d393535", - "zh:5e96f24357e945c9067cf5e032ad1d003609629c956c2f9f642fefe714e74587", - "zh:60c27aca36bb63bf3e865c2193be80ca83b376581d00f9c220af4b013e163c4d", - "zh:896f0f22d19d41e71b22f9240b261714c3915b165ddefeb771e7734d69dc47ea", - "zh:90de9966cb2fd3e2f326df291595e55d2dd2d90e7d6dd085c2c8691dce82bdb4", - "zh:ad05a91a88ceb1d6de5a568f7cc0b0e5bc0a79f3da70bc28c1e7f3750e362d58", - "zh:e8c63f59c6465329e1f3357498face3dd7ef10a033df3c366a33aa9e94b46c01", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.0.1" - hashes = [ - "h1:SzM8nt2wzLMI28A3CWAtW25g3ZCm1O4xD0h3Ps/rU1U=", - "zh:0d4f683868324af056a9eb2b06306feef7c202c88dbbe6a4ad7517146a22fb50", - "zh:4824b3c7914b77d41dfe90f6f333c7ac9860afb83e2a344d91fbe46e5dfbec26", - "zh:4b82e43712f3cf0d0cbc95b2cbcd409ba8f0dc7848fdfb7c13633c27468ed04a", - "zh:78b3a2b860c3ebc973a794000015f5946eb59b82705d701d487475406b2612f1", - "zh:88bc65197bd74ff408d147b32f0045372ae3a3f2a2fdd7f734f315d988c0e4a2", - "zh:91bd3c9f625f177f3a5d641a64e54d4b4540cb071070ecda060a8261fb6eb2ef", - "zh:a6818842b28d800f784e0c93284ff602b0c4022f407e4750da03f50b853a9a2c", - "zh:c4a1a2b52abd05687e6cfded4a789dcd7b43e7a746e4d02dd1055370cf9a994d", - "zh:cf65041bf12fc3bde709c1d267dbe94142bc05adcabc4feb17da3b12249132ac", - "zh:e385e00e7425dda9d30b74ab4ffa4636f4b8eb23918c0b763f0ffab84ece0c5c", - ] -} diff --git a/layers/security_identity_compliance/security_services/aws-config.tf b/layers/security_identity_compliance/security_services/aws-config.tf deleted file mode 100644 index 97c972d..0000000 --- a/layers/security_identity_compliance/security_services/aws-config.tf +++ /dev/null @@ -1,16 +0,0 @@ -/* - Deploy aws config service. If it is already enabled in the account, import existing - config record with - ▶ terraform import module.aws-config-module.aws_config_configuration_recorder.config-recorder default - -*/ - -module aws-config-module { - source = "../../../modules/security_identity_compliance/aws_config" - application = var.application - environment = var.environment - customer-name = var.customer-name - project = var.project - aws-region-short = var.aws-region-short - default-tags = local.default-tags -} \ No newline at end of file diff --git a/layers/security_identity_compliance/security_services/guardduty.tf b/layers/security_identity_compliance/security_services/guardduty.tf deleted file mode 100644 index f2082e5..0000000 --- a/layers/security_identity_compliance/security_services/guardduty.tf +++ /dev/null @@ -1,13 +0,0 @@ -/* - Deploy aws guardduty service. -*/ - -module aws-guardduty-module { - source = "../../../modules/security_identity_compliance/guardduty" - application = var.application - environment = var.environment - customer-name = var.customer-name - project = var.project - aws-region-short = var.aws-region-short - default-tags = local.default-tags -} \ No newline at end of file diff --git a/layers/security_identity_compliance/security_services/main.tf b/layers/security_identity_compliance/security_services/main.tf deleted file mode 100644 index 8662c3d..0000000 --- a/layers/security_identity_compliance/security_services/main.tf +++ /dev/null @@ -1 +0,0 @@ -data aws_caller_identity this {} diff --git a/layers/security_identity_compliance/security_services/provider.tf b/layers/security_identity_compliance/security_services/provider.tf deleted file mode 100644 index 4e906ad..0000000 --- a/layers/security_identity_compliance/security_services/provider.tf +++ /dev/null @@ -1,13 +0,0 @@ -provider "aws" { - region = var.aws-region -} - -terraform { - required_version = ">= 0.14" - required_providers { - aws = { - source = "hashicorp/aws" - version = ">= 3.25" - } - } -} \ No newline at end of file diff --git a/layers/security_identity_compliance/security_services/terraform.tfvars b/layers/security_identity_compliance/security_services/terraform.tfvars deleted file mode 100644 index 9f12b0d..0000000 --- a/layers/security_identity_compliance/security_services/terraform.tfvars +++ /dev/null @@ -1,6 +0,0 @@ -aws-region = "ap-northeast-1" -aws-region-short = "apne1" -customer-name = "racken" -environment = "lab" -project = "cleanslate" -application = "infra" \ No newline at end of file diff --git a/layers/security_identity_compliance/security_services/variables.tf b/layers/security_identity_compliance/security_services/variables.tf deleted file mode 100644 index b705e28..0000000 --- a/layers/security_identity_compliance/security_services/variables.tf +++ /dev/null @@ -1,22 +0,0 @@ -variable "aws-region" {} -variable "aws-region-short" {} -variable "customer-name" {} -variable "environment" {} -variable "project" {} -variable "application" {} - -locals { - default-tags = { - ServiceProvider = "RackspaceTechnology" - Environment = var.environment - Project = var.project - Application = var.application - TerraformMode = "managed" - TerraformDir = trimprefix(path.cwd, "/my/work/xpk-git/") - CreatedBy = data.aws_caller_identity.this.arn - BuildDate = formatdate("YYYYMMDD", timestamp()) - } - ct-bucket-name = "${var.environment}-${var.aws-region-short}-${var.customer-name}-${var.project}-ctbucket-${data.aws_caller_identity.this.account_id}" - resource-prefix = "${var.environment}-${var.aws-region-short}-${var.customer-name}-${var.project}" -} -