Importing Project Types Using Raptor CLI
The raptor import project-type command allows you to import or update project types in Control Plane. This command supports:
- Upsert Behavior: Creates new or updates existing project types
- Facets Templates: Quick access to Facets-provided templates/project-types
- Custom repository imports: Use your own Git repositories (public or private) to import any project-type
- Automatic module uploads: Upload IaC modules alongside project types which are not yet registered in the control plane.
Quick Start
Note: Install raptor through this guide.
Import Project Type from Provided Library
raptor import project-type awsThis imports the AWS project type from the provided library with all metadata and templates.
Import with Modules
git clone github.com/Facets-cloud/facets-modules-redesign.git
raptor import project-type aws --modules-dir ./facets-modules-redesign/modulesThis imports the project type AND uploads all IaC modules specified in the project type metadata.
Import Sources
1. Project Type Import from Existing Library
raptor import project-type <PROJECT_TYPE_NAME>What Happens:
- Fetches metadata from
https://github.com/Facets-cloud/facets-modules-redesign(Provided Library of project types.) - Reads
project-types/<NAME>/project-type.ymlfor configuration, imports base template fromproject-types/<NAME>/base/and finally creates or updates the project type in Control Plane
2. Custom Public/Private Repository Import
Import project types from any Git repository apart from the default one.(GitHub, GitLab, Bitbucket, Azure DevOps, self-hosted Git, etc.).
Command:
raptor import project-type <NAME> \
--git-url <PRIVATE/PUBLIC REPOSITORY_URL> \
--git-ref <BRANCH_OR_TAG> \
--path <PATH_TO_PROJECT_TYPE>
--vcs-account-id <VCS_ACCOUNT_ID (only incase of private repo)> \
-f <LOCAL_METADATA_FILE (only incase of private repo)>Required Flags:
--git-url- Full Git repository URL (HTTPS)--git-ref- Git branch, tag, or commit reference--path- Path within the repository to the project type directory (containingproject-type.yml)--vcs-account-id- VCS account ID from Facets Control Plane-f, --file- Local path toproject-type.ymlmetadata file
Examples:
// For Public Repo
raptor import project-type java-service \
--git-url https://github.com/myorg/templates.git \
--git-ref main \
--path templates/java-service
//For Private Repo
raptor import project-type internal-service \
--git-url https://github.com/myorg/private-templates.git \
--git-ref main \
--path templates/internal-service \
--vcs-account-id acc_a1b2c3d4e5 \
-f ./internal-service.ymlGetting Your VCS Account ID:
# List VCS accounts in your Control Plane
raptor get vcs-accountsUploading IaC Modules
The --modules-dir flag allows to uploads IaC modules in the control plane (if not present), which are specified in your project type metadata.
How It Works
- Specify modules in
project-type.yml:
name: aws
description: AWS project type with common configurations
allowedClouds:
- AWS
modules:
- path: aws/cloud_account/aws_provider/1.0
intent: cloud_account
flavor: aws_provider
version: 1.0
- path: aws/network/aws_vpc/1.0
intent: network
flavor: aws_vpc
version: 1.0
- path: aws/kubernetes_cluster/eks/1.0
intent: kubernetes_cluster
flavor: eks
version: 1.0- Run import with
--modules-dir:
raptor import project-type aws --modules-dir /Users/myuser/facets-modules-redesign/modules- Raptor will:
- Read module paths from
project-type.ymland look for modules at:<modules-dir>/<path> - Upload each module with full validation and create output types automatically from
output_interfacesandoutput_attributes - Report success/failure for each module
- Read module paths from
Example Output
Fetching project type metadata from repository...
Cloning repository (shallow clone)...
Updating existing project type 'AWS' in Control Plane...
✓ Project type updated successfully
Name: AWS
Description: AWS project type with common configurations.
ID: 691d8859a1985a048d8fef4f
Version: v1 (non-legacy)
Repository: https://github.com/Facets-cloud/facets-modules-redesign.git (default library)
Template Path: project-types/aws/base
IaC Tool: TERRAFORM 1.5.7
📦 Uploading IaC modules...
[1/5] Uploading cloud_account/aws_provider from aws/cloud_account/aws_provider/1.0...
=== Validating Module ===
✓ Checking facets.yaml...
✅ facets.yaml validated successfully
✓ Running terraform fmt...
🎨 Terraform files formatted
✓ Running terraform validate...
🔍 Terraform validation successful
=== Processing Outputs ===
✓ Found output_interfaces and/or output_attributes
✓ Generating output files...
✅ Generated output files: output-lookup-tree.json, output.facets.yaml
Uploading module cloud_account/aws_provider/...
✓ Module uploaded successfully (ID: 691d9093a1985a048d8fef5c)
Stage: PREVIEW (use 'raptor publish iac-module cloud_account/aws_provider/' to publish)
[1/5] ✓ Uploaded cloud_account/aws_provider
[2/5] Uploading kubernetes_cluster/eks...
...
📊 Module Upload Summary:
✓ Uploaded: 3
❌ Failed: 2
Project Type Metadata Format
The project-type.yml file defines your project type configuration.
name: aws
description: AWS project type with Cloud, VPC, and other modules
allowedClouds:
- AWS
modules:
# Cloud Account Setup
- path: aws/cloud_account/aws_provider/1.0
intent: cloud_account
flavor: aws_provider
version: 1.0
# Networking
- path: aws/network/aws_vpc/1.0
intent: network
flavor: aws_vpc
version: 1.0
#and other modules..Complete Examples
Example 1: Import AWS Project Type with Modules
# Clone your project type repository
git clone https://github.com/myorg/project-types.git
cd project-types
# Import project type and upload modules
raptor import project-type aws \
--modules-dir ./modules
# All modules from project-type.yml will be uploaded automaticallyExample 2: Import from Private Repo with Modules
# 1. Get your VCS account ID
raptor get vcs-accounts
# 2. Prepare local metadata file
cat > custom-type.yml <<EOF
name: internal-platform
description: Internal platform services
allowedClouds:
- AWS
- GCP
modules:
- path: internal/service/standard/1.0
intent: service
flavor: standard
version: 1.0
EOF
# 3. Import with modules
raptor import project-type internal-platform \
--git-url https://github.com/myorg/private-templates.git \
--git-ref main \
--path templates/platform \
--vcs-account-id acc_xyz123 \
-f custom-type.yml \
--modules-dir ./local-modulesTroubleshooting
Module Upload Failures
Problem: Module validation fails with Terraform errors
Solution:
- Check Terraform syntax in the failing module
- Ensure all required variables are present
- Run
terraform validatelocally in the module directory - Upload manually with more control:
raptor create iac-module -f /path/to/module --skip-validation
Problem: Module conflicts with built-in Facets module
Error:
Cannot update Facets built-in module with intent network and flavor aws_vpc.
Please choose a different flavor.
Solution:
Use a different flavor name in your module's facets.yaml:
intent: network
flavor: aws_vpc_custom # Changed from aws_vpc
version: 1.0Problem: Output type creation fails
Solution:
- Ensure your module has proper
output_interfacesandoutput_attributesinoutputs.tf - Use
--skip-output-writeto skip output processing:raptor create iac-module -f /path/to/module --skip-output-write - Create output types manually:
raptor create output-type @custom/my-output -f output-schema.yaml
Command Reference
# Import from Facets library
raptor import project-type <NAME>
# Import from custom public repo
raptor import project-type <NAME> \
--git-url <GIT_URL> \
--git-ref <BRANCH> \
--path <PATH>
# Import from private repo
raptor import project-type <NAME> \
--git-url <GIT_URL> \
--git-ref <BRANCH> \
--path <PATH> \
--vcs-account-id <ACCOUNT_ID> \
-f <METADATA_FILE>
# Import project type with new module uploads which are not registered in the control plane yet
raptor import project-type <NAME> \
--modules-dir <MODULES_DIRECTORY>
# Flags
--git-url string # Git repository URL
--git-ref string # Git branch/tag (default: master)
--path string # Path to project type directory
--vcs-account-id string # VCS account ID for private repos
-f, --file string # Local metadata YAML file
--modules-dir string # Local modules directory
--useBranch # Enable git branch usage (default: true)
-o, --output string # Output format (table|wide|json|yaml)FAQ
Q: Do I need to upload modules every time?
A: No. If modules are already uploaded, they will be skipped. Use --modules-dir only when you want to upload new or updated modules.
Q: What happens to existing projects when I update a project type?
A: Existing projects are not affected. Project type updates only affect new projects created after the update.
Q: Can I use modules from different project types?
A: Yes! Once modules are uploaded to the Control Plane, they can be used across any project regardless of which project type imported them.
Q: What if my module has custom dependencies?
A: Ensure all Terraform dependencies are specified in your module's Terraform configuration. The validation process runs terraform init which will fetch required providers and modules.
Updated 33 minutes ago