Skip to content

Commit

Permalink
chore: add bitfinex integration
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymindarts committed Jun 17, 2024
1 parent d6535c9 commit dc1e82e
Show file tree
Hide file tree
Showing 17 changed files with 552 additions and 27 deletions.
25 changes: 25 additions & 0 deletions cala/graphql/bitfinex.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
query bfxIntegrationGet($id: UUID!){
bitfinex {
integration(id: $id) {
integrationId
name
description
omnibusAccountSetId
}
}
}

mutation bfxIntegrationCreate($input: BfxIntegrationCreateInput!) {
bitfinex {
integrationCreate(
input: $input
) {
integration {
integrationId
name
description
omnibusAccountSetId
}
}
}
}
2 changes: 1 addition & 1 deletion docs/resources/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Cala account.
## Example Usage

```terraform
resource "random_uuid" "alice_account_id" { }
resource "random_uuid" "alice_account_id" {}
resource "cala_account" "alice" {
id = random_uuid.alice_account_id.result
Expand Down
8 changes: 4 additions & 4 deletions docs/resources/account_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ Cala account.
## Example Usage

```terraform
resource "random_uuid" "journal_id" { }
resource "random_uuid" "journal_id" {}
resource "cala_journal" "journal" {
id = random_uuid.journal_id.result
name = "Default"
}
resource "random_uuid" "account_set_id" { }
resource "random_uuid" "account_set_id" {}
resource "cala_account_set" "set" {
id = random_uuid.account_set_id.result
name = "Assets"
id = random_uuid.account_set_id.result
name = "Assets"
journal_id = cala_journal.journal.id
}
```
Expand Down
14 changes: 7 additions & 7 deletions docs/resources/account_set_member_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ Cala account.
## Example Usage

```terraform
resource "random_uuid" "journal_id" { }
resource "random_uuid" "journal_id" {}
resource "cala_journal" "journal" {
id = random_uuid.journal_id.result
name = "Default"
}
resource "random_uuid" "account_set_id" { }
resource "random_uuid" "account_set_id" {}
resource "cala_account_set" "set" {
id = random_uuid.account_set_id.result
name = "Assets"
id = random_uuid.account_set_id.result
name = "Assets"
journal_id = cala_journal.journal.id
}
resource "random_uuid" "bob_account_id" { }
resource "random_uuid" "bob_account_id" {}
resource "cala_account" "bob" {
id = random_uuid.bob_account_id.result
Expand All @@ -37,8 +37,8 @@ resource "cala_account" "bob" {
}
resource "cala_account_set_member_account" "bob" {
account_set_id = cala_account_set.set.id
member_account_id = cala_account.bob.id
account_set_id = cala_account_set.set.id
member_account_id = cala_account.bob.id
}
```

Expand Down
61 changes: 61 additions & 0 deletions docs/resources/bitfinex_integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "cala_bitfinex_integration Resource - terraform-provider-cala"
subcategory: ""
description: |-
Cala Bitfinex Integration.
---

# cala_bitfinex_integration (Resource)

Cala Bitfinex Integration.

## Example Usage

```terraform
variable "bitfinex_key" {
sensitive = true
default = "dummy"
}
variable "bitfinex_secret" {
sensitive = true
default = "dummy"
}
resource "random_uuid" "journal_id" {}
resource "cala_journal" "journal" {
id = random_uuid.journal_id.result
name = "Default"
}
resource "random_uuid" "integration_id" {}
resource "cala_bitfinex_integration" "bfx" {
id = random_uuid.integration_id.result
name = "Main account"
journal_id = cala_journal.journal.id
key = var.bitfinex_key
secret = var.bitfinex_secret
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) ID of the integration.
- `journal_id` (String) journal_id
- `key` (String, Sensitive) The bitfinex API key
- `name` (String) Name of the integration.
- `secret` (String, Sensitive) The bitfinex API secret

### Optional

- `description` (String) Description of the integration.

### Read-Only

- `omnibus_account_set_id` (String) The AccountSet id for the omnibus AccountSet
2 changes: 1 addition & 1 deletion docs/resources/journal.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Cala journal.
## Example Usage

```terraform
resource "random_uuid" "journal_id" { }
resource "random_uuid" "journal_id" {}
resource "cala_journal" "journal" {
id = random_uuid.journal_id.result
Expand Down
4 changes: 4 additions & 0 deletions examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ module "account_set_member_account" {
source = "./resources/cala_account_set_member_account"
}

module "bitfinex_integration" {
source = "./resources/cala_bitfinex_integration"
}

terraform {
required_providers {
cala = {
Expand Down
2 changes: 1 addition & 1 deletion examples/resources/cala_account/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "random_uuid" "alice_account_id" { }
resource "random_uuid" "alice_account_id" {}

resource "cala_account" "alice" {
id = random_uuid.alice_account_id.result
Expand Down
2 changes: 1 addition & 1 deletion examples/resources/cala_account_set/required_providers.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
cala = {
source = "registry.terraform.io/galoymoney/cala"
source = "registry.terraform.io/galoymoney/cala"
}
}
}
8 changes: 4 additions & 4 deletions examples/resources/cala_account_set/resource.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
resource "random_uuid" "journal_id" { }
resource "random_uuid" "journal_id" {}

resource "cala_journal" "journal" {
id = random_uuid.journal_id.result
name = "Default"
}

resource "random_uuid" "account_set_id" { }
resource "random_uuid" "account_set_id" {}

resource "cala_account_set" "set" {
id = random_uuid.account_set_id.result
name = "Assets"
id = random_uuid.account_set_id.result
name = "Assets"
journal_id = cala_journal.journal.id
}
14 changes: 7 additions & 7 deletions examples/resources/cala_account_set_member_account/resource.tf
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
resource "random_uuid" "journal_id" { }
resource "random_uuid" "journal_id" {}

resource "cala_journal" "journal" {
id = random_uuid.journal_id.result
name = "Default"
}

resource "random_uuid" "account_set_id" { }
resource "random_uuid" "account_set_id" {}

resource "cala_account_set" "set" {
id = random_uuid.account_set_id.result
name = "Assets"
id = random_uuid.account_set_id.result
name = "Assets"
journal_id = cala_journal.journal.id
}

resource "random_uuid" "bob_account_id" { }
resource "random_uuid" "bob_account_id" {}

resource "cala_account" "bob" {
id = random_uuid.bob_account_id.result
Expand All @@ -22,6 +22,6 @@ resource "cala_account" "bob" {
}

resource "cala_account_set_member_account" "bob" {
account_set_id = cala_account_set.set.id
member_account_id = cala_account.bob.id
account_set_id = cala_account_set.set.id
member_account_id = cala_account.bob.id
}
11 changes: 11 additions & 0 deletions examples/resources/cala_bitfinex_integration/required_providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
terraform {
required_providers {
cala = {
source = "registry.terraform.io/galoymoney/cala"
}
}
}

provider "cala" {
endpoint = "http://localhost:2252/graphql"
}
26 changes: 26 additions & 0 deletions examples/resources/cala_bitfinex_integration/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
variable "bitfinex_key" {
sensitive = true
default = "dummy"
}

variable "bitfinex_secret" {
sensitive = true
default = "dummy"
}

resource "random_uuid" "journal_id" {}

resource "cala_journal" "journal" {
id = random_uuid.journal_id.result
name = "Default"
}

resource "random_uuid" "integration_id" {}

resource "cala_bitfinex_integration" "bfx" {
id = random_uuid.integration_id.result
name = "Main account"
journal_id = cala_journal.journal.id
key = var.bitfinex_key
secret = var.bitfinex_secret
}
2 changes: 1 addition & 1 deletion examples/resources/cala_journal/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "random_uuid" "journal_id" { }
resource "random_uuid" "journal_id" {}

resource "cala_journal" "journal" {
id = random_uuid.journal_id.result
Expand Down
Loading

0 comments on commit dc1e82e

Please sign in to comment.