Skip to content

Add additional Azure client ID for OIDC role #360

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

Merged
merged 1 commit into from
Jun 24, 2025
Merged

Conversation

wanpengyang
Copy link
Contributor

Summary | Résumé

This PR adds a new clientID for managed identity (cds_snc_function_app_managed_identity) to the oidc role.
resolves #359

@wanpengyang wanpengyang self-assigned this Jun 24, 2025
Copy link

Plan for org_account/sentinel_oidc

✅   Terraform Init: success
✅   Terraform Validate: success
✅   Terraform Format: success
✅   Terraform Plan: success
✅   Conftest: success

⚠️   Warning: resources will be destroyed by this change!

Plan: 1 to add, 1 to change, 1 to destroy
Show summary
CHANGE NAME
update aws_iam_role.sentinel_oidc
recreate aws_iam_openid_connect_provider.azure
Show plan
Resource actions are indicated with the following symbols:
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # aws_iam_openid_connect_provider.azure must be replaced
-/+ resource "aws_iam_openid_connect_provider" "azure" {
      ~ arn             = "arn:aws:iam::659087519042:oidc-provider/sts.windows.net/221ca1d3-b3f2-4346-8abc-88f802495c7d/" -> (known after apply)
      ~ client_id_list  = [ # forces replacement
            "c8b9cf86-e2b4-4428-b356-14313412a4d1",
          + "50a00e76-8dcf-4c54-b8b1-94f67e340960",
        ]
      ~ id              = "arn:aws:iam::659087519042:oidc-provider/sts.windows.net/221ca1d3-b3f2-4346-8abc-88f802495c7d/" -> (known after apply)
      - tags            = {} -> null
      ~ tags_all        = {} -> (known after apply)
      ~ url             = "sts.windows.net/221ca1d3-b3f2-4346-8abc-88f802495c7d/" -> "https://sts.windows.net/221ca1d3-b3f2-4346-8abc-88f802495c7d/"
        # (1 unchanged attribute hidden)
    }

  # aws_iam_role.sentinel_oidc will be updated in-place
  ~ resource "aws_iam_role" "sentinel_oidc" {
      ~ assume_role_policy    = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "sts:AssumeRoleWithWebIdentity"
                      - Condition = {
                          - StringEquals = {
                              - "sts.windows.net/221ca1d3-b3f2-4346-8abc-88f802495c7d/:aud" = "c8b9cf86-e2b4-4428-b356-14313412a4d1"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Federated = "arn:aws:iam::659087519042:oidc-provider/sts.windows.net/221ca1d3-b3f2-4346-8abc-88f802495c7d/"
                        }
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> (known after apply)
        id                    = "Sentinel-OIDC-Organizations-ReadOnly"
        name                  = "Sentinel-OIDC-Organizations-ReadOnly"
        tags                  = {}
        # (9 unchanged attributes hidden)
    }

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

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: plan.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "plan.tfplan"
Show Conftest results
WARN - plan.json - main - Missing Common Tags: ["aws_iam_openid_connect_provider.azure"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.sentinel_oidc"]

21 tests, 19 passed, 2 warnings, 0 failures, 0 exceptions

@wanpengyang wanpengyang requested a review from a team June 24, 2025 13:29
@wanpengyang wanpengyang merged commit 5068695 into main Jun 24, 2025
14 checks passed
@wanpengyang wanpengyang deleted the feat/sentinel_idp branch June 24, 2025 14:13
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.

Include new clientID in sentinel_oidc
2 participants