fix(terraform/aws): grant OpenSearch RI actions instead of legacy es names#1217
fix(terraform/aws): grant OpenSearch RI actions instead of legacy es names#1217cristim wants to merge 1 commit into
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 5 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
1e4cad4 to
e898cba
Compare
e898cba to
d0679b8
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
…names The lambda and fargate runtime modules granted only the legacy Elasticsearch-era actions (es:DescribeReservedElasticsearchInstances, es:DescribeReservedElasticsearchInstanceOfferings, es:PurchaseReservedElasticsearchInstanceOffering), while the application uses the OpenSearch SDK whose DescribeReservedInstances, DescribeReservedInstanceOfferings and PurchaseReservedInstanceOffering operations authorize against the distinct new-style es:* action names. As a result, every host-account OpenSearch RI describe/offering/purchase call returned AccessDenied on Terraform deployments, while the parallel CloudFormation stack already granted the correct actions. Replace the three legacy actions with the new-style ones in both runtime modules, matching the CloudFormation stack, and add a regression test that fails if a runtime module grants legacy Elasticsearch-era actions or drops any of the OpenSearch actions the client code requires. Closes #1149
d0679b8 to
6603c94
Compare
|
@coderabbitai full review |
✅ Action performedFull review finished. |
Adversarial review — PR #1217Reviewed against the stated risk surfaces (action-name rename Elasticsearch→OpenSearch; coordination with sibling #1219; CFN/TF parity; customer impact / in-flight purchases; provider-version interaction; CR-finding overlap with #1219). Net: no blocking findings. One pre-existing UNSTABLE cause (migration-074 collision on stale base) fixed by rebasing onto current What I checked
Pre-existing UNSTABLE: migration-074 collision (fixed via rebase)The PR's
Per memory Action taken. Rebased
Force-pushed ( CodeRabbit stateThe original CR review on 2026-06-11 hit a CR rate limit ("Review limit reached"). The two subsequent Repo-wide CI failures unrelated to this PR
VerdictNo fix needed on PR #1217 itself; the rename of three IAM action names is the entire correctness story and it is correct. UNSTABLE state cleared via the documented migration-074→077 rebase path. Recommend merging once CR is clean on the rebased commit and the unrelated repo-wide CI failures are addressed at the repo level (or accepted as merge-blocked-by-known-issues per project policy). |
|
Tip For best results, initiate chat on the files or code changes.
Your checks on the OpenSearch SDK call surface, the correct (•ㅅ•) ✏️ Learnings added
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Problem
Closes #1149 (review finding INF-01, P2).
Both AWS runtime Terraform modules (
terraform/modules/compute/aws/lambda/main.tf,terraform/modules/compute/aws/fargate/main.tf) granted only the legacy Elasticsearch-era reserved-instance actions:es:DescribeReservedElasticsearchInstanceses:DescribeReservedElasticsearchInstanceOfferingses:PurchaseReservedElasticsearchInstanceOfferingThe application uses the OpenSearch SDK (
opensearch.NewFromConfiginproviders/aws/services/opensearch/client.go), whoseDescribeReservedInstances,DescribeReservedInstanceOfferingsandPurchaseReservedInstanceOfferingoperations authorize against the distinct new-style action names. On any Terraform-deployed Lambda or Fargate runtime, host-account OpenSearch RI describe/offering/purchase calls returned AccessDenied. The parallel CloudFormation stack already grants the correct actions, confirming TF drift.Fix
Replace the three legacy actions with the new-style ones in both runtime modules, matching the CloudFormation stack:
es:DescribeReservedInstanceses:DescribeReservedInstanceOfferingses:PurchaseReservedInstanceOfferingAdded a regression test (
terraform/modules/compute/aws/iam_actions_test.go) that reads both runtime module files and fails if any legacyes:*ReservedElasticsearch*action is granted or any of the three required OpenSearch actions is missing.Out of scope, tracked separately:
es:AddTagsfor post-purchase tagging (INF-10) and the broader CFN/TF parity gate (INF-02).Test evidence
go test ./terraform/modules/compute/aws/-> 3 passed.go build ./...-> success;go vet ./terraform/...-> no issues.terraform fmt -check -recursive terraform/-> clean.cd terraform/environments/aws && terraform init -backend=false && terraform validate-> "The configuration is valid."