-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# file to showcase how to import various resources | ||
|
||
# 1. define the resources to import | ||
# 2. find the resource IDs in the UI or wgc | ||
# 3. Run terraform import | ||
|
||
# terraform import cosmo_namespace.import <namespace_id> | ||
resource "cosmo_namespace" "import" {} | ||
|
||
# terraform import cosmo_contract.import <contract_id> | ||
resource "cosmo_contract" "import" {} | ||
|
||
# terraform import cosmo_federated_graph.import <federated_graph_id> | ||
resource "cosmo_federated_graph" "import" {} | ||
|
||
# terraform import cosmo_subgraph.import <subgraph_id> | ||
resource "cosmo_subgraph" "import" {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
terraform { | ||
required_providers { | ||
cosmo = { | ||
source = "wundergraph/cosmo" | ||
version = "0.0.1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
locals { | ||
schema = <<EOF | ||
type Query { | ||
getWunder: Wunder! | ||
getWunderByTitle(title: String!): Wunder! | ||
} | ||
type Wunder { | ||
title: String | ||
} | ||
type Graph { | ||
name: String | ||
wunders: [Wunder] | ||
} | ||
EOF | ||
} | ||
|
||
resource "cosmo_namespace" "test" { | ||
name = "import-test" | ||
} | ||
|
||
resource "cosmo_federated_graph" "test" { | ||
|
||
name = "import-test" | ||
namespace = cosmo_namespace.test.name | ||
|
||
routing_url = "http://localhost:9999" | ||
label_matchers = ["team=backend", "stage=import-test"] | ||
depends_on = [cosmo_subgraph.test] | ||
} | ||
|
||
// create each stages subgraph | ||
resource "cosmo_subgraph" "test" { | ||
name = "import-test-sg" | ||
schema = local.schema | ||
|
||
namespace = cosmo_namespace.test.name | ||
labels = { | ||
"team" = "backend" | ||
"stage" = "import-test" | ||
} | ||
|
||
routing_url = "http://localhost:9997" | ||
} | ||
|
||
resource "cosmo_contract" "test" { | ||
name = "import-test-contract" | ||
namespace = cosmo_namespace.test.name | ||
source = cosmo_federated_graph.test.name | ||
|
||
routing_url = "http://localhost:9998" | ||
exclude_tags = ["backend"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
terraform { | ||
required_providers { | ||
cosmo = { | ||
source = "wundergraph/cosmo" | ||
version = "0.0.1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters