Skip to content

Conversation

@aditya-facets
Copy link
Contributor

@aditya-facets aditya-facets commented Jul 11, 2025

Description

Related issues

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have created feat/bugfix branch out of develop branch
  • Code passes linting/formatting checks
  • Changes to resources have been tested in our dev environments
  • I have made corresponding changes to the documentation

Testing

Reviewer instructions

Summary by CodeRabbit

  • New Features
    • Added cloud account manager modules for AWS, Azure, and GCP to provision and manage cloud accounts.
    • New standardized outputs exposing cloud account attributes (region/project/subscription) per provider.
    • UI integration for selecting/linking cloud accounts with provider-specific options.
    • Secure retrieval and marking of sensitive credentials for all three providers.
    • Includes sample configurations and basic IaC validation for each provider.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 11, 2025

Walkthrough

Adds new cloud-account output facets for AWS, Azure, and GCP and provider-specific cloud_account modules (v1.0) that include Terraform variables, external data sources calling a secret-fetcher script, local output mappings of sensitive attributes, and UI wiring to provider plugins.

Changes

Cohort / File(s) Change Summary
Output facets
outputs/aws_cloud_account/output.facets.yaml, outputs/azure_cloud_account/output.facets.yaml, outputs/gcp_cloud_account/output.facets.yaml
New output facet schemas for AWS, Azure, and GCP defining Cloud Account attributes (AWS: aws_iam_role, session_name, external_id, aws_region; Azure: subscription_id, client_id, client_secret, tenant_id; GCP: project, credentials).
AWS provider module
modules/cloud_account/aws_provider/1.0/facets.yaml, .../locals.tf, .../outputs.tf, .../variables.tf
New AWS cloud_account module v1.0: facet spec and UI config, external data "external" invoking secret-fetcher.py for AWS, locals mapping sensitive attributes and generated session_name, variables, outputs mapping to HashiCorp AWS provider, and IaC validation reference.
Azure provider module
modules/cloud_account/azure_provider/1.0/facets.yaml, .../locals.tf, .../outputs.tf, .../variables.tf
New Azure cloud_account module v1.0: facet spec and UI account lookup, external data "external" invoking secret-fetcher.py for AZURE, locals exposing sensitive credential attributes, variables, outputs configured for azurerm/azapi providers, and IaC validation reference.
GCP provider module
modules/cloud_account/gcp_provider/1.0/facets.yaml, .../locals.tf, .../outputs.tf, .../variables.tf
New GCP cloud_account module v1.0: facet spec and UI account lookup, external data "external" invoking secret-fetcher.py for GCP, locals mapping project and sensitive credentials, variables, outputs configured for Google provider, and IaC validation reference.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Module
    participant SecretScript as secret-fetcher.py
    participant Provider

    User->>Module: supply cloud_account (and region/config)
    Module->>SecretScript: run script with (cloud_account, PROVIDER)
    SecretScript-->>Module: return JSON attributes (sensitive)
    Module->>Provider: configure provider (map attributes -> provider config)
    Module-->>User: expose output facet with attributes (sensitive marked)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • rr0hit
  • anshulsao
  • vishnukv-facets
  • pramodh-ayyappan
  • unni-facets
  • mbhandari31

Poem

I nudge a script, nibble a key,
AWS, Azure, GCP — secrets for me.
YAML hops, UUIDs hum,
Outputs tidy, ready to run.
A carrot-deployed cloud, happy as can be. 🐇☁️


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fea82f6 and 6e4c3c2.

📒 Files selected for processing (1)
  • modules/cloud_account/azure_provider/1.0/facets.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • modules/cloud_account/azure_provider/1.0/facets.yaml
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cloudaccount-form

🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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
Contributor

@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: 13

♻️ Duplicate comments (3)
modules/cloud_account/azure-cloudaccount/0.1/locals.tf (1)

1-8: Same portability issue as GCP module – avoid absolute paths

See previous comment; the Azure module hard-codes the same absolute path. Use path.module or another relative mechanism so that consumers don’t need to replicate your directory structure.

modules/cloud_account/gcp-cloudaccount/0.1/variables.tf (1)

1-20: Repeat: strengthen variable types

See the AWS comment – adopt concrete object types rather than any to catch schema drift early.

modules/cloud_account/azure-cloudaccount/0.1/variables.tf (1)

1-20: Repeat: strengthen variable types

See the AWS comment – adopt concrete object types rather than any to catch schema drift early.

🧹 Nitpick comments (4)
modules/cloud_account/azure/0.1/facets.yaml (1)

34-51: Heavy duplication – factor with YAML anchors to keep the facet DRY

Each provider block repeats identical attribute mappings. You can cut the file size and future maintenance effort by defining the common mapping once and re-using it via YAML anchors/aliases:

  attributes_template: &az_attrs
    features: {}
    subscription_id: attributes.subscription_id
    client_id: attributes.client_id
    client_secret: attributes.client_secret
    tenant_id: attributes.tenant_id

  providers:
    azurerm3_116_0:
      source: hashicorp/azurerm
      version: 3.116.0
      attributes: *az_attrs
modules/cloud_account/gcp-cloudaccount/0.1/outputs.tf (1)

1-11: project probably isn’t a secret—double-check what actually needs redaction

Placing "project" in the secrets list hides it from logs/outputs even though the GCP project ID is rarely sensitive. Hiding non-sensitive data hampers operability (e.g. debugging). Consider restricting secrets to truly confidential keys (credentials).

modules/cloud_account/aws-cloudaccount/0.1/variables.tf (1)

1-20: Loosened any typing loses validation – define object schemas

All four variables are typed any; Terraform loses static validation and IDE autocompletion. Declare explicit object types so errors surface early, e.g.:

-variable "instance" {
-  type = any
-}
+variable "instance" {
+  type = object({
+    spec = object({
+      cloud_account = string
+      region        = string
+    })
+  })
+  description = "CRD instance carrying cloud account and region details"
+}

Apply the same tightening for environment and inputs where possible.

modules/cloud_account/gcp-cloudaccount/0.1/facets.yaml (1)

31-34: x-ui-order lists only cloud_account; consider adding any future inputs now.

If additional inputs (e.g., project, region) are likely, pre-ordering them here avoids a breaking UI change later.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7070ebc and 489bdf4.

📒 Files selected for processing (13)
  • modules/cloud_account/aws-cloudaccount/0.1/facets.yaml (1 hunks)
  • modules/cloud_account/aws-cloudaccount/0.1/locals.tf (1 hunks)
  • modules/cloud_account/aws-cloudaccount/0.1/outputs.tf (1 hunks)
  • modules/cloud_account/aws-cloudaccount/0.1/variables.tf (1 hunks)
  • modules/cloud_account/azure-cloudaccount/0.1/facets.yaml (1 hunks)
  • modules/cloud_account/azure-cloudaccount/0.1/locals.tf (1 hunks)
  • modules/cloud_account/azure-cloudaccount/0.1/outputs.tf (1 hunks)
  • modules/cloud_account/azure-cloudaccount/0.1/variables.tf (1 hunks)
  • modules/cloud_account/azure/0.1/facets.yaml (2 hunks)
  • modules/cloud_account/gcp-cloudaccount/0.1/facets.yaml (1 hunks)
  • modules/cloud_account/gcp-cloudaccount/0.1/locals.tf (1 hunks)
  • modules/cloud_account/gcp-cloudaccount/0.1/outputs.tf (1 hunks)
  • modules/cloud_account/gcp-cloudaccount/0.1/variables.tf (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
modules/cloud_account/aws-cloudaccount/0.1/variables.tf (1)
Learnt from: sanmesh-kakade
PR: Facets-cloud/facets-modules#393
File: modules/mongo_user/default/0.3/main.tf:63-110
Timestamp: 2025-06-03T11:10:34.578Z
Learning: In the mongo_user module at modules/mongo_user/default/0.3/, the inputs variable is properly declared with type object containing mongo_details.interfaces.writer.connection_string structure, making var.inputs.mongo_details.interfaces.writer.connection_string a valid reference.
modules/cloud_account/azure-cloudaccount/0.1/variables.tf (1)
Learnt from: sanmesh-kakade
PR: Facets-cloud/facets-modules#393
File: modules/mongo_user/default/0.3/main.tf:63-110
Timestamp: 2025-06-03T11:10:34.578Z
Learning: In the mongo_user module at modules/mongo_user/default/0.3/, the inputs variable is properly declared with type object containing mongo_details.interfaces.writer.connection_string structure, making var.inputs.mongo_details.interfaces.writer.connection_string a valid reference.
modules/cloud_account/gcp-cloudaccount/0.1/variables.tf (1)
Learnt from: sanmesh-kakade
PR: Facets-cloud/facets-modules#393
File: modules/mongo_user/default/0.3/main.tf:63-110
Timestamp: 2025-06-03T11:10:34.578Z
Learning: In the mongo_user module at modules/mongo_user/default/0.3/, the inputs variable is properly declared with type object containing mongo_details.interfaces.writer.connection_string structure, making var.inputs.mongo_details.interfaces.writer.connection_string a valid reference.
🔇 Additional comments (3)
modules/cloud_account/azure/0.1/facets.yaml (1)

34-51: Verify Terraform alias naming for provider map keys

The keys azurerm3-105-0 and azurerm3-116-0 in modules/cloud_account/azure/0.1/facets.yaml (lines 34–51) contain hyphens, which Terraform disallows in alias identifiers (only letters, digits and underscores are permitted).

Please confirm whether these YAML keys are ever used directly as provider "azurerm" { alias = "<key>" }.
If so, rename them (e.g. azurerm3_105_0, azurerm3_116_0) to avoid Terraform syntax errors.

modules/cloud_account/aws-cloudaccount/0.1/outputs.tf (1)

4-7: Verify that local.script_output actually contains aws_region

local.script_output is referenced for aws_region, but the locals file isn’t shown here. Make sure the external script returns that key; otherwise this will be null and may cascade into provider mis-configuration.

modules/cloud_account/aws-cloudaccount/0.1/locals.tf (1)

13-15: Key casing mismatch may break JSON lookup

iamRole / externalId camel-case assumes the Python script returns those exact keys. Confirm the script output; most AWS IAM examples use iam_role, external_id. A mismatch gives null locals and downstream failures.

azurerm:
source: hashicorp/azurerm
version: 2.52.0
version: 2.99.0
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

azurerm v2 is effectively end-of-life – consider migrating to v3 for consistency

You bumped to 2.99.0 but the same facet now lists multiple v3 variants below. Mixing provider major versions can trip up dependency resolution and forces consumers to learn two provider blocks. Unless there is a hard blocker, migrate the main azurerm entry to v3.116.0 and drop the v2 stanza.


🏁 Script executed:

#!/bin/bash
# Display versions listed in the facets.yaml to verify v2 and v3 entries
grep -n 'version:' modules/cloud_account/azure/0.1/facets.yaml
echo "----- Context around line 18 -----"
sed -n '1,50p' modules/cloud_account/azure/0.1/facets.yaml | nl -ba | sed -n '1,50p'

Length of output: 464


Ensure Consistent Azure Provider Versioning – Migrate to v3

File: modules/cloud_account/azure/0.1/facets.yaml
Primary version (line 18) is set to v2.99.0, but downstream variants include v3.52.0, v3.105.0, and v3.116.0. Mixing major versions can introduce dependency-resolution conflicts and requires consumers to define two provider blocks. To streamline usage and avoid breaking changes:

• Update the primary version on line 18 to the latest v3 variant.
• Remove the v2.99.0 stanza entirely.

Suggested diff:

--- a/modules/cloud_account/azure/0.1/facets.yaml
+++ b/modules/cloud_account/azure/0.1/facets.yaml
@@ line 18
-        version: 2.99.0
+        version: 3.116.0
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
version: 2.99.0
version: 3.116.0
🤖 Prompt for AI Agents
In modules/cloud_account/azure/0.1/facets.yaml at line 18, the version is set to
2.99.0, which conflicts with downstream v3 versions. Update this primary version
to the latest v3 variant used downstream and remove the entire v2.99.0 stanza to
ensure consistent Azure provider versioning and avoid dependency conflicts.

Comment on lines 1 to 8
data "external" "gcp_fetch_cloud_secret" {
program = [
"python3",
"/sources/primary/capillary-cloud-tf/tfmain/scripts/cloudaccount-fetch-secret/secret-fetcher.py",
var.instance.spec.cloud_account,
"GCP"
]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Absolute script path breaks module portability

Hard-coding /sources/primary/.../secret-fetcher.py ties the module to one repository layout and prevents reuse from other directories or Terraform registries.
Prefer a path relative to the module root:

program = [
  "python3",
  "${path.module}/scripts/secret-fetcher.py",
  var.instance.spec.cloud_account,
  "GCP",
]
🤖 Prompt for AI Agents
In modules/cloud_account/gcp-cloudaccount/0.1/locals.tf lines 1 to 8, the script
path for the external data source is hard-coded with an absolute path, which
reduces module portability. Replace the absolute path with a relative path using
the Terraform variable ${path.module} to reference the module root directory,
updating the program array to use
"${path.module}/scripts/cloudaccount-fetch-secret/secret-fetcher.py" instead of
the fixed absolute path.

Comment on lines 4 to 7
aws_iam_role = sensitive(local.script_output.aws_iam_role)
session_name = "capillary-cloud-tf-${uuid()}"
external_id = sensitive(local.script_output.external_id)
aws_region = local.script_output.aws_region
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Using uuid() causes perpetual diffs

uuid() returns a new value on every plan/apply, so session_name will constantly change and force downstream resources (or outputs) to replace.
If you only need uniqueness per cloud-account, derive a stable ID (e.g. uuidv5(var.instance.spec.cloud_account, "capillary")) or drop the random suffix entirely.

🤖 Prompt for AI Agents
In modules/cloud_account/aws-cloudaccount/0.1/outputs.tf around lines 4 to 7,
the use of uuid() in session_name causes it to change on every plan/apply,
leading to perpetual diffs. Replace uuid() with a stable unique identifier such
as uuidv5 using a consistent input like var.instance.spec.cloud_account combined
with a namespace string "capillary" to ensure session_name remains stable across
runs.

Comment on lines 17 to 18
## facetsdemo/backend/accounts/667d6782d4f4f200072d621f
## 7d811b1e-b652-4e7c-9902-08c3fa2b5039 No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove hard-coded tenant/account identifiers – leaks internal data

These two comment lines expose real resource IDs / GUIDs that look like internal tenancy or subscription identifiers. Keeping them in VCS is a direct PII / security leak and breaks the principle of least disclosure.

-## facetsdemo/backend/accounts/667d6782d4f4f200072d621f
-## 7d811b1e-b652-4e7c-9902-08c3fa2b5039

Delete them before merging (and consider a history rewrite to keep them out of the git history).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## facetsdemo/backend/accounts/667d6782d4f4f200072d621f
## 7d811b1e-b652-4e7c-9902-08c3fa2b5039
🤖 Prompt for AI Agents
In modules/cloud_account/azure-cloudaccount/0.1/outputs.tf at lines 17 to 18,
remove the two comment lines containing hard-coded tenant or account identifiers
to prevent leaking internal resource IDs or GUIDs. Delete these lines entirely
before merging, and consider rewriting the git history to remove these sensitive
details from previous commits.

Comment on lines 1 to 15
locals {
output_interfaces = {}
output_attributes = {
subscription_id = sensitive(data.external.azure_fetch_cloud_secret.result["subscription_id"])
client_id = sensitive(data.external.azure_fetch_cloud_secret.result["client_id"])
client_secret = sensitive(data.external.azure_fetch_cloud_secret.result["client_secret"])
tenant_id = sensitive(data.external.azure_fetch_cloud_secret.result["tenant_id"])
secrets = [
"subscription_id",
"client_id",
"client_secret",
"tenant_id",
]
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Module defines only locals – no output blocks published

Down-stream modules/workflows cannot reference subscription_id, client_id, etc. unless they are surfaced via output blocks (or a Facets-specific mechanism I might have missed). Double-check that the consuming layer actually sees local.output_attributes; otherwise add explicit outputs:

+output "output_attributes" {
+  description = "Sensitive Azure account attributes"
+  value       = local.output_attributes
+  sensitive   = true
+}

🏁 Script executed:

#!/bin/bash
set -e
# Check for any defined Terraform output blocks in the outputs.tf file
rg "^\s*output" -n modules/cloud_account/azure-cloudaccount/0.1/outputs.tf || echo "No output blocks found in outputs.tf"

Length of output: 138


Add missing Terraform output blocks for Azure credentials

The module currently only defines local values and does not publish any output blocks, so downstream modules cannot reference subscription_id, client_id, etc. Please add explicit outputs, for example:

+output "output_attributes" {
+  description = "Sensitive Azure account attributes"
+  value       = local.output_attributes
+  sensitive   = true
+}

• File: modules/cloud_account/azure-cloudaccount/0.1/outputs.tf
• Lines: after the existing locals { … } block

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
locals {
output_interfaces = {}
output_attributes = {
subscription_id = sensitive(data.external.azure_fetch_cloud_secret.result["subscription_id"])
client_id = sensitive(data.external.azure_fetch_cloud_secret.result["client_id"])
client_secret = sensitive(data.external.azure_fetch_cloud_secret.result["client_secret"])
tenant_id = sensitive(data.external.azure_fetch_cloud_secret.result["tenant_id"])
secrets = [
"subscription_id",
"client_id",
"client_secret",
"tenant_id",
]
}
}
locals {
output_interfaces = {}
output_attributes = {
subscription_id = sensitive(data.external.azure_fetch_cloud_secret.result["subscription_id"])
client_id = sensitive(data.external.azure_fetch_cloud_secret.result["client_id"])
client_secret = sensitive(data.external.azure_fetch_cloud_secret.result["client_secret"])
tenant_id = sensitive(data.external.azure_fetch_cloud_secret.result["tenant_id"])
secrets = [
"subscription_id",
"client_id",
"client_secret",
"tenant_id",
]
}
}
output "output_attributes" {
description = "Sensitive Azure account attributes"
value = local.output_attributes
sensitive = true
}
🤖 Prompt for AI Agents
In modules/cloud_account/azure-cloudaccount/0.1/outputs.tf after the existing
locals block (lines 1-15), add explicit Terraform output blocks for
subscription_id, client_id, client_secret, and tenant_id. Each output should
reference the corresponding local.output_attributes value wrapped with the
sensitive() function to ensure these credentials are exposed properly for
downstream modules while maintaining their sensitivity.

Comment on lines 8 to 10
description: Module to configure and provision resources within a cloud account
(AWS, GCP, Azure)
properties:
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Same YAML breakage as GCP file.

The description is split without a literal block. This renders invalid YAML.

-  description: Module to configure and provision resources within a cloud account
-    (AWS, GCP, Azure)
+  description: |
+    Module to configure and provision resources within an AWS cloud account
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description: Module to configure and provision resources within a cloud account
(AWS, GCP, Azure)
properties:
description: |
Module to configure and provision resources within an AWS cloud account
properties:
🤖 Prompt for AI Agents
In modules/cloud_account/aws-cloudaccount/0.1/facets.yaml around lines 8 to 10,
the description field is split across multiple lines without using a proper YAML
multiline syntax, causing invalid YAML. Fix this by using a literal block scalar
(|) or folded style (>) to properly format the multiline description so it is
valid YAML.

Comment on lines 56 to 63
attributes:
region: attributes.aws_region
skip_region_validation: true
attributes:
assume_role:
role_arn: attributes.aws_iam_role
session_name: attributes.session_name
external_id: attributes.external_id
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Nested attributes: key will be ignored – flatten the map.

Provider blocks expect a single‐level map; the inner attributes: key makes assume_role unreachable.

-          region: attributes.aws_region
-          skip_region_validation: true
-          attributes:
-            assume_role:
-              role_arn: attributes.aws_iam_role
-              session_name: attributes.session_name
-              external_id: attributes.external_id
+          region: attributes.aws_region
+          skip_region_validation: true
+          assume_role:
+            role_arn: attributes.aws_iam_role
+            session_name: attributes.session_name
+            external_id: attributes.external_id
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
attributes:
region: attributes.aws_region
skip_region_validation: true
attributes:
assume_role:
role_arn: attributes.aws_iam_role
session_name: attributes.session_name
external_id: attributes.external_id
attributes:
region: attributes.aws_region
skip_region_validation: true
assume_role:
role_arn: attributes.aws_iam_role
session_name: attributes.session_name
external_id: attributes.external_id
🤖 Prompt for AI Agents
In modules/cloud_account/aws-cloudaccount/0.1/facets.yaml around lines 56 to 63,
the nested 'attributes:' key inside the 'attributes' map causes the inner
'assume_role' block to be ignored. To fix this, remove the inner 'attributes:'
key and directly place 'assume_role' and its children at the same level as
'region' and 'skip_region_validation' within the top-level 'attributes' map,
ensuring a flat map structure.

Comment on lines 53 to 55
aws593:
source: hashicorp/aws593
version: = 5.93.0
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Incorrect provider version syntax.

version: = 5.93.0 is not valid Terraform notation; omit the =.

-        version: = 5.93.0
+        version: 5.93.0
🤖 Prompt for AI Agents
In modules/cloud_account/aws-cloudaccount/0.1/facets.yaml at lines 53 to 55, the
provider version syntax is incorrect because it uses 'version: = 5.93.0'. Remove
the '=' sign so that the version line reads 'version: 5.93.0' to comply with
valid Terraform notation.

Comment on lines 40 to 41
- cloud_provider
- cloud_account
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

cloud_provider is ordered but not defined.

Drop the entry or add the property to avoid UI errors.

-  - cloud_provider
   - cloud_account
🤖 Prompt for AI Agents
In modules/cloud_account/azure-cloudaccount/0.1/facets.yaml at lines 40 to 41,
the property 'cloud_provider' is listed in the order but is not defined in the
schema. To fix this, either remove 'cloud_provider' from the order list or
define the 'cloud_provider' property properly in the facets.yaml file to prevent
UI errors.

Comment on lines 50 to 54
features: {}
subscription_id: attributes.subscription_id
client_id: attributes.client_id
client_secret: attributes.client_secret
tenant_id: attributes.tenant_id
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Provider features block is misplaced.

features {} belongs at the root of the provider config, not under attributes. Move it out so Terraform can parse it.

-          features: {}
           subscription_id: attributes.subscription_id
           client_id: attributes.client_id
           client_secret: attributes.client_secret
           tenant_id: attributes.tenant_id
+        features: {}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
features: {}
subscription_id: attributes.subscription_id
client_id: attributes.client_id
client_secret: attributes.client_secret
tenant_id: attributes.tenant_id
subscription_id: attributes.subscription_id
client_id: attributes.client_id
client_secret: attributes.client_secret
tenant_id: attributes.tenant_id
features: {}
🤖 Prompt for AI Agents
In modules/cloud_account/azure-cloudaccount/0.1/facets.yaml around lines 50 to
54, the features block is incorrectly placed under attributes. Move the
features: {} block to the root level of the provider configuration, outside and
above the attributes section, so Terraform can correctly parse it.

Copy link
Collaborator

@ishaankalra ishaankalra left a comment

Choose a reason for hiding this comment

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

There is already a cloud account module in this repo. Update the form in the existin file itself. Also follow the convention intent/flavor/version.

Copy link
Contributor

@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: 1

♻️ Duplicate comments (1)
modules/cloud_account/gcp/0.2/locals.tf (1)

3-4: Same path-hard-coding issue as Azure module
The absolute script path limits portability; please apply the same fix recommended for the Azure variant (use path.module or a variable).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 489bdf4 and 1254ac7.

📒 Files selected for processing (12)
  • modules/cloud_account/aws/0.2/facets.yaml (1 hunks)
  • modules/cloud_account/aws/0.2/locals.tf (1 hunks)
  • modules/cloud_account/aws/0.2/outputs.tf (1 hunks)
  • modules/cloud_account/aws/0.2/variables.tf (1 hunks)
  • modules/cloud_account/azure/0.2/facets.yaml (1 hunks)
  • modules/cloud_account/azure/0.2/locals.tf (1 hunks)
  • modules/cloud_account/azure/0.2/outputs.tf (1 hunks)
  • modules/cloud_account/azure/0.2/variables.tf (1 hunks)
  • modules/cloud_account/gcp/0.2/facets.yaml (1 hunks)
  • modules/cloud_account/gcp/0.2/locals.tf (1 hunks)
  • modules/cloud_account/gcp/0.2/outputs.tf (1 hunks)
  • modules/cloud_account/gcp/0.2/variables.tf (1 hunks)
✅ Files skipped from review due to trivial changes (10)
  • modules/cloud_account/aws/0.2/variables.tf
  • modules/cloud_account/aws/0.2/facets.yaml
  • modules/cloud_account/gcp/0.2/variables.tf
  • modules/cloud_account/gcp/0.2/outputs.tf
  • modules/cloud_account/azure/0.2/variables.tf
  • modules/cloud_account/azure/0.2/facets.yaml
  • modules/cloud_account/aws/0.2/outputs.tf
  • modules/cloud_account/aws/0.2/locals.tf
  • modules/cloud_account/azure/0.2/outputs.tf
  • modules/cloud_account/gcp/0.2/facets.yaml
🔇 Additional comments (2)
modules/cloud_account/azure/0.2/locals.tf (1)

1-8: Double-check secret handling – mark outputs as sensitive
external will surface the fetched JSON in state files and potentially in terraform plan. Make sure every downstream output that exposes values from data.external.azure_fetch_cloud_secret is declared with sensitive = true, otherwise credentials can leak.

modules/cloud_account/gcp/0.2/locals.tf (1)

1-8: Ensure GCP secrets stay protected
Confirm that any outputs or locals derived from data.external.gcp_fetch_cloud_secret are flagged sensitive = true to avoid leaking key material.

Comment on lines 3 to 4
"python3",
"/sources/primary/capillary-cloud-tf/tfmain/scripts/cloudaccount-fetch-secret/secret-fetcher.py",
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Hard-coded absolute path makes the module non-portable
Relying on /sources/primary/.../secret-fetcher.py ties the module to a very specific directory layout and breaks when the repo is checked out elsewhere (e.g. CI runners, downstream consumers, Windows paths).

-    "/sources/primary/capillary-cloud-tf/tfmain/scripts/cloudaccount-fetch-secret/secret-fetcher.py",
+    abspath("${path.module}/../../../../scripts/cloudaccount-fetch-secret/secret-fetcher.py"),

or, better, expose the path via a variable (var.secret_fetcher_path) with a sane default using path.module.
This keeps the module self-contained and friendly to external reuse.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"python3",
"/sources/primary/capillary-cloud-tf/tfmain/scripts/cloudaccount-fetch-secret/secret-fetcher.py",
"python3",
abspath("${path.module}/../../../../scripts/cloudaccount-fetch-secret/secret-fetcher.py"),
🤖 Prompt for AI Agents
In modules/cloud_account/azure/0.2/locals.tf around lines 3 to 4, the path to
secret-fetcher.py is hard-coded as an absolute path, making the module
non-portable. Replace the hard-coded path with a variable (e.g.,
var.secret_fetcher_path) that has a default value constructed using path.module
to build a relative path to the script. This change will make the module
self-contained and portable across different environments.

@@ -0,0 +1,9 @@
data "external" "azure_fetch_cloud_secret" {
program = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we have this script in the iac repositort and not here?

default:
type: '@outputs/cloud_account'
providers:
aws593:
Copy link
Collaborator

Choose a reason for hiding this comment

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

havce aws 6.3.0

Copy link
Collaborator

@ishaankalra ishaankalra left a comment

Choose a reason for hiding this comment

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

added upgraded providers here

Copy link
Contributor

@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: 2

🧹 Nitpick comments (5)
outputs/azure_cloudaccount/output.facets.yaml (1)

23-23: Add a trailing newline

Several CI linters (YAMLlint, git diff-display, etc.) flag missing EOF newlines.

-          description: "Azure tenant ID. [Sensitive]"
+\          description: "Azure tenant ID. [Sensitive]"
+
outputs/gcp_cloudaccount/output.facets.yaml (2)

7-8: attributes is null – specify or remove

Same concern as the Azure facet: either define it as an object or delete it to avoid ambiguous schemas.


17-17: Add trailing newline

-            description: "GCP service account key. [Sensitive]"
+\            description: "GCP service account key. [Sensitive]"
+
outputs/aws_cloudaccount/output.facets.yaml (2)

7-8: Define or drop the empty attributes key

As with the other facets, leaving attributes: without a schema may confuse validation tools.

-    attributes:
+    attributes:
+      type: object
+      description: Additional generic attributes for the cloud account

23-23: Add trailing newline

-          description: "AWS region of the cluster."
+\          description: "AWS region of the cluster."
+
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b14666e and 13fe625.

📒 Files selected for processing (9)
  • modules/cloud_account/aws/0.1/facets.yaml (1 hunks)
  • modules/cloud_account/aws/0.2/facets.yaml (1 hunks)
  • modules/cloud_account/azure/0.1/facets.yaml (2 hunks)
  • modules/cloud_account/azure/0.2/facets.yaml (1 hunks)
  • modules/cloud_account/gcp/0.1/facets.yaml (1 hunks)
  • modules/cloud_account/gcp/0.2/facets.yaml (1 hunks)
  • outputs/aws_cloudaccount/output.facets.yaml (1 hunks)
  • outputs/azure_cloudaccount/output.facets.yaml (1 hunks)
  • outputs/gcp_cloudaccount/output.facets.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • modules/cloud_account/azure/0.1/facets.yaml
  • modules/cloud_account/gcp/0.2/facets.yaml
  • modules/cloud_account/aws/0.2/facets.yaml
  • modules/cloud_account/azure/0.2/facets.yaml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
outputs/aws_cloudaccount/output.facets.yaml

[error] 23-23: no new line character at the end of file

(new-line-at-end-of-file)

outputs/azure_cloudaccount/output.facets.yaml

[error] 23-23: no new line character at the end of file

(new-line-at-end-of-file)

outputs/gcp_cloudaccount/output.facets.yaml

[warning] 12-12: wrong indentation: expected 8 but found 10

(indentation)


[error] 17-17: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (2)
modules/cloud_account/gcp/0.1/facets.yaml (1)

15-23: Ensure new output facet exposes region referenced by providers

Providers still map region: attributes.region, but the newly-referenced @outputs/gcp_cloud_account only defines project and credentials under interfaces.

Either (a) add region to the facet, or (b) confirm that downstream code consumes it from a different place. A mismatch will surface at plan/apply time.

modules/cloud_account/aws/0.1/facets.yaml (1)

15-23: Change looks good – facet and providers stay in sync

The switch to @outputs/aws_cloud_account matches the properties consumed by the provider configurations (aws_region, aws_iam_role, etc.). No further action required.

Comment on lines 7 to 8
attributes:
interfaces:
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

attributes key is left undefined – add a schema or drop it

Leaving the attributes: key with a null value makes the schema ambiguous and can trigger validation failures in tooling that expects a fully-typed object.

-    attributes:
+    attributes:
+      type: object
+      description: Additional generic attributes for the cloud account
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
attributes:
interfaces:
attributes:
type: object
description: Additional generic attributes for the cloud account
interfaces:
🤖 Prompt for AI Agents
In outputs/azure_cloudaccount/output.facets.yaml at lines 7 to 8, the attributes
key is present but undefined, which can cause schema ambiguity and validation
errors. To fix this, either define a proper schema for the attributes key or
remove the attributes key entirely if it is not needed, ensuring the YAML schema
remains clear and valid.

Comment on lines 12 to 17
project:
type: string
description: "GCP project ID fetched from external data source."
credentials:
type: string
description: "GCP service account key. [Sensitive]" No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Fix indentation & align with schema conventions

The extra two-space indent under properties: breaks YAML parsing (expected 8 but found 10). While touching this, also keep the attributes placeholder consistent.

-          project:
-            type: string
-            description: "GCP project ID fetched from external data source."
-          credentials:
-            type: string
-            description: "GCP service account key. [Sensitive]"
+        project:
+          type: string
+          description: "GCP project ID fetched from external data source."
+        credentials:
+          type: string
+          description: "GCP service account key. [Sensitive]"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
project:
type: string
description: "GCP project ID fetched from external data source."
credentials:
type: string
description: "GCP service account key. [Sensitive]"
project:
type: string
description: "GCP project ID fetched from external data source."
credentials:
type: string
description: "GCP service account key. [Sensitive]"
🧰 Tools
🪛 YAMLlint (1.37.1)

[warning] 12-12: wrong indentation: expected 8 but found 10

(indentation)


[error] 17-17: no new line character at the end of file

(new-line-at-end-of-file)

🤖 Prompt for AI Agents
In outputs/gcp_cloudaccount/output.facets.yaml around lines 12 to 17, the
indentation under properties is incorrect, causing YAML parsing errors. Adjust
the indentation of the project and credentials fields to align with the expected
8 spaces under properties, removing the extra two spaces. Also, ensure the
attributes placeholder follows the same indentation and schema conventions for
consistency.

@@ -0,0 +1,83 @@
intent: cloud_account
Copy link
Collaborator

Choose a reason for hiding this comment

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

@mbhandari31 can you please check if any customer is using cloud_account

Copy link
Collaborator

Choose a reason for hiding this comment

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

@aditya-facets make use of the below suggestions for flavor and version. also as part of this directory structure will also change

- region
outputs:
default:
type: '@outputs/cloud_account'
Copy link
Collaborator

Choose a reason for hiding this comment

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

change the output type

Suggested change
type: '@outputs/cloud_account'
type: '@facets/aws_cloud_account'

default:
type: '@outputs/cloud_account'
providers:
azurerm3-116-0:
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove this provider

project: attributes.project
region: attributes.region
credentials: attributes.credentials
google5:
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove this provider

external_id = sensitive(local.script_output.external_id)
aws_region = local.script_output.aws_region
secrets = [
"aws_iam_role",
Copy link
Collaborator

Choose a reason for hiding this comment

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

not a secret

aws_region = local.script_output.aws_region
secrets = [
"aws_iam_role",
"session_name",
Copy link
Collaborator

Choose a reason for hiding this comment

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

not a secret

client_secret = sensitive(data.external.azure_fetch_cloud_secret.result["client_secret"])
tenant_id = sensitive(data.external.azure_fetch_cloud_secret.result["tenant_id"])
secrets = [
"subscription_id",
Copy link
Collaborator

Choose a reason for hiding this comment

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

except client_secret all others are not secret so remove it

}
}

## facetsdemo/backend/accounts/667d6782d4f4f200072d621f
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove these comments

@pramodh-ayyappan
Copy link
Collaborator

use mcp to validate all the modules which will include a attribute in facets.yaml so that we are aware that you have validated the modules using ftf

@@ -0,0 +1,72 @@
intent: cloud_account
flavor: aws
version: '0.2'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
version: '0.2'
version: '1.0'

@@ -0,0 +1,72 @@
intent: cloud_account
flavor: aws
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
flavor: aws
flavor: aws_provider

@@ -0,0 +1,83 @@
intent: cloud_account
Copy link
Collaborator

Choose a reason for hiding this comment

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

@aditya-facets make use of the below suggestions for flavor and version. also as part of this directory structure will also change

intent: cloud_account
alias-flavors:
- default
flavor: azure
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
flavor: azure
flavor: azure_provider

- default
flavor: azure
lifecycle: ENVIRONMENT
version: '0.2'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
version: '0.2'
version: '1.0'

Copy link
Contributor

@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: 3

🧹 Nitpick comments (5)
outputs/gcp_cloud_account/output.facets.yaml (1)

18-18: Add a trailing newline

YAML-lint flags the missing newline at EOF.
Tiny but keeps tooling (git diff, linters, concatenation scripts) happy.

-          description: "Service account key (sensitive)"
+\          description: "Service account key (sensitive)"
+
outputs/aws_cloud_account/output.facets.yaml (2)

13-21: Consider marking secret attributes explicitly

aws_iam_role and external_id are called “(sensitive)” in the description, but the facet spec usually surfaces secrecy via a dedicated flag (e.g., x-facets-secret: true or similar) so consuming systems can mask values automatically.
If the Facets schema supports such metadata, add it now; otherwise drop “(sensitive)” to avoid a false sense of protection.


24-24: Missing newline at EOF

Add the trailing newline for linting compliance.

outputs/azure_cloud_account/output.facets.yaml (2)

19-21: Flag secrets explicitly

client_secret is clearly sensitive; prefer an explicit secret flag rather than only a description suffix so that tooling can redact it.

Example:

        client_secret:
          type: string
          description: Azure client secret
          x-facets-secret: true        # or whatever the repo standard uses

24-24: Add trailing newline

Keeps YAML-lint quiet.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2ac4b2 and 8b32cfa.

📒 Files selected for processing (4)
  • modules/cloud_account/aws/0.2/facets.yaml (1 hunks)
  • outputs/aws_cloud_account/output.facets.yaml (1 hunks)
  • outputs/azure_cloud_account/output.facets.yaml (1 hunks)
  • outputs/gcp_cloud_account/output.facets.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • modules/cloud_account/aws/0.2/facets.yaml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: sanmesh-kakade
PR: Facets-cloud/facets-modules#393
File: modules/mongo_user/default/0.3/main.tf:63-110
Timestamp: 2025-06-03T11:10:34.578Z
Learning: For the Facets-cloud/facets-modules repository, module sources without specific version tags default to master branch and this is the preferred approach by the team.
🪛 YAMLlint (1.37.1)
outputs/aws_cloud_account/output.facets.yaml

[error] 24-24: no new line character at the end of file

(new-line-at-end-of-file)

outputs/azure_cloud_account/output.facets.yaml

[error] 24-24: no new line character at the end of file

(new-line-at-end-of-file)

outputs/gcp_cloud_account/output.facets.yaml

[error] 18-18: no new line character at the end of file

(new-line-at-end-of-file)

Comment on lines +7 to +8
interfaces:
attributes:
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

interfaces: placeholder is invalid (null value)

Same issue as in the GCP facet – a null interfaces field violates the facet schema.

-    interfaces:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
interfaces:
attributes:
attributes:
🤖 Prompt for AI Agents
In outputs/aws_cloud_account/output.facets.yaml around lines 7 to 8, the
`interfaces:` field is set to null, which violates the facet schema. To fix
this, remove the `interfaces:` line if it is not needed or replace it with a
valid non-null value such as an empty list or appropriate default content
according to the schema requirements.

Comment on lines +7 to +8
interfaces:
attributes:
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Null interfaces: field

Drop or fully define the interfaces property; null breaks consumers.

-    interfaces:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
interfaces:
attributes:
attributes:
🤖 Prompt for AI Agents
In outputs/azure_cloud_account/output.facets.yaml around lines 7 to 8, the
interfaces property is currently null, which causes issues for consumers. To fix
this, either remove the interfaces field entirely if it is not needed, or
provide a complete and valid definition for the interfaces property to ensure it
is not null.

Comment on lines +7 to +8
interfaces:
attributes:
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

interfaces: is left null – either drop it or give it a proper schema definition

interfaces: is declared but no value is provided, so YAML will parse it as null.
The facet‐schema used across this repo expects interfaces to be an array (or omit it altogether when empty).
Leaving it null will break downstream validation tooling that assumes a concrete structure.

Recommended minimal fix – remove the placeholder:

-    interfaces:

If you really need the field, define it explicitly:

    interfaces:
      type: array
      description: Interface names implemented by the facet
      items:
        type: string
🤖 Prompt for AI Agents
In outputs/gcp_cloud_account/output.facets.yaml around lines 7 to 8, the
interfaces field is declared but left null, which breaks downstream validation
expecting an array or omission when empty. Fix this by either removing the
interfaces field entirely if unused, or define it explicitly as an array with a
description and string items as shown in the recommended schema.

Copy link
Contributor

@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: 4

🧹 Nitpick comments (1)
modules/cloud_account/aws_provider/1.0/locals.tf (1)

12-15: Propagate sensitivity earlier to avoid accidental logging

Wrap secrets in sensitive() at the point of assignment so they remain redacted throughout the module lifecycle.

-    aws_iam_role = data.external.aws_fetch_cloud_secret.result["iamRole"]
-    external_id  = data.external.aws_fetch_cloud_secret.result["externalId"]
+    aws_iam_role = sensitive(data.external.aws_fetch_cloud_secret.result["iamRole"])
+    external_id  = sensitive(data.external.aws_fetch_cloud_secret.result["externalId"])
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b32cfa and f1a63ab.

📒 Files selected for processing (12)
  • modules/cloud_account/aws_provider/1.0/facets.yaml (1 hunks)
  • modules/cloud_account/aws_provider/1.0/locals.tf (1 hunks)
  • modules/cloud_account/aws_provider/1.0/outputs.tf (1 hunks)
  • modules/cloud_account/aws_provider/1.0/variables.tf (1 hunks)
  • modules/cloud_account/azure_provider/1.0/facets.yaml (1 hunks)
  • modules/cloud_account/azure_provider/1.0/locals.tf (1 hunks)
  • modules/cloud_account/azure_provider/1.0/outputs.tf (1 hunks)
  • modules/cloud_account/azure_provider/1.0/variables.tf (1 hunks)
  • modules/cloud_account/gcp_provider/1.0/facets.yaml (1 hunks)
  • modules/cloud_account/gcp_provider/1.0/locals.tf (1 hunks)
  • modules/cloud_account/gcp_provider/1.0/outputs.tf (1 hunks)
  • modules/cloud_account/gcp_provider/1.0/variables.tf (1 hunks)
✅ Files skipped from review due to trivial changes (8)
  • modules/cloud_account/gcp_provider/1.0/outputs.tf
  • modules/cloud_account/azure_provider/1.0/variables.tf
  • modules/cloud_account/aws_provider/1.0/facets.yaml
  • modules/cloud_account/gcp_provider/1.0/variables.tf
  • modules/cloud_account/aws_provider/1.0/variables.tf
  • modules/cloud_account/gcp_provider/1.0/facets.yaml
  • modules/cloud_account/azure_provider/1.0/outputs.tf
  • modules/cloud_account/azure_provider/1.0/facets.yaml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: sanmesh-kakade
PR: Facets-cloud/facets-modules#393
File: modules/mongo_user/default/0.3/main.tf:63-110
Timestamp: 2025-06-03T11:10:34.578Z
Learning: For the Facets-cloud/facets-modules repository, module sources without specific version tags default to master branch and this is the preferred approach by the team.
🔇 Additional comments (3)
modules/cloud_account/aws_provider/1.0/outputs.tf (1)

8-10: Verify secrets list is complete

Only external_id is listed, yet aws_iam_role is also marked sensitive. If consumers rely on the secrets array to know which outputs to redact, omitting aws_iam_role could leak credentials.

modules/cloud_account/azure_provider/1.0/locals.tf (2)

1-8: Missing sensitive = true & output validation

Fetching secrets via external will emit the JSON map into state unless marked sensitive downstream.
Confirm that every output consuming this data source is declared sensitive = true (or wrap with sensitive(...)). Otherwise, tenant credentials end up in plain-text Terraform state files.

Additionally, ensure the Python script prints only a single JSON object to stdout; any extra logging on stdout will break the provider.


2-5: Confirm script location and avoid hard-coded absolute path

It appears that secret-fetcher.py isn’t present under this module, so the absolute reference (/sources/primary/.../secret-fetcher.py) will almost certainly break on other machines. Please verify where the script actually lives:

  • If it belongs in this module, move it into a scripts/ directory alongside locals.tf and invoke it via
    "${path.module}/scripts/secret-fetcher.py"
  • Otherwise, introduce a variable so callers can supply the correct path and document that requirement.

Affected location:
• modules/cloud_account/azure_provider/1.0/locals.tf (lines 2–5)

Suggested diff:

program = [
  "python3",
-  "/sources/primary/capillary-cloud-tf/tfmain/scripts/cloudaccount-fetch-secret/secret-fetcher.py",
+  var.secret_fetcher_path,
  var.instance.spec.cloud_account,
  "AZURE",
]

And add a variable with a sane default:

variable "secret_fetcher_path" {
  description = "Filesystem path to the secret-fetcher.py script"
  type        = string
  default     = "${path.module}/scripts/secret-fetcher.py"
}

Comment on lines +1 to +7
data "external" "aws_fetch_cloud_secret" {
program = [
"python3",
"/sources/primary/capillary-cloud-tf/tfmain/scripts/cloudaccount-fetch-secret/secret-fetcher.py",
var.instance.spec.cloud_account,
"AWS"
]
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Hard-coded script path breaks module portability

The absolute path /sources/primary/.../secret-fetcher.py will fail for anyone consuming this module outside your mono-repo or a different directory layout. Make the path relative to path.module (or inject via a variable).

-    "/sources/primary/capillary-cloud-tf/tfmain/scripts/cloudaccount-fetch-secret/secret-fetcher.py",
+    "${path.module}/scripts/secret-fetcher.py",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
data "external" "aws_fetch_cloud_secret" {
program = [
"python3",
"/sources/primary/capillary-cloud-tf/tfmain/scripts/cloudaccount-fetch-secret/secret-fetcher.py",
var.instance.spec.cloud_account,
"AWS"
]
data "external" "aws_fetch_cloud_secret" {
program = [
"python3",
- "/sources/primary/capillary-cloud-tf/tfmain/scripts/cloudaccount-fetch-secret/secret-fetcher.py",
+ "${path.module}/scripts/secret-fetcher.py",
var.instance.spec.cloud_account,
"AWS"
]
}
🤖 Prompt for AI Agents
In modules/cloud_account/aws_provider/1.0/locals.tf lines 1 to 7, the script
path is hard-coded with an absolute path, which breaks module portability.
Replace the absolute path with a path constructed relative to path.module or
pass the script path as a variable to ensure the module works correctly
regardless of the directory structure where it is used.

Comment on lines +4 to +6
aws_iam_role = sensitive(local.script_output.aws_iam_role)
session_name = "capillary-cloud-tf-${uuid()}"
external_id = sensitive(local.script_output.external_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Session name will change on every plan – persist value via random_uuid

uuid() is evaluated at plan time, so session_name gets a new value on every run, causing perpetual diffs and needless churn for any downstream consumers.

-    session_name = "capillary-cloud-tf-${uuid()}"
+# Persist a stable value in state
+    session_name = "capillary-cloud-tf-${random_uuid.session_name.result}"

Add once in the same module:

resource "random_uuid" "session_name" {}
🤖 Prompt for AI Agents
In modules/cloud_account/aws_provider/1.0/outputs.tf around lines 4 to 6, the
session_name uses uuid() which changes on every plan causing unnecessary diffs.
Replace the dynamic uuid() call with a persistent value by adding a resource
"random_uuid" "session_name" {} in the same module and then reference
random_uuid.session_name.result in session_name to ensure it remains stable
across plans.

Comment on lines +3 to +4
"python3",
"/sources/primary/capillary-cloud-tf/tfmain/scripts/cloudaccount-fetch-secret/secret-fetcher.py",
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid hard-coded absolute script paths – use path.module or module files for portability.

Hard-coding /sources/primary/…/secret-fetcher.py ties the module to a very specific directory layout that will not exist for most users running terraform plan/apply locally or in CI/CD runners. Prefer something like:

program = [
  "python3",
  "${path.module}/scripts/secret-fetcher.py",
  var.instance.spec.cloud_account,
  "GCP",
]

or distribute the script as its own module input so callers can choose the path.

🤖 Prompt for AI Agents
In modules/cloud_account/gcp_provider/1.0/locals.tf around lines 3 to 4, the
script path is hard-coded as an absolute path, which reduces portability.
Replace the absolute path with a relative path using Terraform's path.module
variable to reference the script location dynamically, for example, use
"${path.module}/scripts/secret-fetcher.py" instead of the fixed absolute path.
This change ensures the module works correctly regardless of where it is checked
out or run.

Comment on lines +5 to +6
var.instance.spec.cloud_account,
"GCP"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Passing cloud-account identifiers via CLI args leaks them in process listings.

var.instance.spec.cloud_account may contain PII or sensitive account IDs. When supplied as a positional argument, the value is visible to any process that can run ps on the host running Terraform. For the external data source, prefer supplying data on stdin via the query argument:

data "external" "gcp_fetch_cloud_secret" {
  program = ["python3", "${path.module}/scripts/secret-fetcher.py"]

  query = {
    cloud_account = var.instance.spec.cloud_account
    provider      = "GCP"
  }
}

The script can then read the JSON payload from stdin, eliminating the exposure.

🤖 Prompt for AI Agents
In modules/cloud_account/gcp_provider/1.0/locals.tf around lines 5 to 6, avoid
passing var.instance.spec.cloud_account as a positional argument to prevent
sensitive data exposure in process listings. Instead, refactor the external data
source to pass cloud_account and provider values via the query argument as a
JSON object, which the external script can read from stdin, eliminating the risk
of leaking sensitive identifiers.

Copy link
Contributor

@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: 5

🧹 Nitpick comments (1)
modules/cloud_account/gcp_provider/1.0/facets.yaml (1)

31-31: Optional: Title clarity
Consider making the title GCP-specific to avoid confusion with other providers.

Apply this diff:

-  title: Cloud Account Manager
+  title: GCP Cloud Account Manager
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1a63ab and fea82f6.

📒 Files selected for processing (3)
  • modules/cloud_account/aws_provider/1.0/facets.yaml (1 hunks)
  • modules/cloud_account/azure_provider/1.0/facets.yaml (1 hunks)
  • modules/cloud_account/gcp_provider/1.0/facets.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • modules/cloud_account/aws_provider/1.0/facets.yaml
  • modules/cloud_account/azure_provider/1.0/facets.yaml
🔇 Additional comments (3)
modules/cloud_account/gcp_provider/1.0/facets.yaml (3)

29-34: Spec structure, requireds, and UI order look good
The object schema with a single required field and explicit x-ui-order is consistent and clear.


18-28: API params: includeContent usage verified for consistency

I’ve surveyed all x-ui-api-source entries and confirmed that includeContent: false is used uniformly across modules (e.g. cloud_account/aws_provider/1.0/facets.yaml, cloud_account/azure_provider/1.0/facets.yaml, ecs_service/default/0.2/facets.yaml, etc.). It’s safe to proceed with includeContent: false here, provided the API still returns your labelKey/valueKey fields and handles pagination/auth correctly.

• modules/cloud_account/aws_provider/1.0/facets.yaml
• modules/cloud_account/azure_provider/1.0/facets.yaml
• modules/cloud_account/gcp_provider/1.0/facets.yaml
• …and dozens more under x-ui-api-source

Please confirm against the API documentation or integration tests that omitting the content payload doesn’t strip out the name/id fields or alter pagination/auth behavior.


41-41: Provider version pin consistency
The GCP provider version (6.43.0) aligns with existing cloud_account/gcp modules (which use unprefixed exact versions) and follows the same style as the Azure modules. AWS modules use "= <version>" pins, but for GCP/Azure the plain version syntax is already established. No changes are required here unless you intend to standardize pin syntax or adopt range constraints across all cloud_account facets.

Comment on lines +8 to +10
description: Module to configure and provision resources within a cloud account
(AWS, GCP, Azure)
properties:
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix invalid YAML: stray line breaks under description break parsing

The continuation line for description at Line 9 is not a valid YAML scalar continuation and will cause a parse error. Use a folded scalar and, since this facet is GCP-specific, tighten the wording.

Apply this diff:

-  description: Module to configure and provision resources within a cloud account
-    (AWS, GCP, Azure)
+  description: >
+    Module to configure and provision resources within a GCP cloud account
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description: Module to configure and provision resources within a cloud account
(AWS, GCP, Azure)
properties:
description: >
Module to configure and provision resources within a GCP cloud account
properties:
🤖 Prompt for AI Agents
In modules/cloud_account/gcp_provider/1.0/facets.yaml around lines 8 to 10, the
description uses an invalid continuation line which breaks YAML parsing; replace
the multi-line broken description with a single folded scalar (using >) and
tighten the text to be GCP-specific (e.g., "Module to configure and provision
resources within a GCP cloud account"); ensure the folded scalar is indented
correctly under the description key and remove the stray line break so the
description becomes one valid YAML scalar.

Comment on lines +12 to +28
description: Select the cloud account to use (must be previously linked)
title: Cloud Account
type: string
x-ui-typeable: true
x-ui-overrides-only: true
x-ui-api-source:
endpoint: /cc-ui/v1/accounts/
method: GET
labelKey: name
valueKey: id
filterConditions:
- field: accountType
value: CLOUD
- field: provider
value: GCP
params:
includeContent: false
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Align UI source config: make selection non-typeable and verify provider filter casing

  • If the value must come from the API, allowing arbitrary typing is risky; disable typeable.
  • Confirm expected casing for provider filter with the API. Your clouds list uses "gcp" (lowercase) but filter uses "GCP" (uppercase). Inconsistent casing can break filtering.

Apply this diff to disable arbitrary typing:

-      x-ui-typeable: true
+      x-ui-typeable: false

If the API expects lowercase provider values, apply:

-        - field: provider
-          value: GCP
+        - field: provider
+          value: gcp

Run this repo scan to check what other modules use for provider casing so we stay consistent:


🏁 Script executed:

#!/bin/bash
# Inspect existing facets for provider casing in filterConditions
rg -nA2 $'filterConditions:\n.*field: provider' | sed 's/^/>> /'

Length of output: 256


To accurately determine the existing casing used for the provider filter across all facets, let’s rerun a simpler grep that matches field: provider and prints the following line:


🏁 Script executed:

#!/bin/bash
# Inspect all YAML facets for provider filter casing
rg -n "field: provider" -A1 --glob '*.yaml' --color never

Length of output: 536


Disable free‐form input on cloud account selection

To ensure users only pick from API‐provided values and avoid invalid entries, set x-ui-typeable to false. No change to the provider casing is needed—every module (AWS, AZURE, GCP) uses uppercase.

• File: modules/cloud_account/gcp_provider/1.0/facets.yaml
• Change at the UI config for the Cloud Account field:

@@ modules/cloud_account/gcp_provider/1.0/facets.yaml
-      x-ui-typeable: true
+      x-ui-typeable: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description: Select the cloud account to use (must be previously linked)
title: Cloud Account
type: string
x-ui-typeable: true
x-ui-overrides-only: true
x-ui-api-source:
endpoint: /cc-ui/v1/accounts/
method: GET
labelKey: name
valueKey: id
filterConditions:
- field: accountType
value: CLOUD
- field: provider
value: GCP
params:
includeContent: false
description: Select the cloud account to use (must be previously linked)
title: Cloud Account
type: string
- x-ui-typeable: true
+ x-ui-typeable: false
x-ui-overrides-only: true
x-ui-api-source:
endpoint: /cc-ui/v1/accounts/
method: GET
labelKey: name
valueKey: id
filterConditions:
- field: accountType
value: CLOUD
- field: provider
value: GCP
params:
includeContent: false
🤖 Prompt for AI Agents
In modules/cloud_account/gcp_provider/1.0/facets.yaml around lines 12 to 28, the
Cloud Account field currently allows free‑form input via x-ui-typeable: true;
change x-ui-typeable to false so the UI prevents typing and forces selection
from API-provided values (leave provider casing as-is).

Comment on lines +35 to +45
outputs:
default:
type: '@outputs/gcp_cloud_account'
providers:
google:
source: hashicorp/google
version: 6.43.0
attributes:
project: attributes.project
region: attributes.region
credentials: attributes.credentials
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Guard sensitive attributes: ensure credentials are redacted and not persisted/logged

Mapping raw credentials as an attribute can risk exposure if not explicitly marked sensitive in the outputs facet and any UI. Ensure:

  • The referenced facet '@outputs/gcp_cloud_account' treats credentials as secret/sensitive.
  • Logs and diff views redact the value.

Please verify the outputs facet marks credentials as sensitive. You can locate it with:

If sensitivity flags are supported here, and handled at this level instead, consider:

       attributes:
         project: attributes.project
         region: attributes.region
-        credentials: attributes.credentials
+        credentials: attributes.credentials
+      x-sensitive-keys:
+      - credentials

Confirm the correct key name for sensitivity per your schema before applying.


🏁 Script executed:

#!/bin/bash
# Find and print the gcp_cloud_account outputs facet to confirm sensitivity flags
fd -a --hidden --follow -t f 'gcp_cloud_account' | rg -n 'output|credentials|sensitive|x-.*sensitive' -A4 -B2

Length of output: 109


I’m not seeing any sensitivity markers in the outputs facet—let’s pull in the full facets.yaml to confirm where (or if) sensitive flags are supported.


🏁 Script executed:

#!/bin/bash
# Locate and dump the outputs facet definition in facets.yaml for gcp_provider
files=$(fd facets.yaml modules/cloud_account/gcp_provider -t f)
if [ -z "$files" ]; then
  echo "Error: facets.yaml not found under modules/cloud_account/gcp_provider"
  exit 1
fi

for file in $files; do
  echo "---- $file ----"
  # Print the outputs section
  sed -n '/^outputs:/,/^[^ ]/p' "$file"
done

Length of output: 708


To determine the correct sensitivity annotation, let’s scan all facets.yaml files for existing markers:

This will show us how (or if) other facets declare sensitive outputs.


🏁 Script executed:

#!/bin/bash
echo "Searching for 'x-sensitive-keys' in facets definitions..."
rg -n 'x-sensitive-keys' -g '*facets.yaml' -A3 -B3 || echo "→ no x-sensitive-keys found"

echo "Searching for 'sensitive:' in facets definitions..."
rg -n 'sensitive:' -g '*facets.yaml' -A3 -B3 || echo "→ no sensitive: entries found"

Length of output: 479


Mark credentials as sensitive in the outputs facet

The outputs definition in modules/cloud_account/gcp_provider/1.0/facets.yaml currently exposes raw credentials without any sensitivity flags. To ensure these aren’t persisted or shown in logs/UI, add an x-sensitive-keys section under the provider attributes:

• File: modules/cloud_account/gcp_provider/1.0/facets.yaml
• Location: lines 35–45 (under outputs.default.providers.google.attributes)

Proposed diff:

 outputs:
   default:
     type: '@outputs/gcp_cloud_account'
     providers:
       google:
         source: hashicorp/google
         version: 6.43.0
         attributes:
           project: attributes.project
           region: attributes.region
-          credentials: attributes.credentials
+          credentials: attributes.credentials
+        x-sensitive-keys:
+        - credentials

No other facets declare sensitive keys—please verify your facet schema supports x-sensitive-keys (or the correct annotation) so that credentials are properly redacted.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In modules/cloud_account/gcp_provider/1.0/facets.yaml around lines 35–45 the
outputs.default.providers.google.attributes block exposes raw credentials; add
an x-sensitive-keys annotation under that attributes block listing credentials
(e.g., x-sensitive-keys: [credentials]) so the credentials field is treated as
sensitive/redacted, and confirm the facet schema supports x-sensitive-keys (or
replace with the project’s required sensitive annotation) before committing.

- cloud_account
outputs:
default:
type: '@outputs/gcp_cloud_account'
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify referenced outputs facet exists
Ensure '@outputs/gcp_cloud_account' exists and matches the expected provider attribute schema.

Use:


🏁 Script executed:

#!/bin/bash
# Locate the referenced outputs facet
fd -a --hidden --follow -t f 'gcp_cloud_account' | sed 's/^/>> /'

Length of output: 65


🏁 Script executed:

#!/bin/bash
# Search for a facet file named gcp_cloud_account.yaml anywhere in the repo
echo "Looking for gcp_cloud_account.yaml files:"
fd -t f 'gcp_cloud_account.yaml' | sed 's/^/>> /'

# Search within YAML files for any definition or reference of the outputs facet
echo "Searching for '@outputs/gcp_cloud_account' in file contents:"
rg -n "@outputs/gcp_cloud_account"

Length of output: 407


Missing outputs facet: '@outputs/gcp_cloud_account' not found

The type reference in modules/cloud_account/gcp_provider/1.0/facets.yaml (line 37) points to an outputs facet that doesn’t exist in the repository.
• File: modules/cloud_account/gcp_provider/1.0/facets.yaml, line 37
• Current code:

    type: '@outputs/gcp_cloud_account'

Action required:

  • Either create the corresponding outputs facet file (e.g. modules/cloud_account/gcp_provider/1.0/facets/outputs/gcp_cloud_account.yaml) following the provider attribute schema,
  • Or update the type to reference an existing outputs facet.
🤖 Prompt for AI Agents
In modules/cloud_account/gcp_provider/1.0/facets.yaml around line 37, the type
references an outputs facet '@outputs/gcp_cloud_account' that does not exist in
the repo; either add a new outputs facet file at
modules/cloud_account/gcp_provider/1.0/facets/outputs/gcp_cloud_account.yaml
following the provider outputs schema (defining the expected output attributes
and types) or change the type value to point to an existing outputs facet name
in the project; ensure the chosen outputs facet matches the attributes used
elsewhere by this provider.

Comment on lines +52 to +54
iac:
validated_files:
- variables.tf
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Track FTF/MCP validation and expand validated files per reviewer request
Per the PR comment, validation should be tracked in facets.yaml. Also include all IaC files, not just variables.tf.

Apply this diff:

 iac:
   validated_files:
-  - variables.tf
+  - variables.tf
+  - locals.tf
+  - outputs.tf
+  validation:
+    tool: FTF
+    status: passed
+    # TODO: update timestamp during validation run
+    timestamp: '2025-08-12T00:00:00Z'

If your convention uses a different field name (e.g., x-mcp-validated), adjust accordingly. I can batch-generate similar updates for AWS/Azure provider facets if needed.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
iac:
validated_files:
- variables.tf
iac:
validated_files:
- variables.tf
- locals.tf
- outputs.tf
validation:
tool: FTF
status: passed
# TODO: update timestamp during validation run
timestamp: '2025-08-12T00:00:00Z'
🤖 Prompt for AI Agents
In modules/cloud_account/gcp_provider/1.0/facets.yaml around lines 52-54, the
file currently only lists variables.tf under iac.validated_files; update the
facets.yaml to track FTF/MCP validation and include all IaC files for the module
(e.g., main.tf, variables.tf, outputs.tf, providers.tf, terraform.tfvars,
modules/* as applicable) under that key so validation coverage is explicit; if
your project uses a different convention (for example x-mcp-validated), use that
field name instead and ensure the list reflects every IaC file in the provider
directory per the reviewer request.

@aditya-facets
Copy link
Contributor Author

aditya-facets commented Aug 13, 2025

image

@mbhandari31

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.

5 participants