How Profiles Work
Profiles define attribute values that cascade to objects:Creating Profiles
Profiles are schema-specific. You define them in the schema, then create instances.Define Profile Schema
In your schema file, define a profile for an object kind:Create Profile Instance
- UI
- GraphQL
- Python SDK
- Navigate to Profiles → Device Profiles
- Click Add Device Profile
- Set profile values:
- Name: Profile identifier
- Label: Display name
- Priority: Lower numbers = higher priority (default: 1000)
- Set attribute values to apply
- Set relationship peers to apply
- Click Save
Applying Profiles to Objects
Assign profiles to objects to apply their settings.Assign During Creation
- GraphQL
- Python SDK
Assign to Existing Object
- GraphQL
- Python SDK
Profile Priority
When multiple profiles apply to the same object, priority determines which profile’s values are used.Priority Rules
- Lower number = higher priority: Priority 100 overrides priority 1000
- Default priority: 1000 if not specified
- Per-attribute resolution: Each attribute uses the highest-priority profile that sets it
- Explicit values win: Values set directly on the object override all profiles
Example
Profile Inheritance Tracking
Infrahub tracks which values come from profiles.Check Value Source
Override Profile Values
Set a value directly on the object to override the profile:is_from_profile is false and source is the device itself.
Profile with Relationships
Profiles can set relationship values.Define Relationship in Profile Schema
Set Relationships in Profile
Updating Profiles
Changes to profiles automatically propagate to associated objects.Update Profile Values
backup_frequency: "weekly" (unless they override it).
Profile Change Propagation
TheNodeProfilesApplier handles propagation:
Use Cases
Environment Profiles
Define profiles per environment:Location Profiles
Define profiles per datacenter:Role Profiles
Define profiles by device role:Compliance Profiles
Define profiles for compliance requirements:Best Practices
- Use descriptive names: Make profile purpose clear
- Set appropriate priorities: Reserve low numbers (100-500) for critical profiles
- Document in label: Use
profile_labelfor human-readable names - Avoid too many profiles: 3-5 profiles per object is usually sufficient
- Profile by concern: Separate environment, location, and role profiles
- Test before applying: Validate profile values before applying to production objects
- Review periodically: Audit profile usage and remove unused profiles
Profiles vs. Templates
| Feature | Profiles | Templates |
|---|---|---|
| Purpose | Apply common settings | Create pre-configured objects |
| Timing | Applied at any time | Applied at creation |
| Updates | Propagate to objects | Don’t propagate |
| Override | Objects can override | Objects inherit but don’t track |
| Use case | Shared defaults | Object blueprints |
Next Steps
- Organize objects with Groups
- Create objects with Object Management
- Import profile data with Data Import