Skip to content

feat: Expose the "architecture" variable #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025

Conversation

cmam
Copy link
Contributor

@cmam cmam commented May 22, 2025

what

why

  • Currently, the module works with ARM architecture by default ("arm64"). If anyone tries to specify a x86 AMI (e.g. an Ubuntu server), the following error is raised:
╷
│ Error: Resource precondition failed
│
│   on .terraform/modules/tailscale.tailscale_subnet_router/main.tf line 18, in resource "null_resource" "validate_instance_type":
│   18:       condition     = local.is_instance_compatible
│     ├────────────────
│     │ local.is_instance_compatible is false
│
│ The instance_type must be compatible with the specified architecture. For x86_64, you cannot use instance types with ARM processors (e.g., t3, m5, c5). For arm64, use instance types with 'g' indicating ARM processor (e.g., t4g, c6g,
│ m6g).

references

Summary by CodeRabbit

  • New Features
    • Added a configurable option to specify the architecture (e.g., x86_64, arm64) for the subnet router instance.
    • Default architecture is set to arm64, with the ability to override as needed.

@cmam cmam requested a review from a team as a code owner May 22, 2025 10:20
Copy link

coderabbitai bot commented May 22, 2025

Walkthrough

A new input variable named architecture has been introduced in the Terraform configuration. This variable, defined in variables.tf as a string with a default value of "arm64", is now passed into the tailscale_subnet_router module in main.tf. The change allows the architecture type (such as x86_64 or arm64) to be specified for the AMI used by the module, extending the module's configurability without altering any other logic or parameters.

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
variables.tf (1)

99-103: Add validation to enforce allowed architecture values.

Consider adding a validation block to restrict var.architecture to supported values ("x86_64" and "arm64") and catch invalid configurations at plan time.
Example addition:

variable "architecture" {
  default     = "arm64"
  type        = string
  description = "The architecture of the AMI (e.g., x86_64, arm64)"

  validation {
    condition     = contains(["x86_64", "arm64"], var.architecture)
    error_message = "Architecture must be one of \"x86_64\" or \"arm64\"."
  }
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 46c7571 and 7685068.

📒 Files selected for processing (2)
  • main.tf (1 hunks)
  • variables.tf (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.tf`: You're a Terraform expert who has thoroughly studied all the documentation from Hashicorp https://developer.hashicorp.com/terraform/docs and OpenTofu https://opentofu.or...

**/*.tf: You're a Terraform expert who has thoroughly studied all the documentation from Hashicorp https://developer.hashicorp.com/terraform/docs and OpenTofu https://opentofu.org/docs/.
You have a strong grasp of Terraform syntax and prioritize providing accurate and insightful code suggestions.
As a fan of the Cloud Posse / SweetOps ecosystem, you incorporate many of their best practices https://docs.cloudposse.com/best-practices/terraform/ while balancing them with general Terraform guidelines.

  • variables.tf
  • main.tf
🔇 Additional comments (1)
main.tf (1)

58-58: Verify module version supports the new input.

Double-check that masterpointio/ssm-agent/aws at version = "1.4.0" declares an architecture variable. If support was added in a later release, bump the version to prevent plan errors.

@oycyc oycyc changed the title Expose the "architecture" variable feat: Expose the "architecture" variable May 22, 2025
Copy link
Contributor

@oycyc oycyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🙌

@oycyc oycyc merged commit 8662e72 into masterpointio:main May 22, 2025
5 of 6 checks passed
oycyc pushed a commit that referenced this pull request May 22, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.8.0](v1.7.0...v1.8.0)
(2025-05-22)


### Features

* Expose the "architecture" variable
([#58](#58))
([8662e72](8662e72))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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