From 282f1d8b68827380f9b743d43e6af0e88af5b613 Mon Sep 17 00:00:00 2001 From: Tamas Kiss Date: Thu, 26 May 2022 23:53:45 +0200 Subject: [PATCH] del: remote-state-access module is unused --- remote-state-access/README.md | 101 ------------------------------- remote-state-access/outputs.tf | 7 --- remote-state-access/policy.tf | 59 ------------------ remote-state-access/provider.tf | 8 --- remote-state-access/variables.tf | 35 ----------- 5 files changed, 210 deletions(-) delete mode 100644 remote-state-access/README.md delete mode 100644 remote-state-access/outputs.tf delete mode 100644 remote-state-access/policy.tf delete mode 100644 remote-state-access/provider.tf delete mode 100644 remote-state-access/variables.tf diff --git a/remote-state-access/README.md b/remote-state-access/README.md deleted file mode 100644 index be7decf..0000000 --- a/remote-state-access/README.md +++ /dev/null @@ -1,101 +0,0 @@ -## Requirements - -The following requirements are needed by this module: - -- [aws](#requirement\_aws) (~> 4.9) - -## Providers - -The following providers are used by this module: - -- [aws](#provider\_aws) (~> 4.9) - -## Modules - -No modules. - -## Resources - -The following resources are used by this module: - -- [aws_iam_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) (resource) -- [aws_iam_role.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) (resource) -- [aws_iam_policy_document.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) (data source) - -## Required Inputs - -The following input variables are required: - -### [bucket\_name](#input\_bucket\_name) - -Description: n/a - -Type: `string` - -### [dynamo\_table](#input\_dynamo\_table) - -Description: n/a - -Type: `string` - -### [prefixes](#input\_prefixes) - -Description: n/a - -Type: `list(string)` - -## Optional Inputs - -The following input variables are optional (have default values): - -### [create\_policy](#input\_create\_policy) - -Description: n/a - -Type: `bool` - -Default: `false` - -### [create\_role](#input\_create\_role) - -Description: n/a - -Type: `bool` - -Default: `false` - -### [policy\_name](#input\_policy\_name) - -Description: n/a - -Type: `string` - -Default: `null` - -### [policy\_path](#input\_policy\_path) - -Description: n/a - -Type: `string` - -Default: `"/"` - -### [role\_name](#input\_role\_name) - -Description: n/a - -Type: `string` - -Default: `null` - -## Outputs - -The following outputs are exported: - -### [policy\_arn](#output\_policy\_arn) - -Description: n/a - -### [role\_arn](#output\_role\_arn) - -Description: n/a diff --git a/remote-state-access/outputs.tf b/remote-state-access/outputs.tf deleted file mode 100644 index e79c37b..0000000 --- a/remote-state-access/outputs.tf +++ /dev/null @@ -1,7 +0,0 @@ -output "role_arn" { - value = var.create_role ? aws_iam_role.this.arn : null -} - -output "policy_arn" { - value = var.create_policy ? aws_iam_policy.this.arn : null -} diff --git a/remote-state-access/policy.tf b/remote-state-access/policy.tf deleted file mode 100644 index c2556a3..0000000 --- a/remote-state-access/policy.tf +++ /dev/null @@ -1,59 +0,0 @@ -data "aws_iam_policy_document" "this" { - statement { - effect = "Allow" - actions = [ - "s3:ListBucket" - ] - - resources = [ - "arn:aws:s3:::${var.bucket_name}", - ] - } - statement { - effect = "Allow" - actions = [ - "s3:GetObject", - "s3:PutObject", - "s3:DeleteObject", - ] - - resources = [ - "arn:aws:s3:::${var.bucket_name}", - ] - - condition { - test = "StringLike" - variable = "s3:prefix" - - values = var.prefixes - } - } - statement { - effect = "Allow" - actions = [ - "dynamodb:GetItem", - "dynamodb:PutItem", - "dynamodb:DeleteItem", - ] - resources = [ - "arn:aws:dynamodb:*:*:table/${var.dynamodb_table}", - ] - } -} - - -resource "aws_iam_role" "this" { - count = var.create_role ? 1 : 0 - name = var.role_name - - inline_policy { - name = "Allow access for remote states s3 and dynamo" - policy = data.aws_iam_policy_document.this.json - } -} - -resource "aws_iam_policy" "this" { - count = var.create_policy ? 1 : 0 - name = var.policy_name - path = var.policy_path -} \ No newline at end of file diff --git a/remote-state-access/provider.tf b/remote-state-access/provider.tf deleted file mode 100644 index e523c26..0000000 --- a/remote-state-access/provider.tf +++ /dev/null @@ -1,8 +0,0 @@ -terraform { - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 4.9" - } - } -} diff --git a/remote-state-access/variables.tf b/remote-state-access/variables.tf deleted file mode 100644 index 3c23ec2..0000000 --- a/remote-state-access/variables.tf +++ /dev/null @@ -1,35 +0,0 @@ -variable "bucket_name" { - type = string -} - -variable "dynamo_table" { - type = string -} - -variable "prefixes" { - type = list(string) -} - -variable "role_name" { - type = string - default = null -} - -variable "policy_name" { - type = string - default = null -} -variable "policy_path" { - type = string - default = "/" -} - -variable "create_role" { - type = bool - default = false -} - -variable "create_policy" { - type = bool - default = false -} \ No newline at end of file