Skip to content

Commit 386c348

Browse files
author
Rajeev Jaggavarapu
committed
Updating Role name for SSM
1 parent a5df39f commit 386c348

File tree

5 files changed

+45
-7
lines changed

5 files changed

+45
-7
lines changed

.gitignore

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
1-
.terraform
2-
*.tfstate*
3-
*.tfvars*
4-
other_vars.tf
5-
provider.tf
1+
# Local .terraform directories
2+
**/.terraform/*
3+
4+
# .tfstate files
5+
*.tfstate
6+
*.tfstate.*
7+
8+
# Crash log files
9+
crash.log
10+
11+
# Exclude all .tfvars files, which are likely to contain sentitive data, such as
12+
# password, private keys, and other secrets. These should not be part of version
13+
# control as they are data points which are potentially sensitive and subject
14+
# to change depending on the environment.
15+
#
16+
*.tfvars
17+
18+
# Ignore override files as they are usually used to override resources locally and so
19+
# are not checked in
20+
override.tf
21+
override.tf.json
22+
*_override.tf
23+
*_override.tf.json
24+
25+
# Include override files you do wish to add to version control using negated pattern
26+
#
27+
# !example_override.tf
28+
29+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
30+
# example: *tfplan*
31+
32+
# Ignore CLI configuration files
33+
.terraformrc
34+
terraform.rc

.pre-commit-config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.27.0
3+
rev: v1.43.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_docs
7+
- id: checkov
8+
- id: terraform_tfsec

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ module "ssm_resources" {
3939
| default\_user | operating system user name for starting sessions | `string` | `"ec2-user"` | no |
4040
| enable\_log\_to\_cloudwatch | Enable Session Manager to Log to CloudWatch Logs | `bool` | `true` | no |
4141
| kms\_key | KMS Key Details | `map(string)` | <pre>{<br> "deletion_window_in_days": 7,<br> "description": "CMK for cloudwath logs and session",<br> "name": "ssm-cmk-key"<br>}</pre> | no |
42+
| role\_name | Name of the Role | `string` | `""` | no |
4243
| run\_as\_enabled | Do you want to use Specify Operating System user for sessions | `bool` | `true` | no |
4344
| tags | A map of tags to add to all resources | `map(string)` | `{}` | no |
4445

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ resource "aws_cloudwatch_log_group" "session_manager_log_group" {
4848

4949
# Create EC2 Instance Role for SSM
5050
resource "aws_iam_role" "ssm_role" {
51-
name = "SessionManagerRole"
51+
name = format("%s-SessionManagerRole", var.role_name)
5252
path = "/"
5353
tags = var.tags
5454

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,9 @@ variable "create_ssm_document" {
4949
description = "Do you want to create SSM Document"
5050
default = true
5151
}
52+
53+
variable "role_name" {
54+
type = string
55+
description = "Name of the Role"
56+
default = ""
57+
}

0 commit comments

Comments
 (0)