Skip to content

Commit

Permalink
Update Policy module
Browse files Browse the repository at this point in the history
  • Loading branch information
Weyder Ferreira committed Jan 6, 2023
1 parent 898e5b0 commit e0b308b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 33 deletions.
20 changes: 2 additions & 18 deletions iam/policies/policy/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_iam_policy.policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.aip](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |

## Inputs

Expand All @@ -26,15 +12,13 @@ No modules.
| <a name="input_description"></a> [description](#input\_description) | (Optional, Forces new resource) Description of the IAM policy. | `string` | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | (Optional, Forces new resource) The name of the policy. If omitted, Terraform will assign a random, unique name. | `string` | `null` | no |
| <a name="input_path"></a> [path](#input\_path) | (Optional, default /) Path in which to create the policy. See IAM Identifiers for more information. | `string` | `"/"` | no |
| <a name="input_policy"></a> [policy](#input\_policy) | (Required) The policy document. This is a JSON formatted string. | `any` | n/a | yes |
| <a name="input_policy"></a> [policy](#input\_policy) | (Required) The policy document. This is a JSON formatted string. | `string` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | The TAG list | `map(string)` | `{}` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_arn"></a> [arn](#output\_arn) | The ARN assigned by AWS to this policy |
| <a name="output_description"></a> [description](#output\_description) | The porpouse of these policy |
| <a name="output_name"></a> [name](#output\_name) | The Policy Name |
| <a name="output_path"></a> [path](#output\_path) | The path of the policy in IAM |
<!-- END_TF_DOCS -->
5 changes: 2 additions & 3 deletions iam/policies/policy/main.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
resource "aws_iam_policy" "policy" {
resource "aws_iam_policy" "aip" {
name = var.name
path = var.path
description = var.description

policy = file(var.policy)
policy = var.policy

tags = var.tags

Expand Down
14 changes: 2 additions & 12 deletions iam/policies/policy/outuputs.tf
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
output "name" {
description = "The Policy Name"
value = aws_iam_policy.policy.name
}

output "description" {
description = "The porpouse of these policy"
value = aws_iam_policy.policy.description
value = aws_iam_policy.aip.name
}

output "arn" {
description = "The ARN assigned by AWS to this policy"
value = aws_iam_policy.policy.arn
}

output "path" {
description = "The path of the policy in IAM"
value = aws_iam_policy.policy.path
value = aws_iam_policy.aip.arn
}
1 change: 1 addition & 0 deletions iam/policies/policy/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ variable "description" {
description = "(Optional, Forces new resource) Description of the IAM policy."
}
variable "policy" {
type = string
description = "(Required) The policy document. This is a JSON formatted string. "
}
variable "tags" {
Expand Down

0 comments on commit e0b308b

Please sign in to comment.