Skip to content

Commit 0b0dd8b

Browse files
author
github-actions
committed
Sync docs from infrahub-sync repo
1 parent 76b5eb9 commit 0b0dd8b

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

docs/docs-sync/adapters/infrahub.mdx

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ The adapter reads connection settings from the synchronization configuration and
5252
token: "<INFRAHUB_TOKEN>" # Optional if using env var
5353
branch: "main" # Optional, defaults to main
5454
verify_ssl: true # Optional, defaults to true
55+
source: "data-sync" # Optional, CoreAccountGroup name for lineage source
56+
owner: "network-team" # Optional, CoreAccountGroup name for lineage owner
5557
```
5658
5759
</TabItem>
@@ -92,6 +94,8 @@ The adapter reads connection settings from the synchronization configuration and
9294
| `token` | string | Yes* | - | API token for authentication |
9395
| `branch` | string | No | main | Target branch for operations |
9496
| `verify_ssl` | boolean | No | true | Verify SSL certificates |
97+
| `source` | string | No | - | CoreAccountGroup name to use as lineage source |
98+
| `owner` | string | No | - | CoreAccountGroup name to use as lineage owner |
9599

96100
*Can be provided via environment variables instead.
97101

@@ -145,12 +149,44 @@ fields:
145149
reference: BuiltinTag
146150
```
147151

148-
## Source account tracking
152+
## Lineage tracking
149153

150-
When syncing data into Infrahub, the adapter tracks the source of each record using Infrahub's account system. The adapter looks for a `CoreAccount` with a name matching the source adapter name, enabling:
154+
When syncing data into Infrahub, the adapter tracks the source and owner of each record using Infrahub's lineage system. This enables:
151155

152156
- Tracking which system created each record
153157
- Protecting source-managed attributes from manual edits
158+
- Assigning ownership to teams or groups
159+
160+
### Default behavior
161+
162+
By default, the adapter looks for a `CoreAccount` with a name matching the source adapter name. This account is used as both the source and owner for all synced attributes.
163+
164+
### Using account groups
165+
166+
You can override the default behavior by specifying `source` and/or `owner` in the destination settings. When specified, these values are used to look up a `CoreAccountGroup` by name:
167+
168+
```yaml
169+
destination:
170+
name: infrahub
171+
settings:
172+
url: "http://localhost:8000"
173+
token: "<TOKEN>"
174+
source: "data-sync" # Uses CoreAccountGroup "data-sync" as source
175+
owner: "network-team" # Uses CoreAccountGroup "network-team" as owner
176+
```
177+
178+
This allows you to:
179+
180+
- Use different groups for source and owner
181+
- Override only one while keeping the default account for the other
182+
- Assign ownership to a team rather than an individual account
183+
184+
| Configuration | Source | Owner |
185+
|--------------|--------|-------|
186+
| Neither specified | CoreAccount (source name) | CoreAccount (source name) |
187+
| Only `source` specified | CoreAccountGroup | CoreAccount (source name) |
188+
| Only `owner` specified | CoreAccount (source name) | CoreAccountGroup |
189+
| Both specified | CoreAccountGroup | CoreAccountGroup |
154190

155191
## Generating the models
156192

0 commit comments

Comments
 (0)