Skip to content

Commit a224ccb

Browse files
Remove deprectated iam attribute inline_policy (#3)
1 parent b5e82e8 commit a224ccb

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-added-large-files
66
args: ['--maxkb=500']
@@ -18,7 +18,7 @@ repos:
1818
args: ['--allow-missing-credentials']
1919
- id: trailing-whitespace
2020
- repo: https://github.com/antonbabenko/pre-commit-terraform
21-
rev: v1.76.0
21+
rev: v1.96.2
2222
hooks:
2323
- id: terraform_fmt
2424
- id: terraform_docs

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module "vpc-flow-logs" {
2525

2626
* [VPC flow logs](https://github.com/native-cube/terraform-aws-vpc-flow-logs/tree/main/examples/core)
2727

28-
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
28+
<!-- BEGIN_TF_DOCS -->
2929
## Requirements
3030

3131
| Name | Version |
@@ -50,6 +50,7 @@ No modules.
5050
| [aws_cloudwatch_log_group.flow_logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
5151
| [aws_flow_log.flow_logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/flow_log) | resource |
5252
| [aws_iam_role.flow_logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
53+
| [aws_iam_role_policy.flow_logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
5354
| [aws_iam_policy_document.cloudwatch](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
5455

5556
## Inputs
@@ -76,7 +77,7 @@ No modules.
7677
| <a name="output_flow_logs_id"></a> [flow\_logs\_id](#output\_flow\_logs\_id) | The Flow Log ID. |
7778
| <a name="output_flow_logs_role_arn"></a> [flow\_logs\_role\_arn](#output\_flow\_logs\_role\_arn) | The ARN specifying the role used by Flow Logs. |
7879
| <a name="output_flow_logs_role_id"></a> [flow\_logs\_role\_id](#output\_flow\_logs\_role\_id) | The ID specifying the role used by Flow Logs. |
79-
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
80+
<!-- END_TF_DOCS -->
8081

8182
## License
8283

main.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ resource "aws_iam_role" "flow_logs" {
2525
}
2626
)
2727

28-
inline_policy {
29-
name = "cloudwatch-policy"
30-
policy = data.aws_iam_policy_document.cloudwatch.json
31-
}
32-
3328
tags = var.tags
3429
}
3530

31+
resource "aws_iam_role_policy" "flow_logs" {
32+
name = "cloudwatch-policy"
33+
role = aws_iam_role.flow_logs.id
34+
policy = data.aws_iam_policy_document.cloudwatch.json
35+
}
36+
3637
resource "aws_flow_log" "flow_logs" {
3738
log_destination_type = "cloud-watch-logs"
3839
log_destination = aws_cloudwatch_log_group.flow_logs.arn

0 commit comments

Comments
 (0)