@@ -28,38 +28,108 @@ class CloudScanner(BaseScanner):
2828
2929 # Terraform resource type to (provider, component_type) mapping
3030 TERRAFORM_AI_RESOURCES = {
31+ # --- AWS Bedrock ---
3132 "aws_bedrockagent_agent" : ("AWS Bedrock" , ComponentType .agent_framework ),
3233 "aws_bedrockagent_knowledge_base" : ("AWS Bedrock" , ComponentType .tool ),
34+ "aws_bedrock_custom_model" : ("AWS Bedrock" , ComponentType .model ),
35+ "aws_bedrock_provisioned_model_throughput" : ("AWS Bedrock" , ComponentType .endpoint ),
36+ "aws_bedrock_guardrail" : ("AWS Bedrock" , ComponentType .tool ),
37+ "aws_bedrock_model_invocation_logging_configuration" : ("AWS Bedrock" , ComponentType .tool ),
38+ "aws_bedrockagent_agent_action_group" : ("AWS Bedrock" , ComponentType .tool ),
39+ "aws_bedrockagent_agent_alias" : ("AWS Bedrock" , ComponentType .agent_framework ),
40+ "aws_bedrockagent_data_source" : ("AWS Bedrock" , ComponentType .tool ),
41+ "aws_bedrockagent_flow" : ("AWS Bedrock" , ComponentType .workflow ),
42+ "aws_bedrockagent_prompt" : ("AWS Bedrock" , ComponentType .tool ),
43+ # --- AWS SageMaker ---
3344 "aws_sagemaker_endpoint" : ("AWS SageMaker" , ComponentType .endpoint ),
3445 "aws_sagemaker_model" : ("AWS SageMaker" , ComponentType .model ),
35- "aws_sagemaker_endpoint_configuration" : (
36- "AWS SageMaker" ,
37- ComponentType .endpoint ,
38- ),
46+ "aws_sagemaker_endpoint_configuration" : ("AWS SageMaker" , ComponentType .endpoint ),
47+ "aws_sagemaker_notebook_instance" : ("AWS SageMaker" , ComponentType .tool ),
48+ "aws_sagemaker_domain" : ("AWS SageMaker" , ComponentType .container ),
49+ "aws_sagemaker_pipeline" : ("AWS SageMaker" , ComponentType .workflow ),
50+ "aws_sagemaker_feature_group" : ("AWS SageMaker" , ComponentType .tool ),
51+ "aws_sagemaker_space" : ("AWS SageMaker" , ComponentType .container ),
52+ "aws_sagemaker_app" : ("AWS SageMaker" , ComponentType .tool ),
53+ "aws_sagemaker_model_package_group" : ("AWS SageMaker" , ComponentType .model ),
54+ # --- AWS Comprehend ---
55+ "aws_comprehend_document_classifier" : ("AWS Comprehend" , ComponentType .model ),
56+ "aws_comprehend_entity_recognizer" : ("AWS Comprehend" , ComponentType .model ),
57+ # --- AWS Kendra ---
58+ "aws_kendra_index" : ("AWS Kendra" , ComponentType .tool ),
59+ # --- AWS Lex ---
60+ "aws_lexv2models_bot" : ("AWS Lex" , ComponentType .agent_framework ),
61+ # --- AWS Rekognition ---
62+ "aws_rekognition_project" : ("AWS Rekognition" , ComponentType .model ),
63+ # --- Google Vertex AI ---
3964 "google_vertex_ai_endpoint" : ("Google Vertex AI" , ComponentType .endpoint ),
4065 "google_vertex_ai_featurestore" : ("Google Vertex AI" , ComponentType .tool ),
4166 "google_vertex_ai_index" : ("Google Vertex AI" , ComponentType .tool ),
4267 "google_vertex_ai_tensorboard" : ("Google Vertex AI" , ComponentType .tool ),
68+ "google_vertex_ai_dataset" : ("Google Vertex AI" , ComponentType .tool ),
69+ "google_vertex_ai_metadata_store" : ("Google Vertex AI" , ComponentType .tool ),
70+ "google_vertex_ai_deployment_resource_pool" : ("Google Vertex AI" , ComponentType .container ),
71+ "google_vertex_ai_index_endpoint" : ("Google Vertex AI" , ComponentType .endpoint ),
72+ "google_vertex_ai_feature_online_store" : ("Google Vertex AI" , ComponentType .tool ),
73+ "google_vertex_ai_reasoning_engine" : ("Google Vertex AI" , ComponentType .agent_framework ),
74+ "google_notebooks_instance" : ("Google Vertex AI" , ComponentType .tool ),
75+ "google_workbench_instance" : ("Google Vertex AI" , ComponentType .tool ),
76+ # --- Google ML Engine ---
4377 "google_ml_engine_model" : ("Google ML Engine" , ComponentType .model ),
78+ # --- Google Dialogflow CX ---
79+ "google_dialogflow_cx_agent" : ("Google Dialogflow CX" , ComponentType .agent_framework ),
80+ # --- Google Discovery Engine ---
81+ "google_discovery_engine_search_engine" : (
82+ "Google Discovery Engine" ,
83+ ComponentType .endpoint ,
84+ ),
85+ # --- Azure AI ---
4486 "azurerm_cognitive_account" : ("Azure AI" , ComponentType .llm_provider ),
87+ "azurerm_cognitive_deployment" : ("Azure OpenAI" , ComponentType .endpoint ),
88+ "azurerm_ai_services" : ("Azure AI" , ComponentType .llm_provider ),
89+ "azurerm_ai_foundry" : ("Azure AI Foundry" , ComponentType .tool ),
90+ "azurerm_ai_foundry_project" : ("Azure AI Foundry" , ComponentType .tool ),
91+ # --- Azure ML ---
4592 "azurerm_machine_learning_workspace" : ("Azure ML" , ComponentType .tool ),
46- "azurerm_machine_learning_compute_cluster" : (
47- "Azure ML" ,
48- ComponentType .container ,
49- ),
50- "azurerm_machine_learning_compute_instance" : (
51- "Azure ML" ,
52- ComponentType .container ,
53- ),
93+ "azurerm_machine_learning_compute_cluster" : ("Azure ML" , ComponentType .container ),
94+ "azurerm_machine_learning_compute_instance" : ("Azure ML" , ComponentType .container ),
95+ "azurerm_machine_learning_inference_cluster" : ("Azure ML" , ComponentType .endpoint ),
96+ "azurerm_machine_learning_synapse_spark" : ("Azure ML" , ComponentType .container ),
97+ "azurerm_machine_learning_datastore_blobstorage" : ("Azure ML" , ComponentType .tool ),
5498 }
5599
56100 # CloudFormation resource types to (provider, component_type) mapping
57101 CLOUDFORMATION_AI_RESOURCES = {
102+ # --- Bedrock ---
58103 "AWS::Bedrock::Agent" : ("AWS Bedrock" , ComponentType .agent_framework ),
59104 "AWS::Bedrock::KnowledgeBase" : ("AWS Bedrock" , ComponentType .tool ),
105+ "AWS::Bedrock::AgentAlias" : ("AWS Bedrock" , ComponentType .agent_framework ),
106+ "AWS::Bedrock::DataSource" : ("AWS Bedrock" , ComponentType .tool ),
107+ "AWS::Bedrock::Flow" : ("AWS Bedrock" , ComponentType .workflow ),
108+ "AWS::Bedrock::FlowAlias" : ("AWS Bedrock" , ComponentType .workflow ),
109+ "AWS::Bedrock::Guardrail" : ("AWS Bedrock" , ComponentType .tool ),
110+ "AWS::Bedrock::Prompt" : ("AWS Bedrock" , ComponentType .tool ),
111+ "AWS::Bedrock::ApplicationInferenceProfile" : ("AWS Bedrock" , ComponentType .endpoint ),
112+ # --- SageMaker ---
60113 "AWS::SageMaker::Endpoint" : ("AWS SageMaker" , ComponentType .endpoint ),
61114 "AWS::SageMaker::Model" : ("AWS SageMaker" , ComponentType .model ),
62115 "AWS::SageMaker::EndpointConfig" : ("AWS SageMaker" , ComponentType .endpoint ),
116+ "AWS::SageMaker::NotebookInstance" : ("AWS SageMaker" , ComponentType .tool ),
117+ "AWS::SageMaker::Domain" : ("AWS SageMaker" , ComponentType .container ),
118+ "AWS::SageMaker::Pipeline" : ("AWS SageMaker" , ComponentType .workflow ),
119+ "AWS::SageMaker::FeatureGroup" : ("AWS SageMaker" , ComponentType .tool ),
120+ "AWS::SageMaker::ModelPackage" : ("AWS SageMaker" , ComponentType .model ),
121+ "AWS::SageMaker::ModelPackageGroup" : ("AWS SageMaker" , ComponentType .model ),
122+ "AWS::SageMaker::InferenceComponent" : ("AWS SageMaker" , ComponentType .endpoint ),
123+ "AWS::SageMaker::Space" : ("AWS SageMaker" , ComponentType .container ),
124+ # --- Comprehend ---
125+ "AWS::Comprehend::DocumentClassifier" : ("AWS Comprehend" , ComponentType .model ),
126+ "AWS::Comprehend::Flywheel" : ("AWS Comprehend" , ComponentType .workflow ),
127+ # --- Kendra ---
128+ "AWS::Kendra::Index" : ("AWS Kendra" , ComponentType .tool ),
129+ # --- Lex ---
130+ "AWS::Lex::Bot" : ("AWS Lex" , ComponentType .agent_framework ),
131+ # --- Rekognition ---
132+ "AWS::Rekognition::Project" : ("AWS Rekognition" , ComponentType .model ),
63133 }
64134
65135 # Patterns for GPU instance types
@@ -292,6 +362,21 @@ def _extract_terraform_metadata(
292362 if endpoint_name_match :
293363 metadata ["endpoint_name" ] = endpoint_name_match .group (1 )
294364
365+ # kind = "..." (common in GCP resources)
366+ kind_match = re .search (r'kind\s*=\s*"([^"]+)"' , block_text )
367+ if kind_match :
368+ metadata ["kind" ] = kind_match .group (1 )
369+
370+ # display_name = "..." (common in Azure/GCP resources)
371+ display_name_match = re .search (r'display_name\s*=\s*"([^"]+)"' , block_text )
372+ if display_name_match :
373+ metadata ["display_name" ] = display_name_match .group (1 )
374+
375+ # description = "..." (common across providers)
376+ description_match = re .search (r'description\s*=\s*"([^"]+)"' , block_text )
377+ if description_match :
378+ metadata ["description" ] = description_match .group (1 )
379+
295380 return metadata
296381
297382 def _scan_cloudformation (self , file_path : Path ) -> list [AIComponent ]:
@@ -345,6 +430,10 @@ def _scan_cloudformation(self, file_path: Path) -> list[AIComponent]:
345430 properties .get ("ModelId" , "" )
346431 or properties .get ("ModelName" , "" )
347432 or properties .get ("FoundationModel" , "" )
433+ or properties .get ("AgentName" , "" )
434+ or properties .get ("FlowName" , "" )
435+ or properties .get ("GuardrailName" , "" )
436+ or properties .get ("PipelineName" , "" )
348437 )
349438
350439 # Create metadata
@@ -495,6 +584,10 @@ def _infer_usage_type(
495584 # Default to completion for LLM endpoints
496585 return UsageType .completion
497586
587+ # Workflows are used for orchestration
588+ if component_type == ComponentType .workflow :
589+ return UsageType .orchestration
590+
498591 # Tools are used for tool_use
499592 if component_type == ComponentType .tool :
500593 return UsageType .tool_use
0 commit comments