Skip to content

Commit

Permalink
closes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
skyscrapr committed Apr 9, 2024
1 parent 4387937 commit ee78d8d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/resources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ resource "pinecone_index" "test" {

### Required

- `dimension` (Number) The dimensions of the vectors to be inserted in the index
- `name` (String) The name of the index to be created. The maximum length is 45 characters.
- `spec` (Attributes) Spec (see [below for nested schema](#nestedatt--spec))

### Optional

- `dimension` (Number) The dimensions of the vectors to be inserted in the index
- `metric` (String) The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

Expand Down
1 change: 1 addition & 0 deletions examples/data-sources/pinecone_collection/data-source.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ provider "pinecone" {

resource "pinecone_index" "test" {
name = "tftestindex"
dimension = 10
spec = {
pod = {
environment = "us-west4-gcp"
Expand Down
1 change: 1 addition & 0 deletions examples/data-sources/pinecone_index/data-source.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ provider "pinecone" {

resource "pinecone_index" "test" {
name = "tftestindex"
dimension = 10
spec = {
serverless = {
cloud = "aws"
Expand Down
1 change: 1 addition & 0 deletions examples/data-sources/pinecone_indexes/data-source.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ provider "pinecone" {

resource "pinecone_index" "test" {
name = "tftestindex"
dimension = 10
spec = {
serverless = {
cloud = "aws"
Expand Down
1 change: 1 addition & 0 deletions examples/resources/pinecone_collection/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ provider "pinecone" {

resource "pinecone_index" "test" {
name = "tftestindex"
dimension = 10
spec = {
pod = {
environment = "us-west4-gcp"
Expand Down
2 changes: 1 addition & 1 deletion examples/resources/pinecone_index/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ terraform {
}

provider "pinecone" {
environment = "us-west4-gcp"
# api_key = set via PINECONE_API_KEY env variable
}

resource "pinecone_index" "test" {
name = "tftestindex"
dimension = 10
spec = {
serverless = {
cloud = "aws"
Expand Down
4 changes: 1 addition & 3 deletions pinecone/provider/index_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ func (r *IndexResource) Schema(ctx context.Context, req resource.SchemaRequest,
},
"dimension": schema.Int64Attribute{
MarkdownDescription: "The dimensions of the vectors to be inserted in the index",
Optional: true,
Computed: true,
Default: int64default.StaticInt64(1536),
Required: true,
Validators: []validator.Int64{
int64validator.AtLeast(1),
},
Expand Down
2 changes: 2 additions & 0 deletions pinecone/provider/index_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ provider "pinecone" {
resource "pinecone_index" "test" {
name = %q
dimension = 1536
spec = {
serverless = {
cloud = "aws"
Expand All @@ -141,6 +142,7 @@ provider "pinecone" {
resource "pinecone_index" "test" {
name = %q
dimension = 1536
spec = {
pod = {
environment = "us-west4-gcp"
Expand Down

0 comments on commit ee78d8d

Please sign in to comment.