Skip to content

Commit

Permalink
ran .pre-commit on local and uncommented .pre-commit-config.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
dsreehas committed Apr 28, 2024
1 parent 946dbc6 commit ff8aea8
Show file tree
Hide file tree
Showing 43 changed files with 47 additions and 52 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ repos:
- id: check-merge-conflict
name: check merge conflict
description: Check for files that contain merge conflict strings.
# - id: end-of-file-fixer
# name: end of file fixer
# description: Let's be sure that a new line has been added to the end of the file.
# - id: trailing-whitespace
# name: trailing whitespace
# description: Automatically remove trailing whitespace before committing.
- id: end-of-file-fixer
name: end of file fixer
description: Let's be sure that a new line has been added to the end of the file.
- id: trailing-whitespace
name: trailing whitespace
description: Automatically remove trailing whitespace before committing.
- id: detect-private-key
name: detect-private-key
description: Detect if any Private key was defined
Expand Down
2 changes: 1 addition & 1 deletion .terraform-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ settings:
read-comments: true
required: true
sensitive: true
type: true
type: true
2 changes: 1 addition & 1 deletion examples/dummy-role/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ module "iam_role" {
role_name = var.role_name
assume_role_policy = file("./policies/assume_role_policy.json")

}
}
2 changes: 1 addition & 1 deletion examples/dummy-role/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ output "iam_role_name" {
output "iam_role_assume_role_policy" {
description = "The IAM assume role policy associated with the role"
value = module.iam_role.iam_role_assume_role_policy
}
}
1 change: 0 additions & 1 deletion examples/dummy-role/policies/assume_role_policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@
}
]
}

2 changes: 1 addition & 1 deletion examples/dummy-role/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ terraform {
provider "aws" {
region = var.aws_region
profile = var.aws_profile
}
}
2 changes: 1 addition & 1 deletion examples/dummy-role/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ variable "role_name" {
description = "Name of the IAM role"
type = string
default = "dummy-role"
}
}
2 changes: 1 addition & 1 deletion examples/inline-managed-policies/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ module "iam_role" {
inline_policies = [file("./policies/inline_policy_1.json"), file("./policies/inline_policy_2.json")]
managed_policy_arns = var.managed_policy_arns

}
}
2 changes: 1 addition & 1 deletion examples/inline-managed-policies/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ output "iam_role_inline_policies" {
output "iam_role_managed_policy_arns" {
description = "The managed policy ARNs attached to the IAM role"
value = module.iam_role.iam_role_managed_policy_arns
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
}
]
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
}
]
}

2 changes: 1 addition & 1 deletion examples/inline-managed-policies/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ terraform {
provider "aws" {
region = var.aws_region
profile = var.aws_profile
}
}
2 changes: 1 addition & 1 deletion examples/inline-managed-policies/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ variable "managed_policy_arns" {
description = "List of managed policies ARNs to attach"
type = list(string)
default = ["arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess", "arn:aws:iam::aws:policy/AmazonDynamoDBReadOnlyAccess"]
}
}
2 changes: 1 addition & 1 deletion examples/instance-profile/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ resource "aws_iam_instance_profile" "iam_instance_profile" {
name = "my-instance-profile"
role = module.iam_role.iam_role_name

}
}
2 changes: 1 addition & 1 deletion examples/instance-profile/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ output "iam_instance_profile_arn" {
output "iam_instance_profile_name" {
description = "The name of the instance profile"
value = aws_iam_instance_profile.iam_instance_profile.name
}
}
2 changes: 1 addition & 1 deletion examples/instance-profile/policies/assume_role_policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"Action": "sts:AssumeRole"
}
]
}
}
2 changes: 1 addition & 1 deletion examples/instance-profile/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ variable "managed_policy_arns" {
description = "List of managed policies ARNs to attach"
type = list(string)
default = ["arn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess", "arn:aws:iam::aws:policy/CloudWatchLogsReadOnlyAccess"]
}
}
2 changes: 1 addition & 1 deletion examples/multiple-inline-policies/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ module "iam_role_with_inline_policies" {
assume_role_policy = file("./policies/assume_role_policy.json")
inline_policies = [file("./policies/inline_policy_1.json"), file("./policies/inline_policy_2.json"), file("./policies/inline_policy_3.json")]

}
}
2 changes: 1 addition & 1 deletion examples/multiple-inline-policies/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ output "iam_role_with_inline_policies_assume_role_policy" {
output "iam_role_with_inline_policies_inline_policies" {
description = "The inline policies attached to the IAM role with inline policies"
value = module.iam_role_with_inline_policies.iam_role_inline_policies
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"Action": "sts:AssumeRole"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
}
]
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
}
]
}

Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"Resource": "*"
}
]
}
}
2 changes: 1 addition & 1 deletion examples/multiple-inline-policies/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ terraform {
provider "aws" {
region = var.aws_region
profile = var.aws_profile
}
}
2 changes: 1 addition & 1 deletion examples/multiple-inline-policies/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ variable "role_name" {
description = "Name of the IAM role"
type = string
default = "multiple-inline-policies-role"
}
}
2 changes: 1 addition & 1 deletion examples/multiple-managed-policies/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ module "iam_role_with_managed_policies" {
assume_role_policy = file("./policies/assume_role_policy.json")
managed_policy_arns = var.managed_policy_arns

}
}
2 changes: 1 addition & 1 deletion examples/multiple-managed-policies/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ output "iam_role_with_managed_policies_assume_role_policy" {
output "iam_role_with_managed_policies_managed_policy_arns" {
description = "The managed policy ARNs attached to the IAM role with managed policies"
value = module.iam_role_with_managed_policies.iam_role_managed_policy_arns
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"Action": "sts:AssumeRole"
}
]
}
}
2 changes: 1 addition & 1 deletion examples/multiple-managed-policies/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ terraform {
provider "aws" {
region = var.aws_region
profile = var.aws_profile
}
}
2 changes: 1 addition & 1 deletion examples/multiple-managed-policies/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ variable "managed_policy_arns" {
description = "List of managed policies ARNs to attach"
type = list(string)
default = ["arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess", "arn:aws:iam::aws:policy/AmazonDynamoDBReadOnlyAccess", "arn:aws:iam::aws:policy/CloudWatchLogsFullAccess"]
}
}
2 changes: 1 addition & 1 deletion examples/single-inline-policy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ module "iam_role" {
assume_role_policy = file("./policies/assume_role_policy.json")
inline_policies = [file("./policies/inline_policy.json")]

}
}
2 changes: 1 addition & 1 deletion examples/single-inline-policy/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ output "iam_role_assume_role_policy" {
output "iam_role_inline_policies" {
description = "The inline policies attached to the IAM role"
value = module.iam_role.iam_role_inline_policies
}
}
2 changes: 1 addition & 1 deletion examples/single-inline-policy/policies/inline_policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
]
}
]
}
}
2 changes: 1 addition & 1 deletion examples/single-inline-policy/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ terraform {
provider "aws" {
region = var.aws_region
profile = var.aws_profile
}
}
2 changes: 1 addition & 1 deletion examples/single-inline-policy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ variable "role_name" {
description = "Name of the IAM role"
type = string
default = "single-inline-policy-role"
}
}
2 changes: 1 addition & 1 deletion examples/single-managed-policy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ module "iam_role" {
assume_role_policy = file("./policies/assume_role_policy.json")
managed_policy_arns = var.managed_policy_arns

}
}
2 changes: 1 addition & 1 deletion examples/single-managed-policy/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ output "iam_role_assume_role_policy" {
output "iam_role_managed_policy_arns" {
description = "The managed policy ARNs attached to the IAM role"
value = module.iam_role.iam_role_managed_policy_arns
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"Action": "sts:AssumeRole"
}
]
}
}
2 changes: 1 addition & 1 deletion examples/single-managed-policy/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ terraform {
provider "aws" {
region = var.aws_region
profile = var.aws_profile
}
}
2 changes: 1 addition & 1 deletion examples/single-managed-policy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ variable "managed_policy_arns" {
description = "List of managed policies ARNs to attach"
type = list(string)
default = ["arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"]
}
}
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ resource "aws_iam_instance_profile" "instance_profile" {
name = "${var.role_name}-instance-profile"
role = aws_iam_role.iam_role.name

}
}
2 changes: 1 addition & 1 deletion providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ terraform {
provider "aws" {
region = var.aws_region
profile = var.aws_profile
}
}
10 changes: 5 additions & 5 deletions readme_old.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,25 +248,25 @@ This Terraform module is designed to create AWS IAM roles with appropriate inlin
"arn:aws:iam::aws:policy/AmazonDynamoDBReadOnlyAccess"
]
}

### Output Values

output "iam_role_arn" {
description = "The Amazon Resource Name (ARN) specifying the IAM role"
value = module.iam_role.iam_role_arn
}

output "iam_role_name" {
description = "The name of the IAM role"
value = module.iam_role.iam_role_name
}

output "iam_role_assume_role_policy" {
description = "The IAM assume role policy associated with the role"
value = module.iam_role.iam_role_assume_role_policy
}

output "iam_role_managed_policy_arns" {
description = "The managed policy ARNs attached to the IAM role"
value = module.iam_role.iam_role_managed_policy_arns
}
}

0 comments on commit ff8aea8

Please sign in to comment.