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
.
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:
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:
connection_import "steampipe" { source = "~/.steampipe/config/*.spc" connections = ["*"]}
Then they will be available in Flowpipe as:
connection.gcp.gcp_dev_aaaconnection.gcp.gcp_democonnection.aws.aws_001connection.aws.aws_002connection.slack.slack
and they will have the same attributes as the native Flowpipe connection types:
connection.gcp.gcp_dev_aaa.access_tokenconnection.aws.aws_001.envconnection.aws.aws_001.access_keyconnection.aws.aws_001.secret_keyconnection.aws.aws_001.session_tokenconnection.slack.slack.token# etc...
If you specify a prefix
, the connection names will be prepended with it:
connection_import "steampipe" { source = "~/.steampipe/config/*.spc" connections = ["*"] prefix = "sp1_" }
Results in:
connection.gcp.sp1_gcp_dev_aaaconnection.gcp.sp1_gcp_democonnection.aws.sp1_aws_001connection.aws.sp1_aws_002connection.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.