Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating group name in assignment #14

Merged
merged 1 commit into from
Mar 2, 2024
Merged

updating group name in assignment #14

merged 1 commit into from
Mar 2, 2024

Conversation

chelseybeck
Copy link
Member

What changed?

  • after changing the group and policy names, I didn't update the name of the group users were assigned to...correcting that

Copy link

github-actions bot commented Mar 2, 2024

Terraform plan in terraform

Plan: 1 to add, 1 to change, 2 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+   create
!~  update in-place
-   destroy

Terraform will perform the following actions:

  # module.aws_custom_policies.aws_iam_policy.custom_policy["IAMServicesAdmin"] will be destroyed
  # (because key ["IAMServicesAdmin"] is not in for_each map)
-   resource "aws_iam_policy" "custom_policy" {
-       arn         = "arn:aws:iam::035866691871:policy/IAMServicesAdmin" -> null
-       description = "Policy granting IAM services admins permissions to make changes to user accounts" -> null
-       id          = "arn:aws:iam::035866691871:policy/IAMServicesAdmin" -> null
-       name        = "IAMServicesAdmin" -> null
-       path        = "/" -> null
-       policy      = jsonencode(
            {
-               Statement = [
-                   {
-                       Action   = [
-                           "iam:CreateAccessKey",
                        ]
-                       Effect   = "Allow"
-                       Resource = "arn:aws:iam::*:user/*"
                    },
-                   {
-                       Action    = [
-                           "iam:UpdateLoginProfile",
                        ]
-                       Condition = {
-                           StringEquals = {
-                               "iam:ResourceTag/Access Level" = [
-                                   "1",
-                                   "2",
                                ]
                            }
                        }
-                       Effect    = "Allow"
-                       Resource  = "arn:aws:iam::*:user/*"
                    },
-                   {
-                       Action   = [
-                           "cloudshell:CreateEnvironment",
-                           "cloudshell:GetEnvironmentStatus",
-                           "cloudshell:CreateSession",
-                           "cloudshell:StartEnvironment",
-                           "cloudshell:StopEnvironment",
                        ]
-                       Effect   = "Allow"
-                       Resource = "*"
                    },
                ]
-               Version   = "2012-10-17"
            }
        ) -> null
-       policy_id   = "ANPAQQWOSJEPRL2DTHOJL" -> null
-       tags        = {} -> null
-       tags_all    = {} -> null
    }

  # module.iam_services_admin_group.aws_iam_group.group will be destroyed
  # (because aws_iam_group.group is not in configuration)
-   resource "aws_iam_group" "group" {
-       arn       = "arn:aws:iam::035866691871:group/iam-services-admin-group" -> null
-       id        = "iam-services-admin-group" -> null
-       name      = "iam-services-admin-group" -> null
-       path      = "/" -> null
-       unique_id = "AGPAQQWOSJEPURLU5DTDL" -> null
    }

  # module.iam_services_supervisor_group.aws_iam_group_policy_attachment.group_policy_attachment["IAMServicesSupervisor"] will be created
+   resource "aws_iam_group_policy_attachment" "group_policy_attachment" {
+       group      = "iam-services-supervisor-group"
+       id         = (known after apply)
+       policy_arn = "arn:aws:iam::035866691871:policy/IAMServicesSupervisor"
    }

  # module.iam_user_chelseyb.aws_iam_user_group_membership.user_group_membership will be updated in-place
!~  resource "aws_iam_user_group_membership" "user_group_membership" {
!~      groups = [
-           "iam-services-admin-group",
+           "iam-services-supervisor-group",
#            (1 unchanged element hidden)
        ]
        id     = "terraform-20240222055701939500000001"
#        (1 unchanged attribute hidden)
    }

Plan: 1 to add, 1 to change, 2 to destroy.

❌ Error applying plan in Apply Terraform changes on merge #5

@chelseybeck chelseybeck merged commit 6fbb9df into main Mar 2, 2024
1 check passed
Copy link

github-actions bot commented Mar 2, 2024

Terraform plan in terraform

Plan: 1 to add, 0 to change, 1 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+   create
-   destroy

Terraform will perform the following actions:

  # module.aws_custom_policies.aws_iam_policy.custom_policy["IAMServicesAdmin"] will be destroyed
  # (because key ["IAMServicesAdmin"] is not in for_each map)
-   resource "aws_iam_policy" "custom_policy" {
-       arn         = "arn:aws:iam::035866691871:policy/IAMServicesAdmin" -> null
-       description = "Policy granting IAM services admins permissions to make changes to user accounts" -> null
-       id          = "arn:aws:iam::035866691871:policy/IAMServicesAdmin" -> null
-       name        = "IAMServicesAdmin" -> null
-       path        = "/" -> null
-       policy      = jsonencode(
            {
-               Statement = [
-                   {
-                       Action   = [
-                           "iam:CreateAccessKey",
                        ]
-                       Effect   = "Allow"
-                       Resource = "arn:aws:iam::*:user/*"
                    },
-                   {
-                       Action    = [
-                           "iam:UpdateLoginProfile",
                        ]
-                       Condition = {
-                           StringEquals = {
-                               "iam:ResourceTag/Access Level" = [
-                                   "1",
-                                   "2",
                                ]
                            }
                        }
-                       Effect    = "Allow"
-                       Resource  = "arn:aws:iam::*:user/*"
                    },
-                   {
-                       Action   = [
-                           "cloudshell:CreateEnvironment",
-                           "cloudshell:GetEnvironmentStatus",
-                           "cloudshell:CreateSession",
-                           "cloudshell:StartEnvironment",
-                           "cloudshell:StopEnvironment",
                        ]
-                       Effect   = "Allow"
-                       Resource = "*"
                    },
                ]
-               Version   = "2012-10-17"
            }
        ) -> null
-       policy_id   = "ANPAQQWOSJEPRL2DTHOJL" -> null
-       tags        = {} -> null
-       tags_all    = {} -> null
    }

  # module.iam_services_supervisor_group.aws_iam_group_policy_attachment.group_policy_attachment["IAMServicesSupervisor"] will be created
+   resource "aws_iam_group_policy_attachment" "group_policy_attachment" {
+       group      = "iam-services-supervisor-group"
+       id         = (known after apply)
+       policy_arn = "arn:aws:iam::035866691871:policy/IAMServicesSupervisor"
    }

Plan: 1 to add, 0 to change, 1 to destroy.

✅ Plan applied in Apply Terraform changes on merge #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant