Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspace data source #1

Merged
merged 11 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- run: go generate ./...
- name: git diff
run: |
git diff --compact-summary --exit-code || \
git diff --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)

# Run acceptance tests in a matrix with Terraform CLI versions
Expand Down
27 changes: 27 additions & 0 deletions docs/data-sources/publicapi_workspace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "publicapi_workspace Data Source - terraform-provider-public-api"
subcategory: ""
description: |-
The Workspace.
---

# publicapi_workspace (Data Source)

The Workspace.

## Example Usage

```terraform
# Gets the workspace info
data "publicapi_workspace" "my_workspace" {}
```

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

### Read-Only

- `id` (String) The unique identifier.
- `name` (String) The human-readable name.
- `slug` (String) The URL-friendly slug.
30 changes: 0 additions & 30 deletions docs/data-sources/scaffolding_example.md

This file was deleted.

20 changes: 12 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "scaffolding-framework Provider"
page_title: "public-api Provider"
subcategory: ""
description: |-

The Public API provider.
---

# scaffolding-framework Provider

# public-api Provider

The Public API provider.

## Example Usage

```terraform
provider "scaffolding" {
# example configuration here
}
# Configuration for the provider
# Token can be passed through environment variable PUBLIC_API_TOKEN
provider "publicapi" {}
```

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

### Required

- `token` (String, Sensitive) The Public API token. If not set, the PUBLIC_API_TOKEN environment variable will be used.

### Optional

- `endpoint` (String) Example provider attribute
- `url` (String) The Public API url. If not set, the PUBLIC_API_URL environment variable will be used, or a default of 'api.segmentapis.com'.
31 changes: 0 additions & 31 deletions docs/resources/scaffolding_example.md

This file was deleted.

2 changes: 2 additions & 0 deletions examples/data-sources/publicapi_workspace/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Gets the workspace info
data "publicapi_workspace" "my_workspace" {}
3 changes: 0 additions & 3 deletions examples/data-sources/scaffolding_example/data-source.tf

This file was deleted.

16 changes: 16 additions & 0 deletions examples/provider-install-verification/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
terraform {
required_providers {
publicapi = {
source = "registry.terraform.io/hashicorp/public-api"
version = "0.0.1"
}
}
}

provider "publicapi" {}

data "publicapi_workspace" "example" {}

output "workspace" {
value = data.publicapi_workspace.example
}
6 changes: 3 additions & 3 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
provider "scaffolding" {
# example configuration here
}
# Configuration for the provider
# Token can be passed through environment variable PUBLIC_API_TOKEN
provider "publicapi" {}
3 changes: 0 additions & 3 deletions examples/resources/scaffolding_example/resource.tf

This file was deleted.

6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/hashicorp/terraform-provider-scaffolding-framework
module terraform-provider-public-api

go 1.19

require (
github.com/hashicorp/terraform-plugin-docs v0.16.0
github.com/hashicorp/terraform-plugin-framework v1.3.3
github.com/hashicorp/terraform-plugin-go v0.18.0
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-testing v1.4.0
github.com/segmentio/public-api-sdk-go v0.0.0-20230731214639-bee26edfa972
)

require (
Expand Down Expand Up @@ -38,6 +38,7 @@ require (
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.18.1 // indirect
github.com/hashicorp/terraform-json v0.17.1 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.1 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
Expand Down Expand Up @@ -65,6 +66,7 @@ require (
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.11.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
Loading
Loading