Skip to content

Commit

Permalink
fix: update provider example
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyuan committed Nov 20, 2024
1 parent d47b8e7 commit 61d337d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,27 @@ The OpenAI provider enables you to configure resources and data sources for your
## Example Usage

```terraform
# Configure the OpenAI provider
provider "openai" {
admin_key = "sk-admin-0000000000000000000000000000000000000000"
}
# Create a project
resource "openai_project" "example" {
name = "Example Project"
}
# Create a service account for the project
resource "openai_project_service_account" "example" {
project_id = openai_project.example.id
name = "my-service-account"
}
# Output the API key for the service account
output "service_account_api_key" {
sensitive = true
value = openai_project_service_account.example.api_key
}
```

<!-- schema generated by tfplugindocs -->
Expand Down
18 changes: 18 additions & 0 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# Configure the OpenAI provider
provider "openai" {
admin_key = "sk-admin-0000000000000000000000000000000000000000"
}

# Create a project
resource "openai_project" "example" {
name = "Example Project"
}

# Create a service account for the project
resource "openai_project_service_account" "example" {
project_id = openai_project.example.id
name = "my-service-account"
}

# Output the API key for the service account
output "service_account_api_key" {
sensitive = true
value = openai_project_service_account.example.api_key
}

0 comments on commit 61d337d

Please sign in to comment.