Skip to content

Commit

Permalink
Merge pull request #246 from hashicorp/provider-sdk-2-0
Browse files Browse the repository at this point in the history
Upgrade SDK to v2.x & Drop Terraform 0.11 support
  • Loading branch information
chrisarcand committed Dec 10, 2020
2 parents bb36d4d + 3a44581 commit 5a80a5a
Show file tree
Hide file tree
Showing 80 changed files with 738 additions and 430 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
docker:
- image: docker.mirror.hashicorp.services/circleci/golang:1.14.10
environment:
TF_ACC_TERRAFORM_VERSION: 0.12.29
TEST_RESULTS_DIR: *test_results_dir

working_directory: /go/src/github.com/hashicorp/terraform-provider-tfe
Expand Down
75 changes: 39 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,66 @@ non-breaking changes.

## Installation

Declare the provider in your configuration and `terraform init` will automatically fetch and install the provider for you from the [Terraform Registry](https://registry.terraform.io/) (Terraform version 0.12.0+):
Declare the provider in your configuration and `terraform init` will automatically fetch and install the provider for you from the [Terraform Registry](https://registry.terraform.io/):

```
```hcl
terraform {
required_providers {
tfe = "~> 0.22.0"
tfe = {
version = "~> 0.24.0"
}
}
}
```

For production use, you should constrain the acceptable provider versions via configuration,
to ensure that new versions with breaking changes will not be automatically installed by
`terraform init` in future. As this provider is still at version zero, you should constrain
the acceptable provider versions on the minor version.
For production use, you should constrain the acceptable provider versions via
configuration (as above), to ensure that new versions with breaking changes will
not be automatically installed by `terraform init` in future. As this provider
is still at version zero, you should constrain the acceptable provider versions
on the minor version.

If you are using Terraform CLI version 0.11.x, you can constrain this provider to 0.15.x versions
by adding the version constraint to the `tfe` provider block.
The above snippet using `required_providers` is for Terraform 0.13+; if you are using Terraform version 0.12, you can constrain by adding the version constraint to the `provider` block instead:

```
```hcl
provider "tfe" {
version = "~> 0.15.0"
version = "~> 0.24.0"
...
}
```

Since v0.24.0, this provider requires [Terraform](https://www.terraform.io/downloads.html) >= 0.12

For more information on provider installation and constraining provider versions, see the [Provider Requirements documentation](https://www.terraform.io/docs/configuration/provider-requirements.html).

### Manually building the provider
## Usage

[Create a user or team API token in Terraform Cloud/Enterprise](https://www.terraform.io/docs/cloud/users-teams-organizations/api-tokens.html), and use the token in the provider configuration block:

```hcl
provider "tfe" {
hostname = var.hostname # Optional, for use with Terraform Enterprise. Defaults to app.terraform.io.
token = var.token
}
# Create an organization
resource "tfe_organization" "org" {
# ...
}
```

There are several other ways to configure the authentication token, depending on
your use case. For other methods, see the [Authentication documentation](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs#authentication)

For more information on configuring providers in general, see the [Provider Configuration documentation](https://www.terraform.io/docs/configuration/providers.html).


## Manually building the provider

You might prefer to manually build the provider yourself - perhaps access to the Terraform Registry or the official
release binaries on [releases.hashicorp.com](https://releases.hashicorp.com/terraform-provider-tfe/) are not available
in your operating environment, or you're looking to contribute to the provider and are testing out a custom build.

#### Requirements
- [Terraform](https://www.terraform.io/downloads.html) >= 0.11.x
- [Go](https://golang.org/doc/install) >= 1.14
Building the provider requires [Go](https://golang.org/doc/install) >= 1.14

Clone the repository, enter the directory, and build the provider:

Expand All @@ -82,27 +106,6 @@ See the [Provider Requirements](https://www.terraform.io/docs/configuration/prov
* You can create your test Terraform configurations in the same directory as your provider binary or you can copy the provider binary into the same directory as your test configurations.
* You can copy the provider binary into the same location as your `terraform` binary.

## Usage

[Create a user or team API token in Terraform Cloud/Enterprise](https://www.terraform.io/docs/cloud/users-teams-organizations/api-tokens.html), and use the token in the provider configuration block:

```hcl
provider "tfe" {
hostname = "${var.hostname}" # Optional, for use with Terraform Enterprise. Defaults to app.terraform.io.
token = "${var.token}"
}
# Create an organization
resource "tfe_organization" "org" {
# ...
}
```

There are several other ways to configure the authentication token, depending on
your use case. For other methods, see the [Authentication documentation](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs#authentication)

For more information on configuring providers in general, see the [Provider Configuration documentation](https://www.terraform.io/docs/configuration/providers.html).

## Contributing

Thanks for your interest in contributing; we appreciate your help! If you're unsure or afraid of anything, you can
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.14

require (
github.com/hashicorp/go-tfe v0.11.1
github.com/hashicorp/go-version v1.2.0
github.com/hashicorp/go-version v1.2.1
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce
github.com/hashicorp/terraform-plugin-sdk v1.13.1
github.com/hashicorp/terraform-plugin-sdk/v2 v2.3.0
github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596
)
Loading

0 comments on commit 5a80a5a

Please sign in to comment.