Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.0.0 #132

Merged
merged 16 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add connection_import docs, update sidebar for connection, connnectio…
…n_import reference docs
  • Loading branch information
johnsmyth committed Sep 18, 2024
commit a8eedab9380329f5e5ee10bc82cd60f2ea231ae4
109 changes: 109 additions & 0 deletions docs/reference/config-files/connection_import/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: connection_import
sidebar_label: connection_import
---


# Connection Import


The `connection_import` resource allows you to bulk import connections from other systems & formats. `connection_import` is a top-level block defined in config files (`*.fpc`) like `connection` and `workspace`.

```hcl
connection_import "steampipe" {
source = "~/.steampipe/config/*.spc"
connections = ["*"]
prefix = "sp1_"
}
```

Imported connections are converted to the native Flowpipe connection type - Steampipe `aws` connections become `aws` connections, `slack` connections are `slack` connections, etc.

The imported connections are merged into the map of all connections like any other connection, and they are referenced the same way. For example, if you have connections defined as:

```hcl
connection "gcp_dev_aaa" {
plugin = "gcp"
project = "dev-aaa"
}

connection "gcp_demo" {
plugin = "gcp"
project = "demo"
}

connection "aws_001" {
plugin = "aws"
regions = ["*"]
profile = "aws-001"
}

connection "aws_002" {
plugin = "aws"
regions = ["*"]
profile = "aws-002"
}

connection "slack" {
plugin = "slack"
token = "xoxp-12345678902345"
}
```

and import with:

```hcl
connection_import "steampipe" {
source = "~/.steampipe/config/*.spc"
connections = ["*"]
}
```

Then they will be available in Flowpipe as:

```hcl
connection.gcp.gcp_dev_aaa
connection.gcp.gcp_demo
connection.aws.aws_001
connection.aws.aws_002
connection.slack.slack
```

and they will have the same attributes as the native Flowpipe connection types:

```hcl
connection.gcp.gcp_dev_aaa.access_token
connection.aws.aws_001.env
connection.aws.aws_001.access_key
connection.aws.aws_001.secret_key
connection.aws.aws_001.session_token
connection.slack.slack.token
# etc...
```

If you specify a `prefix`, the connection names will be prepended with it:
```hcl
connection_import "steampipe" {
source = "~/.steampipe/config/*.spc"
connections = ["*"]
prefix = "sp1_"
}
```

Results in:

```hcl
connection.gcp.sp1_gcp_dev_aaa
connection.gcp.sp1_gcp_demo
connection.aws.sp1_aws_001
connection.aws.sp1_aws_002
connection.slack.sp1_slack
```

If there is a name conflict for any connections, Flowpipe will throw an error when loading.

At this time, you may only use a single `import_connection` block.

<!--
of a given type, though we may revisit this restriction in the future.
-->
54 changes: 54 additions & 0 deletions docs/reference/config-files/connection_import/steampipe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: steampipe
sidebar_label: steampipe
---


# steampipe

The `steampipe` connection import resource allows you to bulk import connections from Steampipe connections. This allows you to import the plugin connections from your Steampipe installation into Flowpipe.

```hcl
connection_import "steampipe" {
source = "~/.steampipe/config/*.spc"
connections = ["*"]
}
```

## Arguments

| Name | Type | Required?| Description
|-----------------|---------|----------|-------------------
| `source` | String | Optional | Path to the config file(s) with the connections to import. Defaults to `~/.steampipe/config/*.spc`.
| `connections` | List&ltString&gt | Optional | A list of connection names to import. You may use the `*` globbing wildcard in these entries. The default is `["*"]` (all connections).
| `prefix` | String | Optional | A string to prepend to the connection name to create the connection name.

## Examples

### Import ALL Steampipe connections
```hcl
connection_import "steampipe" {}
```
or
```hcl
connection_import "steampipe" {
source = "~/.steampipe/config/*.spc"
connections = ["*"]
}
```

### Import ALL Steampipe connections and prefix them
```hcl
connection_import "steampipe" {
prefix = "sp_"
}
```

### Import specific Steampipe connections only

```hcl
connection_import "steampipe" {
source = "~/.steampipe/config/aws.spc"
connections = ["aws_prod*", "aws_all"]
}
```
48 changes: 48 additions & 0 deletions docs/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,46 @@
"label": "Configuration Files",
"link": "reference/config-files",
"items": [
{
"type": "category",
"id": "connection",
"link": "reference/config-files/connection",
"items": [
"reference/config-files/connection/abuseipdb",
"reference/config-files/connection/alicloud",
"reference/config-files/connection/aws",
"reference/config-files/connection/azure",
"reference/config-files/connection/bitbucket",
"reference/config-files/connection/clickup",
"reference/config-files/connection/datadog",
"reference/config-files/connection/discord",
"reference/config-files/connection/freshdesk",
"reference/config-files/connection/gcp",
"reference/config-files/connection/github",
"reference/config-files/connection/gitlab",
"reference/config-files/connection/ip2locationio",
"reference/config-files/connection/ipstack",
"reference/config-files/connection/jira",
"reference/config-files/connection/jumpcloud",
"reference/config-files/connection/mastodon",
"reference/config-files/connection/okta",
"reference/config-files/connection/openai",
"reference/config-files/connection/opsgenie",
"reference/config-files/connection/pagerduty",
"reference/config-files/connection/pipes",
"reference/config-files/connection/sendgrid",
"reference/config-files/connection/servicenow",
"reference/config-files/connection/slack",
"reference/config-files/connection/teams",
"reference/config-files/connection/trello",
"reference/config-files/connection/turbot_guardrails",
"reference/config-files/connection/uptimerobot",
"reference/config-files/connection/urlscan",
"reference/config-files/connection/vault",
"reference/config-files/connection/virustotal",
"reference/config-files/connection/zendesk"
]
},
{
"type": "category",
"id": "credential",
Expand Down Expand Up @@ -181,6 +221,14 @@
"reference/config-files/credential/zendesk"
]
},
{
"type": "category",
"id": "connection_import",
"link": "reference/config-files/connection_import",
"items": [
"reference/config-files/connection_import/steampipe"
]
},
{
"type": "category",
"id": "credential_import",
Expand Down
Loading