You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+62-19Lines changed: 62 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,52 +6,95 @@ description: |-
6
6
7
7
---
8
8
9
-
# Stack Overflow Provider
9
+
# stackoverflow Provider
10
10
11
-
Use the Stack Overflow provider to manage questions, answers, and articles for your Stack Overflow for Teams. You must configure the provider with the proper credentials before you can use it.
11
+
Use the Stack Overflow provider to manage questions, answers, articles, and collections for your Stack Overflow for Teams instance. You must configure the provider with the proper credentials before you can use it.
12
12
13
13
## Example Usage
14
14
15
-
This example demonstrates the usage of the provider by setting up the provider configuration and several different resource types. Note the usage of the filter resource which is required when managing all other resource types.
15
+
This example demonstrates the usage of the provider by setting up the provider configuration and several different resource types.
|`access_token`| Required |`string`|`STACK_OVERFLOW_ACCESS_TOKEN`|| The Stack Overflow API access token |
55
-
|`team_name`| Required |`string`|`STACK_OVERFLOW_TEAM`|| The Stack Overflow team name |
56
-
|`base_url`| Optional |`string`|`STACK_OVERFLOW_API_URL`|`https://api.stackoverflowteams.com/2.3/`| The base URL for the Stack Overflow API |
57
-
|`default_tags`| Optional |`string[]`||| A list of tags to automatically associate with any resources that support tags |
56
+
## Schema
57
+
58
+
### Required
59
+
60
+
-`access_token` (String) The Stack Overflow API access token. The `STACK_OVERFLOW_ACCESS_TOKEN` environment variable can be used instead.
61
+
-`base_url` (String) The base URL for the Stack Overflow API (must end with `/`). For Stack Overflow for Teams this is in the format `https://api.stackoverflowteams.com/v3/teams/{team}/` and for Stack Overflow Enterprise this is in one of the following formats `https://{name}.stackenterprise.co/api/v3/`, `https://{name}.stackenterprise.co/api/v3/teams/{team}/`, `https://{your-custom-domain}/api/v3/`, or `https://{your-custom-domain}/api/v3/teams/{team}/`. The `STACK_OVERFLOW_API_URL` environment variable can be used instead.
62
+
63
+
## Authentication and Configuration
64
+
65
+
The Stack Overflow Terraform provider uses the Stack Overflow API v3 for interaction which works with the Teams Business and Enterprise tiers only.
66
+
67
+
### Business
68
+
69
+
Stack Overflow for Teams Business tier users should create a personal access token (PAT) using the following documentation:
API applications can be generated for users or administrators can create "service applications/keys" that are associated with the Community user which may be more appropriate in some cases. When creating an API application, set the `Domain` to your instance's url (ex: `{name}.stackenterprise.co`)
80
+
81
+
Once the API application has been registered, users should reference their site's documentation at `https://[your_site]/api/docs/authentication` for details on create an access key. Users should follow the instructions for "Desktop Applications" that uses the implicit OAuth 2.0 flow to generate an `access_token`.
82
+
83
+
> Note: The user that creates the access token will be the user referenced when creating articles, questions, and answers even if the API application is registered to the Community user. You may wish to use another non-user account to differentiate content generated by Terraform.
84
+
85
+
## Migrating from versions < 1.x
86
+
87
+
Versions prior to 1.x are not considered stable and many changes have been made that will require manual interview to ensure that your upgrade is successful.
88
+
The following is a list of features that have been removed in version 1.x:
89
+
90
+
*`stackoverflow_filter` - This data/resource is no longer available in versions > 1.x because it is no longer needed. This resource was a direct requirement to using Stack Overflow's API v2.x and had no particular meaning besides configuring API access.
91
+
*`default_tags` - Provider default tags are no longer supported. This decision was made to simplify the code base, standardize the Terraform model state to make it reflect actual configuration code, and to promote tags as first class resources. Tags are now available as data resources and can be used to ensure the resource dependency graph is more complete.
92
+
*`team_name` - Provider team name field is no longer supported which simplifies the provider configuration to be able to support both Stack Overflow for Teams Business and Stack Overflow Enterprise tiers. Users should provide the `base_url` field and include the team name if applicable in the value.
93
+
94
+
The migration steps should be as follows:
95
+
96
+
1. Remove the `stackoverflow_filter` resource from code
97
+
1. Remove the `stackoverflow_filter` resource from state by running the terraform state remove command (ex.: `terraform state rm stackoverflow_filter.filter`)
98
+
1. Remove all usage of the `filter` field from resources
99
+
1. Remove usage of the `default_tags` field from the provider (users may opt to use a local variable with default tags and then subsequently merge that list with each resource's tag values)
100
+
1. Remove usage of the `team_name` field from the provider. Users should set the `base_url` field or set the `STACK_OVERFLOW_API_URL` environment variable instead. For example, if the previous configuration only set the `team_name` field to the value `myteam`, the `base_url` field should now be set to `https://api.stackoverflowteams.com/v3/teams/myteam/`
0 commit comments