File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1+ // Create user and assign to group(s)
12module "iam_user_gwenstacy" {
23 source = " ./modules/aws-users"
34
Original file line number Diff line number Diff line change 11terraform {
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}
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ resource "aws_iam_group" "group" {
55 path = var. group_path
66}
77
8- # Attaching policies to the group
98resource "aws_iam_group_policy_attachment" "group_policy_attachment" {
109 for_each = toset (var. policy_arn )
1110 group = aws_iam_group. group . name
Original file line number Diff line number Diff 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- # }
Original file line number Diff line number Diff 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)
1110resource "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
1923resource "aws_iam_user_group_membership" "user_group_membership" {
Original file line number Diff line number Diff line change 11# users/outputs.tf
22
33output "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
88output "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}
You can’t perform that action at this time.
0 commit comments