# Securing AWS Secrets Manager with Terraform When You Cannot Edit IAM Policies

Original title: AWS Secrets Manager Terraform: Least-Privilege Access

> Hacker News story 49083141 · language: en · submitted 2026-07-28
> Web version: https://zeli.app/story/49083141
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 23 · by [meysamazad](<https://news.ycombinator.com/user?id=meysamazad>) · 💬 4
[original](<https://blog.victorsilva.com.uy/aws-secrets-manager-terraform-least-privilege/>) · [HN discussion](<https://news.ycombinator.com/item?id=49083141>)

## Summary

I often face scenarios where I cannot modify broad IAM identity policies, such as in AWS Academy labs or vendor-managed environments. Instead of fighting these restrictions, I demonstrate how to attach a resource-based policy directly to the secret. This approach uses Terraform to lock down access, ensuring only specific applications can read sensitive data even when the underlying role has excessive permissions.

## Key quote

> You're not narrowing the role; you're building a gate around the secret that the role has to pass through regardless of how permissive its own policy is.

---

## Cite

- Page: https://zeli.app/story/49083141
- Date: 2026-07-28
- Source: blog.victorsilva.com.uy (https://blog.victorsilva.com.uy/aws-secrets-manager-terraform-least-privilege/)
- Hacker News: https://news.ycombinator.com/item?id=49083141

## Other languages

- zh: https://zeli.app/zh/story/49083141 · markdown: https://zeli.app/zh/story/49083141.md
