Skip to content

Commit

Permalink
Insert function instance resource (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
deanhuynh authored Nov 1, 2023
1 parent db4eee1 commit 10d8f71
Show file tree
Hide file tree
Showing 19 changed files with 565 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/resources/destination.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "segment_destination" "my_destination" {

- `enabled` (Boolean)
- `metadata` (Attributes) (see [below for nested schema](#nestedatt--metadata))
- `settings` (String) The settings associated with the Destination.
- `settings` (String) The settings associated with the Destination. Only settings included in the configuration will be managed by Terraform.
- `source_id` (String)

### Optional
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/destination_subscription.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ resource "segment_destination_subscription" "send_to_webhook" {
- `destination_id` (String) The associated Destination instance id.
- `enabled` (Boolean) Is the subscription enabled.
- `name` (String) The name of the subscription.
- `settings` (String) The customer settings for action fields.
- `settings` (String) The customer settings for action fields. Only settings included in the configuration will be managed by Terraform.
- `trigger` (String) FQL string that describes what events should trigger a Destination action.

### Optional
Expand Down
41 changes: 41 additions & 0 deletions docs/resources/insert_function_instance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "segment_insert_function_instance Resource - terraform-provider-segment"
subcategory: ""
description: |-
---

# segment_insert_function_instance (Resource)



## Example Usage

```terraform
# Configures a specific warehouse
resource "segment_insert_function_instance" "example" {
integration_id = segment_source.my_source.id
function_id = segment_function.my_function.id
name = "My insert function instance"
enabled = true
settings = jsonencode({
"apiKey" : "abc123"
})
}
```

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

### Required

- `enabled` (Boolean) Whether this insert Function instance should be enabled for the Destination.
- `function_id` (String) Insert Function id to which this instance is associated.
- `integration_id` (String) The Source or Destination id to be connected.
- `name` (String) Defines the display name of the insert Function instance.
- `settings` (String) An object that contains settings for this insert Function instance based on the settings present in the insert Function class. Only settings included in the configuration will be managed by Terraform.

### Read-Only

- `id` (String) The unique identifier for the insert function instance.
2 changes: 2 additions & 0 deletions docs/resources/profiles_warehouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ resource "segment_profiles_warehouse" "example" {
You can find the full list of Warehouse metadata and related settings information in the
'/catalog/warehouses' endpoint.
Only settings included in the configuration will be managed by Terraform.
- `space_id` (String) The Space id.

### Optional
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/source.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ resource "segment_source" "my_source_with_schema_settings" {

- `enabled` (Boolean) Enable to receive data from the Source.
- `metadata` (Attributes) The metadata for the Source. (see [below for nested schema](#nestedatt--metadata))
- `settings` (String) The settings associated with the Source.
- `settings` (String) The settings associated with the Source. Only settings included in the configuration will be managed by Terraform.
- `slug` (String) The slug used to identify the Source in the Segment app.

### Optional
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/warehouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ resource "segment_warehouse" "example" {
### Required

- `metadata` (Attributes) The metadata for the Warehouse. (see [below for nested schema](#nestedatt--metadata))
- `settings` (String) The settings associated with this Warehouse. Common settings are connection-related configuration used to connect to it, for example host, username, and port.
- `settings` (String) The settings associated with this Warehouse. Common settings are connection-related configuration used to connect to it, for example host, username, and port. Only settings included in the configuration will be managed by Terraform.

### Optional

Expand Down
10 changes: 10 additions & 0 deletions examples/resources/segment_insert_function_instance/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Configures a specific warehouse
resource "segment_insert_function_instance" "example" {
integration_id = segment_source.my_source.id
function_id = segment_function.my_function.id
name = "My insert function instance"
enabled = true
settings = jsonencode({
"apiKey" : "abc123"
})
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
github.com/hashicorp/terraform-plugin-go v0.19.0
github.com/hashicorp/terraform-plugin-testing v1.5.1
github.com/segmentio/public-api-sdk-go v0.0.0-20230929231020-03b5b5c0694f
github.com/segmentio/public-api-sdk-go v0.0.0-20231101181027-db50b48ed4f0
gotest.tools/gotestsum v1.11.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
github.com/segmentio/public-api-sdk-go v0.0.0-20230929231020-03b5b5c0694f h1:8OdwHmyOhBxXc7JtGcLdmUTfca+427ZSAm4nExo87cg=
github.com/segmentio/public-api-sdk-go v0.0.0-20230929231020-03b5b5c0694f/go.mod h1:fDixWBn2itqFvc2v9R89DCfQkkOhA9PSJifl2mTP4Gg=
github.com/segmentio/public-api-sdk-go v0.0.0-20231101181027-db50b48ed4f0 h1:3UbA2+1JLo6FsxM3JwyFd0DgEGoV8mdDXyZTVUgLfug=
github.com/segmentio/public-api-sdk-go v0.0.0-20231101181027-db50b48ed4f0/go.mod h1:fDixWBn2itqFvc2v9R89DCfQkkOhA9PSJifl2mTP4Gg=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/destination_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (r *destinationResource) Schema(_ context.Context, _ resource.SchemaRequest
},
"settings": schema.StringAttribute{
Required: true,
Description: "The settings associated with the Destination.",
Description: "The settings associated with the Destination. Only settings included in the configuration will be managed by Terraform.",
CustomType: jsontypes.NormalizedType{},
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/destination_subscription_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (r *destinationSubscriptionResource) Schema(_ context.Context, _ resource.S
},
"settings": schema.StringAttribute{
Required: true,
Description: `The customer settings for action fields.`,
Description: `The customer settings for action fields. Only settings included in the configuration will be managed by Terraform.`,
CustomType: jsontypes.NormalizedType{},
},
},
Expand Down
Loading

0 comments on commit 10d8f71

Please sign in to comment.