Skip to content

Add food-oasis-local-dev IAM user - #232

Merged
ale210 merged 2 commits into
mainfrom
food-oasis-local-dev-user
Nov 20, 2026
Merged

ale210 merged 2 commits into
mainfrom
food-oasis-local-dev-user

Conversation

@ale210

@ale210 ale210 commented Nov 20, 2026

Copy link
Copy Markdown
Member

Adds food-oasis-local-dev, a shared program-only IAM user for Food Oasis developers' local setups. Their .env files hold an AWS access key today, and that key belongs to the Food Oasis account, which is being deleted (hackforla/incubator#284).

Declared in aws-users-legacy.tf as a bare resource, because the module would give it a console login and trigger the user-bot. The header comment there is updated to name it as the one exception.

Its policy covers only what the Food Oasis server calls:

  • ses:SendEmail / ses:SendRawEmail on the foodoasis.net identity, only with ses:FromAddress = donotreply@foodoasis.net
  • geo:SearchPlaceIndexForText on food-oasis-stage

Checked with the IAM policy simulator: both sends from donotreply@ and the staging search are allowed; another From address, no From address, the production index, suggestions search and unrelated actions are denied.

Expected plan: 3 to add (user, policy, attachment), 0 to change, 0 to destroy.

The access key is created by hand after the apply and stored in the FOLA - DevOps vault, so it never enters the Terraform state.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Terraform plan in terraform
With backend config files: terraform/prod.backend.tfvars
With variables: iam_only = false

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

Terraform will perform the following actions:

  # aws_iam_policy.food_oasis_local_dev will be created
+   resource "aws_iam_policy" "food_oasis_local_dev" {
+       arn              = (known after apply)
+       attachment_count = (known after apply)
+       description      = "Food Oasis local development: send email as donotreply@foodoasis.net and search the staging place index"
+       id               = (known after apply)
+       name             = "food-oasis-local-dev"
+       name_prefix      = (known after apply)
+       path             = "/"
+       policy           = jsonencode(
            {
+               Statement = [
+                   {
+                       Action    = [
+                           "ses:SendEmail",
+                           "ses:SendRawEmail",
                        ]
+                       Condition = {
+                           StringEquals = {
+                               "ses:FromAddress" = "donotreply@foodoasis.net"
                            }
                        }
+                       Effect    = "Allow"
+                       Resource  = "arn:aws:ses:us-west-2:035866691871:identity/foodoasis.net"
+                       Sid       = "SendAsDoNotReply"
                    },
+                   {
+                       Action   = [
+                           "geo:SearchPlaceIndexForText",
                        ]
+                       Effect   = "Allow"
+                       Resource = "arn:aws:geo:us-west-2:035866691871:place-index/food-oasis-stage"
+                       Sid      = "SearchStagingPlaceIndex"
                    },
                ]
+               Version   = "2012-10-17"
            }
        )
+       policy_id        = (known after apply)
+       tags             = {
+           "Project" = "food-oasis"
        }
+       tags_all         = {
+           "Project"    = "food-oasis"
+           "managed-by" = "terraform-devops-security"
        }
    }

  # aws_iam_user.food_oasis_local_dev will be created
+   resource "aws_iam_user" "food_oasis_local_dev" {
+       arn           = (known after apply)
+       force_destroy = false
+       id            = (known after apply)
+       name          = "food-oasis-local-dev"
+       path          = "/"
+       tags          = {
+           "Project" = "food-oasis"
        }
+       tags_all      = {
+           "Project"    = "food-oasis"
+           "managed-by" = "terraform-devops-security"
        }
+       unique_id     = (known after apply)
    }

  # aws_iam_user_policy_attachment.food_oasis_local_dev will be created
+   resource "aws_iam_user_policy_attachment" "food_oasis_local_dev" {
+       id         = (known after apply)
+       policy_arn = (known after apply)
+       user       = "food-oasis-local-dev"
    }

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

✅ Plan applied in Apply Terraform changes on merge #63

@ale210
ale210 merged commit 0804f7c into main Nov 20, 2026
1 check passed
@ale210
ale210 deleted the food-oasis-local-dev-user branch November 20, 2026 07:07
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