del: remote-state-access module is unused
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,101 +0,0 @@
|
|||||||
## Requirements
|
|
||||||
|
|
||||||
The following requirements are needed by this module:
|
|
||||||
|
|
||||||
- <a name="requirement_aws"></a> [aws](#requirement\_aws) (~> 4.9)
|
|
||||||
|
|
||||||
## Providers
|
|
||||||
|
|
||||||
The following providers are used by this module:
|
|
||||||
|
|
||||||
- <a name="provider_aws"></a> [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:
|
|
||||||
|
|
||||||
### <a name="input_bucket_name"></a> [bucket\_name](#input\_bucket\_name)
|
|
||||||
|
|
||||||
Description: n/a
|
|
||||||
|
|
||||||
Type: `string`
|
|
||||||
|
|
||||||
### <a name="input_dynamo_table"></a> [dynamo\_table](#input\_dynamo\_table)
|
|
||||||
|
|
||||||
Description: n/a
|
|
||||||
|
|
||||||
Type: `string`
|
|
||||||
|
|
||||||
### <a name="input_prefixes"></a> [prefixes](#input\_prefixes)
|
|
||||||
|
|
||||||
Description: n/a
|
|
||||||
|
|
||||||
Type: `list(string)`
|
|
||||||
|
|
||||||
## Optional Inputs
|
|
||||||
|
|
||||||
The following input variables are optional (have default values):
|
|
||||||
|
|
||||||
### <a name="input_create_policy"></a> [create\_policy](#input\_create\_policy)
|
|
||||||
|
|
||||||
Description: n/a
|
|
||||||
|
|
||||||
Type: `bool`
|
|
||||||
|
|
||||||
Default: `false`
|
|
||||||
|
|
||||||
### <a name="input_create_role"></a> [create\_role](#input\_create\_role)
|
|
||||||
|
|
||||||
Description: n/a
|
|
||||||
|
|
||||||
Type: `bool`
|
|
||||||
|
|
||||||
Default: `false`
|
|
||||||
|
|
||||||
### <a name="input_policy_name"></a> [policy\_name](#input\_policy\_name)
|
|
||||||
|
|
||||||
Description: n/a
|
|
||||||
|
|
||||||
Type: `string`
|
|
||||||
|
|
||||||
Default: `null`
|
|
||||||
|
|
||||||
### <a name="input_policy_path"></a> [policy\_path](#input\_policy\_path)
|
|
||||||
|
|
||||||
Description: n/a
|
|
||||||
|
|
||||||
Type: `string`
|
|
||||||
|
|
||||||
Default: `"/"`
|
|
||||||
|
|
||||||
### <a name="input_role_name"></a> [role\_name](#input\_role\_name)
|
|
||||||
|
|
||||||
Description: n/a
|
|
||||||
|
|
||||||
Type: `string`
|
|
||||||
|
|
||||||
Default: `null`
|
|
||||||
|
|
||||||
## Outputs
|
|
||||||
|
|
||||||
The following outputs are exported:
|
|
||||||
|
|
||||||
### <a name="output_policy_arn"></a> [policy\_arn](#output\_policy\_arn)
|
|
||||||
|
|
||||||
Description: n/a
|
|
||||||
|
|
||||||
### <a name="output_role_arn"></a> [role\_arn](#output\_role\_arn)
|
|
||||||
|
|
||||||
Description: n/a
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
terraform {
|
|
||||||
required_providers {
|
|
||||||
aws = {
|
|
||||||
source = "hashicorp/aws"
|
|
||||||
version = "~> 4.9"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user