Skip to content

Commit

Permalink
Merge pull request #51 from komminarlabs/tk/fix-token
Browse files Browse the repository at this point in the history
made `org_id` as optional
  • Loading branch information
thulasirajkomminar authored Aug 23, 2024
2 parents 4760e66 + 951881e commit c7348d5
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.1.1] - 2024-08-23

## Fixed:
* fixed overwriting the token value during read in `influxdb_authorization` resource.

## [1.1.0] - 2024-04-16

## Updated:
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ Required:

Required:

- `org_id` (String) An organization ID. Identifies the organization that owns the resource.
- `type` (String) A resource type. Identifies the API resource's type (or kind).

Optional:

- `id` (String) A resource ID. Identifies a specific resource.
- `org` (String) An organization name. The organization that owns the resource.
- `org_id` (String) An organization ID. Identifies the organization that owns the resource.

Read-Only:

Expand Down
10 changes: 10 additions & 0 deletions examples/data-sources/authorization/data-source.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
terraform {
required_providers {
influxdb = {
source = "komminarlabs/influxdb"
}
}
}

provider "influxdb" {}

data "influxdb_authorization" "signals_authorization" {
id = "0c91163b3f53e000"
}
Expand Down
10 changes: 10 additions & 0 deletions examples/data-sources/authorizations/data-source.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
terraform {
required_providers {
influxdb = {
source = "komminarlabs/influxdb"
}
}
}

provider "influxdb" {}

data "influxdb_authorizations" "all" {}

output "all_authorizations" {
Expand Down
10 changes: 10 additions & 0 deletions examples/data-sources/bucket/data-source.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
terraform {
required_providers {
influxdb = {
source = "komminarlabs/influxdb"
}
}
}

provider "influxdb" {}

data "influxdb_bucket" "signals" {
name = "signals"
}
Expand Down
10 changes: 10 additions & 0 deletions examples/data-sources/buckets/data-source.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
terraform {
required_providers {
influxdb = {
source = "komminarlabs/influxdb"
}
}
}

provider "influxdb" {}

data "influxdb_buckets" "all" {}

output "all_buckets" {
Expand Down
10 changes: 10 additions & 0 deletions examples/data-sources/organization/data-source.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
terraform {
required_providers {
influxdb = {
source = "komminarlabs/influxdb"
}
}
}

provider "influxdb" {}

data "influxdb_organization" "iot" {
name = "IoT"
}
Expand Down
10 changes: 10 additions & 0 deletions examples/data-sources/organizations/data-source.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
terraform {
required_providers {
influxdb = {
source = "komminarlabs/influxdb"
}
}
}

provider "influxdb" {}

data "influxdb_organizations" "all" {}

output "all_organizations" {
Expand Down
6 changes: 5 additions & 1 deletion internal/provider/authorization_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,12 @@ func (r *AuthorizationResource) Schema(ctx context.Context, req resource.SchemaR
},
},
"org_id": schema.StringAttribute{
Required: true,
Computed: true,
Optional: true,
Description: "An organization ID. Identifies the organization that owns the resource.",
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"type": schema.StringAttribute{
Required: true,
Expand Down

0 comments on commit c7348d5

Please sign in to comment.