← Back to Pull requests

:seedling: Redefine managing IAM resources: Create and Delete #4909

Open
unknown opened this pull request with 343 lines diff across 4 files
View on GitHub
unknown unknown commented on Apr 04, 2024 21:10 UTC
Author

<!-- Thanks for this PR! If this is your first PR please read the [contributing guide](../CONTRIBUTING.md) -->
<!-- If this PR is still work-in-progress and is being open for visibility please prefix the title with WIP: -->

What type of PR is this?
/kind feature
/area clusterawsadm

<!--
Add one of the following kinds:
/kind feature
/kind bug
/kind api-change
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind flake
/kind regression
/kind support
-->

What this PR does / why we need it:
Currently, CAPA manages prerequisites required by AWS through CloudFormation which has caused numerous issues to CAPA end-users. This PR works as a stepping stone in migrating away from the use of AWS CloudFormation and relying on service specific API calls to manage IAM resources and gradually make the process idempotent.

This PR introduces 2 new commands and to enable them set the CLUSTERAWSADM_ALPHA environment variable to true.

1. clusterawsadm bootstrap iam create: creates IAM resources(roles, instances profiles and policies) from the bootstrap configuration file (uses default bootstrap configuration if not provided)
2. clusterawsadm bootstrap iam delete deletes IAM resources(roles, instances profiles and policies) created using the bootstrap configuration file (uses default bootstrap configuration if not provided)

<!-- Enter a description of the change and why this change is needed -->

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #3715

Special notes for your reviewer:
Screenshots:

<img width="1365" alt="Screenshot 2024-09-02 at 9 35 26 PM" src="https://github.com/user-attachments/assets/b7c0e5ec-6764-49fb-b92f-77568fa16e3f">

<img width="1340" alt="Screenshot 2024-09-02 at 9 37 03 PM" src="https://github.com/user-attachments/assets/37fa4386-1f6f-4197-ae48-6bc51b28783c">

Checklist:
<!-- Put an "X" character inside the brackets of each completed task. Some may be optional depending on the PR in which case these can be deleted -->

  • squashed commits

  • includes documentation

  • includes emojis

  • adds unit tests

  • adds or updates e2e tests
  • Release note:
    <!-- Write your release note:
    1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string "action required".
    3. If no release note is required, just write "NONE".
    -->
    ``release-note

    ``

    Diff: 343 lines (+257 / -86) across 4 files Reviewer: Atharva-Shinde Review duration: 1397185m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.49) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.49 · 343 lines diff across 4 files
    0.49
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.349
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #4909"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.3% (MEDIUM) · Higher = larger blast radius
    49.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.3% · Safe to merge
    27.3%