From d6b1714924b1baeb2e522dbc9b04838f4b407724 Mon Sep 17 00:00:00 2001 From: Alex English Date: Mon, 30 Nov 2026 19:24:26 -0800 Subject: [PATCH 1/2] Add an IAM OIDC provider for the Entra tenant --- terraform/aws-entra-oidc-provider.tf | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 terraform/aws-entra-oidc-provider.tf diff --git a/terraform/aws-entra-oidc-provider.tf b/terraform/aws-entra-oidc-provider.tf new file mode 100644 index 0000000..ae16744 --- /dev/null +++ b/terraform/aws-entra-oidc-provider.tf @@ -0,0 +1,32 @@ +// Lets AWS trust tokens issued by Hack for LA's Entra tenant ("CIVIC TECH STRUCTURE"), +// so incubator apps running on Azure can assume AWS roles. Each app's credential sidecar +// (hackforla/incubator#312) exchanges its managed identity token for AWS credentials with +// sts:AssumeRoleWithWebIdentity. The per-project roles that trust this provider are +// created in hackforla/incubator, next to each project (hackforla/incubator#313). +// See hackforla/devops-security#236. +// +// Skipped unless var.iam_only is false, like cloudtrail.tf and azure-ci-identities.tf: it +// trusts Hack for LA's tenant, so it means nothing in a contributor's own AWS account. + +resource "aws_iam_openid_connect_provider" "entra" { + count = var.iam_only ? 0 : 1 + + // Must equal the managed identity token's `iss` claim exactly, trailing slash + // included, or AWS rejects the token. Recorded from a live token in + // hackforla/incubator#307. Managed identity tokens are v1, issued by sts.windows.net. + url = "https://sts.windows.net/8d4de52f-0fe7-43d5-a950-f268f4a09ead/" + + // The audience the sidecars request: the client ID of the app registration + // `incubator-aws-credential-audience`, which hackforla/incubator creates (its root + // output azure_aws_credential_audience_client_id). Hard-coded because this repo can't + // read incubator's state. If that registration is ever recreated, its client ID + // changes and this must follow. + client_id_list = ["bb422364-5f6c-4950-bc83-170463db0a53"] + + // No thumbprint_list: AWS no longer needs one for this issuer and fills it in itself. +} + +output "entra_oidc_provider_arn" { + description = "ARN of the IAM OIDC provider for Hack for LA's Entra tenant, for roles assumed by apps on Azure. Null when iam_only is true." + value = one(aws_iam_openid_connect_provider.entra[*].arn) +} From 6ccc9d670f40dd610af6b7e6290115f5e2733c86 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 1 Dec 2026 03:24:42 +0000 Subject: [PATCH 2/2] terraform-docs: automated updates to Terraform modules README.md [skip ci] --- terraform/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terraform/README.md b/terraform/README.md index 99b9773..d219797 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -78,6 +78,7 @@ Terraform directory structure | [aws_iam_group.project_leads](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_group) | resource | | [aws_iam_group_policy_attachment.admin](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_group_policy_attachment) | resource | | [aws_iam_group_policy_attachment.manageAccessKeys](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_group_policy_attachment) | resource | +| [aws_iam_openid_connect_provider.entra](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_openid_connect_provider) | resource | | [aws_iam_policy.food_oasis_local_dev](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | | [aws_iam_policy.manage_access_keys](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | | [aws_iam_role.incubator_tf_apply](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | @@ -128,5 +129,6 @@ Terraform directory structure | Name | Description | |------|-------------| +| [entra\_oidc\_provider\_arn](#output\_entra\_oidc\_provider\_arn) | ARN of the IAM OIDC provider for Hack for LA's Entra tenant, for roles assumed by apps on Azure. Null when iam\_only is true. | | [incubator\_azure\_ci\_client\_ids](#output\_incubator\_azure\_ci\_client\_ids) | Client IDs of incubator's Azure CI identities, keyed plan/apply. |