Skip to content

Commit 10d8f71

Browse files
authored
Insert function instance resource (#72)
1 parent db4eee1 commit 10d8f71

19 files changed

+565
-14
lines changed

docs/resources/destination.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ resource "segment_destination" "my_destination" {
3535

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

4141
### Optional

docs/resources/destination_subscription.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ resource "segment_destination_subscription" "send_to_webhook" {
4040
- `destination_id` (String) The associated Destination instance id.
4141
- `enabled` (Boolean) Is the subscription enabled.
4242
- `name` (String) The name of the subscription.
43-
- `settings` (String) The customer settings for action fields.
43+
- `settings` (String) The customer settings for action fields. Only settings included in the configuration will be managed by Terraform.
4444
- `trigger` (String) FQL string that describes what events should trigger a Destination action.
4545

4646
### Optional
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "segment_insert_function_instance Resource - terraform-provider-segment"
4+
subcategory: ""
5+
description: |-
6+
7+
---
8+
9+
# segment_insert_function_instance (Resource)
10+
11+
12+
13+
## Example Usage
14+
15+
```terraform
16+
# Configures a specific warehouse
17+
resource "segment_insert_function_instance" "example" {
18+
integration_id = segment_source.my_source.id
19+
function_id = segment_function.my_function.id
20+
name = "My insert function instance"
21+
enabled = true
22+
settings = jsonencode({
23+
"apiKey" : "abc123"
24+
})
25+
}
26+
```
27+
28+
<!-- schema generated by tfplugindocs -->
29+
## Schema
30+
31+
### Required
32+
33+
- `enabled` (Boolean) Whether this insert Function instance should be enabled for the Destination.
34+
- `function_id` (String) Insert Function id to which this instance is associated.
35+
- `integration_id` (String) The Source or Destination id to be connected.
36+
- `name` (String) Defines the display name of the insert Function instance.
37+
- `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.
38+
39+
### Read-Only
40+
41+
- `id` (String) The unique identifier for the insert function instance.

docs/resources/profiles_warehouse.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ resource "segment_profiles_warehouse" "example" {
4141
4242
You can find the full list of Warehouse metadata and related settings information in the
4343
'/catalog/warehouses' endpoint.
44+
45+
Only settings included in the configuration will be managed by Terraform.
4446
- `space_id` (String) The Space id.
4547

4648
### Optional

docs/resources/source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ resource "segment_source" "my_source_with_schema_settings" {
7878

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

8484
### Optional

docs/resources/warehouse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ resource "segment_warehouse" "example" {
3232
### Required
3333

3434
- `metadata` (Attributes) The metadata for the Warehouse. (see [below for nested schema](#nestedatt--metadata))
35-
- `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.
35+
- `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.
3636

3737
### Optional
3838

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Configures a specific warehouse
2+
resource "segment_insert_function_instance" "example" {
3+
integration_id = segment_source.my_source.id
4+
function_id = segment_function.my_function.id
5+
name = "My insert function instance"
6+
enabled = true
7+
settings = jsonencode({
8+
"apiKey" : "abc123"
9+
})
10+
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
99
github.com/hashicorp/terraform-plugin-go v0.19.0
1010
github.com/hashicorp/terraform-plugin-testing v1.5.1
11-
github.com/segmentio/public-api-sdk-go v0.0.0-20230929231020-03b5b5c0694f
11+
github.com/segmentio/public-api-sdk-go v0.0.0-20231101181027-db50b48ed4f0
1212
gotest.tools/gotestsum v1.11.0
1313
)
1414

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
266266
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
267267
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
268268
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
269-
github.com/segmentio/public-api-sdk-go v0.0.0-20230929231020-03b5b5c0694f h1:8OdwHmyOhBxXc7JtGcLdmUTfca+427ZSAm4nExo87cg=
270-
github.com/segmentio/public-api-sdk-go v0.0.0-20230929231020-03b5b5c0694f/go.mod h1:fDixWBn2itqFvc2v9R89DCfQkkOhA9PSJifl2mTP4Gg=
269+
github.com/segmentio/public-api-sdk-go v0.0.0-20231101181027-db50b48ed4f0 h1:3UbA2+1JLo6FsxM3JwyFd0DgEGoV8mdDXyZTVUgLfug=
270+
github.com/segmentio/public-api-sdk-go v0.0.0-20231101181027-db50b48ed4f0/go.mod h1:fDixWBn2itqFvc2v9R89DCfQkkOhA9PSJifl2mTP4Gg=
271271
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
272272
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
273273
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=

internal/provider/destination_resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (r *destinationResource) Schema(_ context.Context, _ resource.SchemaRequest
7777
},
7878
"settings": schema.StringAttribute{
7979
Required: true,
80-
Description: "The settings associated with the Destination.",
80+
Description: "The settings associated with the Destination. Only settings included in the configuration will be managed by Terraform.",
8181
CustomType: jsontypes.NormalizedType{},
8282
},
8383
},

0 commit comments

Comments
 (0)