Skip to content

Commit 3784b59

Browse files
committed
updating formatting and adding lifecycle parameter
1 parent 9389e3e commit 3784b59

File tree

9 files changed

+42
-18
lines changed

9 files changed

+42
-18
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
# Ignore override files
88
*.tfoverride
99

10-
11-
1210
# Ignore environment-specific files
1311
.envrc
1412

1513
# Ignore CLI configuration files
1614
.terraformrc
17-
terraform.rc
15+
terraform.rc
16+
17+
# Ignore metadata files
18+
*.tfstate.lock.info

terraform/aws-users.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Create user and assign to group(s)
12
module "iam_user_gwenstacy" {
23
source = "./modules/aws-users"
34

terraform/backend.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
terraform {
22
backend "s3" {
3-
bucket = "hfla-ops-terraform-state" # Replace with S3 bucket name
4-
key = "devops-security/terraform.tfstate" # Path to the state file within the bucket
5-
region = "us-west-2" # AWS region of the S3 bucket
6-
dynamodb_table = "hfla_ops_terraform_table" # DynamoDB table name for state locking
3+
bucket = "hfla-ops-terraform-state"
4+
key = "devops-security/terraform.tfstate"
5+
region = "us-west-2"
6+
dynamodb_table = "hfla_ops_terraform_table"
77
encrypt = true
88
}
99
}

terraform/modules/aws-groups/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ resource "aws_iam_group" "group" {
55
path = var.group_path
66
}
77

8-
# Attaching policies to the group
98
resource "aws_iam_group_policy_attachment" "group_policy_attachment" {
109
for_each = toset(var.policy_arn)
1110
group = aws_iam_group.group.name

terraform/modules/aws-groups/variables.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,3 @@ variable "policy_arn" {
1515
description = "List of policy ARNs to attach to the group"
1616
type = list(string)
1717
}
18-
19-
# variable "policy_arns" {
20-
# description = "List of policy ARNs to attach to the group"
21-
# type = list(string)
22-
# }

terraform/modules/aws-users/.terraform.lock.hcl

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terraform/modules/aws-users/main.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ resource "aws_iam_user" "user" {
77
tags = var.user_tags
88
}
99

10-
# Example of creating a login profile for the user (if needed)
1110
resource "aws_iam_user_login_profile" "user_login" {
12-
user = aws_iam_user.user.name
13-
#pgp_key = var.pgp_key
11+
user = aws_iam_user.user.name
1412

1513
password_reset_required = true
1614
depends_on = [aws_iam_user.user]
15+
16+
lifecycle {
17+
ignore_changes = [
18+
password_reset_required,
19+
]
20+
}
1721
}
1822

1923
resource "aws_iam_user_group_membership" "user_group_membership" {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# users/outputs.tf
22

33
output "user_name" {
4-
value = aws_iam_user.user.name
4+
value = aws_iam_user.user.name
55
description = "The name of the IAM user"
66
}
77

88
output "user_arn" {
9-
value = aws_iam_user.user.arn
9+
value = aws_iam_user.user.arn
1010
description = "The ARN of the IAM user"
1111
}

terraform/modules/aws-users/terraform.tfstate

Whitespace-only changes.

0 commit comments

Comments
 (0)