Skip to content

fix: add missing aws#362

Merged
jsbroks merged 1 commit intomainfrom
add-missing-aws-metadata
Mar 9, 2025
Merged

fix: add missing aws#362
jsbroks merged 1 commit intomainfrom
add-missing-aws-metadata

Conversation

@jsbroks
Copy link
Copy Markdown
Member

@jsbroks jsbroks commented Mar 9, 2025

Summary by CodeRabbit

  • New Features
    • Enhanced AWS cluster integration to capture more detailed account and role information.
    • Updated AWS cluster configuration now requires an explicit account identifier, improving validation and resource identification.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 9, 2025

Walkthrough

The changes update the conversion of an AWS EKS cluster into a Kubernetes resource and the corresponding validation schema. In the resource conversion, the identifier now directly uses the cluster ARN, and the config object explicitly includes the accountId. Additionally, metadata now records both the AWS account ID and the EKS role ARN. A new string property, accountId, is also added to the AWS EKS method in the Kubernetes validator, ensuring the provided configuration conforms to the updated structure.

Changes

File Change Summary
apps/event-worker/src/resource-scan/aws/eks.ts Updated convertEksClusterToKubernetesResource: identifier now uses cluster.arn; added accountId to the config; added metadata fields for aws/account-id and aws/eks-role-arn.
packages/validators/src/resources/kubernetes-v1.ts Added a new string property accountId to the AWS EKS method within the auth union of the clusterConfig object for schema validation.

Sequence Diagram(s)

(No sequence diagrams generated as the changes do not modify control flow.)

Possibly related PRs

  • feat: AWS VCP Scanner #275: This PR also introduces the accountId field in AWS EKS configurations, aligning closely with the modifications implemented here.

Poem

I’m a bunny hopping through the code,
New fields and schemas light the road.
ARN now leads the way so fine,
With account IDs that brightly shine.
EKS clusters in a joyful spree,
My rabbit smile says “code for me!” 🐰
Hop on to a brighter code day!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b536b8f and 0643356.

📒 Files selected for processing (2)
  • apps/event-worker/src/resource-scan/aws/eks.ts (3 hunks)
  • packages/validators/src/resources/kubernetes-v1.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{ts,tsx}`: **Note on Error Handling:** Avoid strict en...

**/*.{ts,tsx}: Note on Error Handling:
Avoid strict enforcement of try/catch blocks. Code may use early returns, Promise chains (.then().catch()), or other patterns for error handling. These are acceptable as long as they maintain clarity and predictability.

  • packages/validators/src/resources/kubernetes-v1.ts
  • apps/event-worker/src/resource-scan/aws/eks.ts
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Typecheck
  • GitHub Check: build (linux/amd64)
  • GitHub Check: Lint
🔇 Additional comments (4)
apps/event-worker/src/resource-scan/aws/eks.ts (3)

43-43: Good improvement on identifier format

Using the cluster ARN directly as the identifier is a better approach than constructing a string, as it provides a globally unique and standardized identifier for AWS resources.


52-52: Necessary addition of accountId

Adding the accountId to the auth config is essential to ensure proper AWS account association. This aligns with the validator schema changes and addresses the missing AWS information mentioned in the PR.


69-70: Enhanced metadata information

Adding the AWS account ID and EKS role ARN to the metadata enriches the resource representation with valuable context that can improve traceability and debugging.

packages/validators/src/resources/kubernetes-v1.ts (1)

27-27: Appropriate schema update for accountId validation

Adding the accountId as a required field in the AWS EKS authentication method schema ensures proper validation of this essential information. This change correctly aligns with the modifications made in the EKS resource conversion function.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jsbroks jsbroks merged commit fe10eff into main Mar 9, 2025
5 of 8 checks passed
@jsbroks jsbroks deleted the add-missing-aws-metadata branch March 9, 2025 03:35
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.

2 participants