Skip to content

Commit

Permalink
Merge pull request #133 from Venafi/VC-33248/cloud-provider-data-source
Browse files Browse the repository at this point in the history
feat(cloud-provider): Adds cloud provider data source
  • Loading branch information
rvelaVenafi authored May 16, 2024
2 parents fa5e78c + db2f122 commit cda675c
Show file tree
Hide file tree
Showing 10 changed files with 216 additions and 78 deletions.
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,20 @@ else
endif
ifeq ($(UNAME_S),Darwin)
OS_STR := darwin
CPU_STR := amd64

UNAME_P := $(shell uname -p)
ifeq ($(UNAME_P),x86_64)
CPU_STR := amd64
else
ifneq ($(filter %86,$(UNAME_P)),)
CPU_STR := 386
else
CPU_STR := amd64
endif
ifeq ($(UNAME_P),arm)
CPU_STR := arm64
endif
endif
endif
endif

Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ for the provider in the `provider` block using the
```text
provider "venafi" {
token_url = "xxxxxxxx-xxxx"
idp_jwt = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
external_jwt = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
zone = "Business App\\Enterprise CIT"
}
```
Expand All @@ -199,22 +199,22 @@ for the provider in the `provider` block using the

The `venafi` provider has the following options:

| Property | Type | Description | Env. Variable |
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `api_key` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | `Venafi Control Plane` API key | VENAFI_API |
| `access_token` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | `Trust Protection Platform` access token for the "hashicorp-terraform-by-venafi" API Application | VENAFI_TOKEN |
| `client_id` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | ID of the application that will request tokens. Not necessary when `access_token` provided. If not provided, defaults to `hashicorp-terraform-by-venafi` | VENAFI_CLIENT_ID |
| `external_jwt` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | JWT of the Identity Provider associated to a `Venafi Control Plane` service account. Use it along with `tenant_id` to request access tokens | VENAFI_EXTERNAL_JWT |
| `p12_cert_filename` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | Filename of PKCS#12 keystore containing a client certificate, private key, and chain certificates to authenticate to Venafi Platform | VENAFI_P12_CERTIFICATE |
| `p12_cert_password` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | Password for the PKCS#12 keystore declared in `p12_cert_filename` | VENAFI_P12_PASSWORD |
| `tenant_id` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | ID of the `Venafi Control Plane` tenant that will request the access token. Use it along with `external_jwt` to request access tokens | VENAFI_TENANT_ID |
| `tpp_username` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | **[DEPRECATED]** Trust Protection Platform WebSDK username, use `access_token` if possible | VENAFI_USER |
| `tpp_password` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | **[DEPRECATED]** Trust Protection Platform WebSDK password, use `access_token` if possible | VENAFI_PASS |
| `trust_bundle` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | Text file containing trust anchor certificates in PEM format, generally required for Trust Protection Platform | |
| `url` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | `Trust Protection Platform` service URL (e.g. "https://tpp.venafi.example") | VENAFI_URL |
| Property | Type | Description | Env. Variable |
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `api_key` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | `Venafi Control Plane` API key | VENAFI_API |
| `access_token` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | `Trust Protection Platform` access token for the "hashicorp-terraform-by-venafi" API Application | VENAFI_TOKEN |
| `client_id` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | ID of the application that will request tokens. Not necessary when `access_token` provided. If not provided, defaults to `hashicorp-terraform-by-venafi` | VENAFI_CLIENT_ID |
| `external_jwt` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | JWT of the Identity Provider associated to a `Venafi Control Plane` service account. Use it along with `tenant_id` to request access tokens | VENAFI_EXTERNAL_JWT |
| `p12_cert_filename` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | Filename of PKCS#12 keystore containing a client certificate, private key, and chain certificates to authenticate to Venafi Platform | VENAFI_P12_CERTIFICATE |
| `p12_cert_password` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | Password for the PKCS#12 keystore declared in `p12_cert_filename` | VENAFI_P12_PASSWORD |
| `token_url` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | URL to request an access token from `Venafi Control Plane`. Use it along with `external_jwt` | VENAFI_TENANT_ID |
| `tpp_username` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | **[DEPRECATED]** Trust Protection Platform WebSDK username, use `access_token` if possible | VENAFI_USER |
| `tpp_password` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | **[DEPRECATED]** Trust Protection Platform WebSDK password, use `access_token` if possible | VENAFI_PASS |
| `trust_bundle` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | Text file containing trust anchor certificates in PEM format, generally required for Trust Protection Platform | |
| `url` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | `Trust Protection Platform` service URL (e.g. "https://tpp.venafi.example") | VENAFI_URL |
| `zone` | [String](https://www.terraform.io/docs/extend/schemas/schema-types.html#typestring) | Policy folder for `Trust Protection Platform` or Application name and Issuing Template API Alias for `Venafi Control Plane` (e.g. "Business App\\Enterprise CIT") | VENAFI_ZONE |
| `skip_retirement` | [Boolean](https://www.terraform.io/docs/extend/schemas/schema-types.html#typebool) | When `true` the certificate retirement on the related Venafi Platform (`Trust Protection Platform` or `Venafi Control Plane`) will be skipped | VENAFI_SKIP_RETIREMENT |
| `dev_mode` | [Boolean](https://www.terraform.io/docs/extend/schemas/schema-types.html#typebool) | When `true`, the provider operates without connecting to `Trust Protection Platform` or `Venafi Control Plane` | VENAFI_DEVMODE |
| `skip_retirement` | [Boolean](https://www.terraform.io/docs/extend/schemas/schema-types.html#typebool) | When `true` the certificate retirement on the related Venafi Platform (`Trust Protection Platform` or `Venafi Control Plane`) will be skipped | VENAFI_SKIP_RETIREMENT |
| `dev_mode` | [Boolean](https://www.terraform.io/docs/extend/schemas/schema-types.html#typebool) | When `true`, the provider operates without connecting to `Trust Protection Platform` or `Venafi Control Plane` | VENAFI_DEVMODE |

>:pushpin: **NOTE**: The indicated environment variables can be used to specify values for provider settings rather
> than including them in a configuration file. Avoid specifying a value for `api_key` unless you are using Venafi Control Plane
Expand Down
20 changes: 12 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ module github.com/Venafi/terraform-provider-venafi
go 1.21

require (
github.com/Venafi/vcert/v5 v5.6.4
github.com/Venafi/vcert/v5 v5.6.5-0.20240516011016-3f129abb0388
github.com/client9/misspell v0.3.4
github.com/golangci/golangci-lint v1.54.2
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0
github.com/pkg/errors v0.9.1
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a
golang.org/x/crypto v0.22.0
golang.org/x/crypto v0.23.0
software.sslmate.com/src/go-pkcs12 v0.4.0
)

Expand All @@ -24,6 +24,7 @@ require (
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 // indirect
github.com/Khan/genqlient v0.7.0 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/OpenPeeDeeP/depguard/v2 v2.1.0 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
Expand Down Expand Up @@ -81,7 +82,9 @@ require (
github.com/golangci/revgrep v0.5.0 // indirect
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
github.com/gostaticanalysis/comment v1.4.2 // indirect
github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect
Expand Down Expand Up @@ -191,6 +194,7 @@ require (
github.com/ultraware/funlen v0.1.0 // indirect
github.com/ultraware/whitespace v0.0.5 // indirect
github.com/uudashr/gocognit v1.0.7 // indirect
github.com/vektah/gqlparser/v2 v2.5.11 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
Expand All @@ -205,13 +209,13 @@ require (
go.uber.org/zap v1.27.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/exp/typeparams v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.19.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/tools v0.18.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230911183012-2d3300fd4832 // indirect
google.golang.org/grpc v1.58.0 // indirect
Expand Down
Loading

0 comments on commit cda675c

Please sign in to comment.