diff --git a/.gitignore b/.gitignore index 90a339e..1e7925b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ terraform.tfstate *.log *.bak -terraform-provider-keeper -terraform-provider-keeper*.zip -terraform-provider-keeper*SHA256SUMS +terraform-provider-secretsmanager +terraform-provider-secretsmanager*.zip +terraform-provider-secretsmanager*SHA256SUMS dist/ diff --git a/Makefile b/Makefile index 72a6675..1bc4c8a 100644 --- a/Makefile +++ b/Makefile @@ -11,34 +11,34 @@ testacc: TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m install: - go build -o ~/.terraform.d/plugins/terraform-provider-keeper + go build -o ~/.terraform.d/plugins/terraform-provider-secretsmanager build-all: - $(eval GOOS=darwin) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}_${GOOS}_${GOARCH} - $(eval GOOS=darwin) $(eval GOARCH=arm64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}_${GOOS}_${GOARCH} - $(eval GOOS=freebsd) $(eval GOARCH=386) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}_${GOOS}_${GOARCH} - $(eval GOOS=freebsd) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}_${GOOS}_${GOARCH} - $(eval GOOS=freebsd) $(eval GOARCH=arm) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}_${GOOS}_${GOARCH} - $(eval GOOS=linux) $(eval GOARCH=386) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}_${GOOS}_${GOARCH} - $(eval GOOS=linux) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}_${GOOS}_${GOARCH} - $(eval GOOS=linux) $(eval GOARCH=arm) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}_${GOOS}_${GOARCH} - $(eval GOOS=linux) $(eval GOARCH=arm64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}_${GOOS}_${GOARCH} - $(eval GOOS=windows) $(eval GOARCH=386) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}_${GOOS}_${GOARCH}.exe - $(eval GOOS=windows) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}_${GOOS}_${GOARCH}.exe + $(eval GOOS=darwin) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}_${GOOS}_${GOARCH} + $(eval GOOS=darwin) $(eval GOARCH=arm64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}_${GOOS}_${GOARCH} + $(eval GOOS=freebsd) $(eval GOARCH=386) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}_${GOOS}_${GOARCH} + $(eval GOOS=freebsd) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}_${GOOS}_${GOARCH} + $(eval GOOS=freebsd) $(eval GOARCH=arm) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}_${GOOS}_${GOARCH} + $(eval GOOS=linux) $(eval GOARCH=386) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}_${GOOS}_${GOARCH} + $(eval GOOS=linux) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}_${GOOS}_${GOARCH} + $(eval GOOS=linux) $(eval GOARCH=arm) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}_${GOOS}_${GOARCH} + $(eval GOOS=linux) $(eval GOARCH=arm64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}_${GOOS}_${GOARCH} + $(eval GOOS=windows) $(eval GOARCH=386) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}_${GOOS}_${GOARCH}.exe + $(eval GOOS=windows) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}_${GOOS}_${GOARCH}.exe release-all: - $(eval GOOS=darwin) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} - $(eval GOOS=darwin) $(eval GOARCH=arm64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} - $(eval GOOS=freebsd) $(eval GOARCH=386) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} - $(eval GOOS=freebsd) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} - $(eval GOOS=freebsd) $(eval GOARCH=arm) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} - $(eval GOOS=linux) $(eval GOARCH=386) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} - $(eval GOOS=linux) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} - $(eval GOOS=linux) $(eval GOARCH=arm) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} - $(eval GOOS=linux) $(eval GOARCH=arm64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} - $(eval GOOS=windows) $(eval GOARCH=386) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}.exe; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION}.exe - $(eval GOOS=windows) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-keeper_${VVERSION}.exe; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION}.exe - shasum -a 256 terraform-provider-keeper_${VERSION}_*.zip > terraform-provider-keeper_${VERSION}_SHA256SUMS -# detached signature terraform-provider-keeper_keeper_${VERSION}_SHA256SUMS.{asc|sig} -# gpg -ab terraform-provider-keeper_keeper_${VERSION}_SHA256SUMS -# gpg -sb terraform-provider-keeper_keeper_${VERSION}_SHA256SUMS + $(eval GOOS=darwin) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} + $(eval GOOS=darwin) $(eval GOARCH=arm64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} + $(eval GOOS=freebsd) $(eval GOARCH=386) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} + $(eval GOOS=freebsd) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} + $(eval GOOS=freebsd) $(eval GOARCH=arm) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} + $(eval GOOS=linux) $(eval GOARCH=386) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} + $(eval GOOS=linux) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} + $(eval GOOS=linux) $(eval GOARCH=arm) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} + $(eval GOOS=linux) $(eval GOARCH=arm64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} + $(eval GOOS=windows) $(eval GOARCH=386) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}.exe; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION}.exe + $(eval GOOS=windows) $(eval GOARCH=amd64) GOOS=${GOOS} GOARCH=${GOARCH} go build -o terraform-provider-secretsmanager_${VVERSION}.exe; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION}.exe + shasum -a 256 terraform-provider-secretsmanager_${VERSION}_*.zip > terraform-provider-secretsmanager_${VERSION}_SHA256SUMS +# detached signature terraform-provider-secretsmanager_${VERSION}_SHA256SUMS.{asc|sig} +# gpg -ab terraform-provider-secretsmanager_${VERSION}_SHA256SUMS +# gpg -sb terraform-provider-secretsmanager_${VERSION}_SHA256SUMS diff --git a/README.md b/README.md index ebd0b3b..18a463e 100644 --- a/README.md +++ b/README.md @@ -39,15 +39,15 @@ sm client add --app --unlock-ip --config-init=b64 terraform { required_providers { # add keeper secrets manager plugin - keeper = { - source = "github.com/keeper-security/keeper" - version = ">= 0.1.0" + secretsmanager = { + source = "keeper-security/secretsmanager" + version = ">= 1.0.0" } } } # Configure plugin -provider "keeper" { +provider "secretsmanager" { credential = file("~/.keeper/credential") } ``` @@ -64,7 +64,7 @@ If you need help, send an e-mail to [sm@keepersecurity.com](mailto:sm@keepersecu Get the source code: ```bash -git clone https://github.com/keeper-security/terraform-provider-keeper +git clone https://github.com/keeper-security/terraform-provider-secretsmanager ``` Build it using: @@ -132,48 +132,48 @@ It is officially supported and actively maintained by Keeper Security. ```hcl terraform { required_providers { - keeper = { - source = "keeper/keeper" - version = ">= 0.1.0" + secretsmanager = { + source = "keeper-security/secretsmanager" + version = ">= 1.0.0" } } } -provider "keeper" { +provider "secretsmanager" { credential = "" # credential = file("~/.keeper/credential") } -data "keeper_secret_database_credentials" "my_db_creds" { +data "secretsmanager_database_credentials" "my_db_creds" { path = "" } output "db_type" { - value = data.keeper_secret_database_credentials.my_db_creds.db_type + value = data.secretsmanager_database_credentials.my_db_creds.db_type } output "login" { - value = data.keeper_secret_database_credentials.my_db_creds.login + value = data.secretsmanager_database_credentials.my_db_creds.login } ``` -### Terraform v0.13 and above ([GitHub](https://github.com/keeper-security/terraform-provider-keeper/) manual install) +### Terraform v0.13 and above ([GitHub](https://github.com/keeper-security/terraform-provider-secretsmanager/) manual install) -Download archive with the [latest release](https://github.com/keeper-security/terraform-provider-keeper/releases/latest) for your platform and copy it to the corresponding plugin folder (_Linux and MacOS:_ `~/.terraform.d/plugins/github.com/keeper-security/keeper` _Windows:_ `%APPDATA%/terraform.d/plugins/github.com/keeper-security/keeper`) -Use the same config from above just remember to initialize `source` with the full URL `source = "github.com/keeper-security/keeper"` +Download archive with the [latest release](https://github.com/keeper-security/terraform-provider-secretsmanager/releases/latest) for your platform and copy it to the corresponding plugin folder (_Linux and MacOS:_ `~/.terraform.d/plugins/github.com/keeper-security/secretsmanager` _Windows:_ `%APPDATA%/terraform.d/plugins/github.com/keeper-security/secretsmanager`) +Use the same config from above just remember to initialize `source` with the full URL `source = "github.com/keeper-security/secretsmanager"` MacOS: ```bash -mkdir -p ~/.terraform.d/plugins/github.com/keeper-security/keeper && \ -cd ~/.terraform.d/plugins/github.com/keeper-security/keeper && \ -curl -SfLOJ https://github.com/keeper-security/terraform-provider-keeper/releases/latest/download/terraform-provider-keeper_1.0.0_darwin_amd64.zip +mkdir -p ~/.terraform.d/plugins/github.com/keeper-security/secretsmanager && \ +cd ~/.terraform.d/plugins/github.com/keeper-security/secretsmanager && \ +curl -SfLOJ https://github.com/keeper-security/terraform-provider-secretsmanager/releases/latest/download/terraform-provider-secretsmanager_1.0.0_darwin_amd64.zip ``` Windows: ```bash SETLOCAL EnableExtensions && ^ -mkdir %APPDATA%\.terraform.d\plugins\github.com\keeper-security\keeper && ^ -cd %APPDATA%\.terraform.d\plugins\github.com\keeper-security\keeper && ^ -curl -SfLOJ https://github.com/keeper-security/terraform-provider-keeper/releases/latest/download/terraform-provider-keeper_1.0.0_windows_amd64.zip +mkdir %APPDATA%\.terraform.d\plugins\github.com\keeper-security\secretsmanager && ^ +cd %APPDATA%\.terraform.d\plugins\github.com\keeper-security\secretsmanager && ^ +curl -SfLOJ https://github.com/keeper-security/terraform-provider-secretsmanager/releases/latest/download/terraform-provider-secretsmanager_1.0.0_windows_amd64.zip ``` Have a look at some working [examples](./examples) in this repo. @@ -184,28 +184,27 @@ Afterwards you can run the following example with Terraform. ```hcl terraform { required_providers { - keeper = { - version = ">= 0.1.0" + secretsmanager = { + version = ">= 1.0.0" } } } -provider "keeper" { +provider "secretsmanager" { credential = "" # credential = file("~/.keeper/credential") } -data "keeper_secret_database_credentials" "my_db_creds" { +data "secretsmanager_database_credentials" "my_db_creds" { path = "" } output "db_type" { - value = data.keeper_secret_database_credentials.my_db_creds.db_type + value = data.secretsmanager_database_credentials.my_db_creds.db_type } output "login" { - value = data.keeper_secret_database_credentials.my_db_creds.login + value = data.secretsmanager_database_credentials.my_db_creds.login } ``` Have a look at some working [examples](./examples) in this repo. - diff --git a/build-release.sh b/build-release.sh index 80d0329..cb594d7 100755 --- a/build-release.sh +++ b/build-release.sh @@ -7,15 +7,15 @@ VVERSION=v${VERSION} echo LATEST_TAG=$LATEST_TAG -export GOOS=darwin; export GOARCH=amd64 ;go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} -export GOOS=darwin; export GOARCH=arm64 ;go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} -export GOOS=freebsd; export GOARCH=386 ;go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} -export GOOS=freebsd; export GOARCH=amd64 ;go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} -export GOOS=freebsd; export GOARCH=arm ;go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} -export GOOS=linux; export GOARCH=386 ;go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} -export GOOS=linux; export GOARCH=amd64 ;go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} -export GOOS=linux; export GOARCH=arm ;go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} -export GOOS=linux; export GOARCH=arm64 ;go build -o terraform-provider-keeper_${VVERSION}; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION} -export GOOS=windows; export GOARCH=386 ;go build -o terraform-provider-keeper_${VVERSION}.exe; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION}.exe -export GOOS=windows; export GOARCH=amd64 ;go build -o terraform-provider-keeper_${VVERSION}.exe; zip -m terraform-provider-keeper_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-keeper_${VVERSION}.exe -shasum -a 256 terraform-provider-keeper_${VERSION}_*.zip > terraform-provider-keeper_${VERSION}_SHA256SUMS +export GOOS=darwin; export GOARCH=amd64 ;go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} +export GOOS=darwin; export GOARCH=arm64 ;go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} +export GOOS=freebsd; export GOARCH=386 ;go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} +export GOOS=freebsd; export GOARCH=amd64 ;go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} +export GOOS=freebsd; export GOARCH=arm ;go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} +export GOOS=linux; export GOARCH=386 ;go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} +export GOOS=linux; export GOARCH=amd64 ;go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} +export GOOS=linux; export GOARCH=arm ;go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} +export GOOS=linux; export GOARCH=arm64 ;go build -o terraform-provider-secretsmanager_${VVERSION}; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION} +export GOOS=windows; export GOARCH=386 ;go build -o terraform-provider-secretsmanager_${VVERSION}.exe; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION}.exe +export GOOS=windows; export GOARCH=amd64 ;go build -o terraform-provider-secretsmanager_${VVERSION}.exe; zip -m terraform-provider-secretsmanager_${VERSION}_${GOOS}_${GOARCH}.zip terraform-provider-secretsmanager_${VVERSION}.exe +shasum -a 256 terraform-provider-secretsmanager_${VERSION}_*.zip > terraform-provider-secretsmanager_${VERSION}_SHA256SUMS diff --git a/docs/data-sources/address.md b/docs/data-sources/address.md index 13191cc..61ad755 100644 --- a/docs/data-sources/address.md +++ b/docs/data-sources/address.md @@ -1,11 +1,11 @@ -# keeper_secret_address Data Source +# secretsmanager_address Data Source Use this data source to read secrets of type `address` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_address" "address" { +data "secretsmanager_address" "address" { path = "" } ``` diff --git a/docs/data-sources/bank_account.md b/docs/data-sources/bank_account.md index 910dbba..6cab11e 100644 --- a/docs/data-sources/bank_account.md +++ b/docs/data-sources/bank_account.md @@ -1,11 +1,11 @@ -# keeper_secret_bank_account Data Source +# secretsmanager_bank_account Data Source Use this data source to read secrets of type `bankAccount` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_bank_account" "bank_account" { +data "secretsmanager_bank_account" "bank_account" { path = "" } ``` diff --git a/docs/data-sources/bank_card.md b/docs/data-sources/bank_card.md index 6eb962e..fd58bbf 100644 --- a/docs/data-sources/bank_card.md +++ b/docs/data-sources/bank_card.md @@ -1,11 +1,11 @@ -# keeper_secret_bank_card Data Source +# secretsmanager_bank_card Data Source Use this data source to read secrets of type `bankCard` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_bank_card" "bank_card" { +data "secretsmanager_bank_card" "bank_card" { path = "" } ``` diff --git a/docs/data-sources/birth_certificate.md b/docs/data-sources/birth_certificate.md index b3d6859..0f8bdae 100644 --- a/docs/data-sources/birth_certificate.md +++ b/docs/data-sources/birth_certificate.md @@ -1,11 +1,11 @@ -# keeper_secret_birth_certificate Data Source +# secretsmanager_birth_certificate Data Source Use this data source to read secrets of type `birthCertificate` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_birth_certificate" "birth_certificate" { +data "secretsmanager_birth_certificate" "birth_certificate" { path = "" } ``` diff --git a/docs/data-sources/contact.md b/docs/data-sources/contact.md index d665f90..21e83e7 100644 --- a/docs/data-sources/contact.md +++ b/docs/data-sources/contact.md @@ -1,11 +1,11 @@ -# keeper_secret_contact Data Source +# secretsmanager_contact Data Source Use this data source to read secrets of type `contact` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_contact" "contact" { +data "secretsmanager_contact" "contact" { path = "" } ``` diff --git a/docs/data-sources/database_credentials.md b/docs/data-sources/database_credentials.md index 6d295c6..d1a10ab 100644 --- a/docs/data-sources/database_credentials.md +++ b/docs/data-sources/database_credentials.md @@ -1,11 +1,11 @@ -# keeper_secret_database_credentials Data Source +# secretsmanager_database_credentials Data Source Use this data source to read secrets of type `databaseCredentials` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_database_credentials" "database_credentials" { +data "secretsmanager_database_credentials" "database_credentials" { path = "" } ``` diff --git a/docs/data-sources/driver_license.md b/docs/data-sources/driver_license.md index 73b6683..2bebdc7 100644 --- a/docs/data-sources/driver_license.md +++ b/docs/data-sources/driver_license.md @@ -1,11 +1,11 @@ -# keeper_secret_driver_license Data Source +# secretsmanager_driver_license Data Source Use this data source to read secrets of type `driverLicense` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_driver_license" "driver_license" { +data "secretsmanager_driver_license" "driver_license" { path = "" } ``` diff --git a/docs/data-sources/encrypted_notes.md b/docs/data-sources/encrypted_notes.md index 0a6a455..63cc6ff 100644 --- a/docs/data-sources/encrypted_notes.md +++ b/docs/data-sources/encrypted_notes.md @@ -1,11 +1,11 @@ -# keeper_secret_encrypted_notes Data Source +# secretsmanager_encrypted_notes Data Source Use this data source to read secrets of type `encryptedNotes` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_encrypted_notes" "encrypted_notes" { +data "secretsmanager_encrypted_notes" "encrypted_notes" { path = "" } ``` diff --git a/docs/data-sources/field.md b/docs/data-sources/field.md index cde6c67..cc5bc97 100644 --- a/docs/data-sources/field.md +++ b/docs/data-sources/field.md @@ -1,11 +1,11 @@ -# keeper_secret_field Data Source +# secretsmanager_field Data Source Use this data source to read fields of secrets of any type stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_field" "field" { +data "secretsmanager_field" "field" { path = "/field/type" } ``` diff --git a/docs/data-sources/file.md b/docs/data-sources/file.md index 9724b4d..fd0ffc2 100644 --- a/docs/data-sources/file.md +++ b/docs/data-sources/file.md @@ -1,11 +1,11 @@ -# keeper_secret_file Data Source +# secretsmanager_file Data Source Use this data source to read secrets of type `file` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_file" "file" { +data "secretsmanager_file" "file" { path = "" } ``` diff --git a/docs/data-sources/general.md b/docs/data-sources/general.md index 2a16899..3dd1b0a 100644 --- a/docs/data-sources/general.md +++ b/docs/data-sources/general.md @@ -1,11 +1,11 @@ -# keeper_secret_general Data Source +# secretsmanager_general Data Source Use this data source to read secrets of type `general` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_general" "general" { +data "secretsmanager_general" "general" { path = "" } ``` diff --git a/docs/data-sources/health_insurance.md b/docs/data-sources/health_insurance.md index a0541f9..a410ef9 100644 --- a/docs/data-sources/health_insurance.md +++ b/docs/data-sources/health_insurance.md @@ -1,11 +1,11 @@ -# keeper_secret_health_insurance Data Source +# secretsmanager_health_insurance Data Source Use this data source to read secrets of type `healthInsurance` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_health_insurance" "health_insurance" { +data "secretsmanager_health_insurance" "health_insurance" { path = "" } ``` diff --git a/docs/data-sources/login.md b/docs/data-sources/login.md index ba1fda8..5dbc1c7 100644 --- a/docs/data-sources/login.md +++ b/docs/data-sources/login.md @@ -1,11 +1,11 @@ -# keeper_secret_login Data Source +# secretsmanager_login Data Source Use this data source to read secrets of type `login` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_login" "login" { +data "secretsmanager_login" "login" { path = "" } ``` diff --git a/docs/data-sources/membership.md b/docs/data-sources/membership.md index ca1166d..7a3f2d7 100644 --- a/docs/data-sources/membership.md +++ b/docs/data-sources/membership.md @@ -1,11 +1,11 @@ -# keeper_secret_membership Data Source +# secretsmanager_membership Data Source Use this data source to read secrets of type `membership` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_membership" "membership" { +data "secretsmanager_membership" "membership" { path = "" } ``` diff --git a/docs/data-sources/passport.md b/docs/data-sources/passport.md index ece0b87..84ab3e9 100644 --- a/docs/data-sources/passport.md +++ b/docs/data-sources/passport.md @@ -1,11 +1,11 @@ -# keeper_secret_passport Data Source +# secretsmanager_passport Data Source Use this data source to read secrets of type `passport` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_passport" "passport" { +data "secretsmanager_passport" "passport" { path = "" } ``` diff --git a/docs/data-sources/photo.md b/docs/data-sources/photo.md index 16a0f07..37b5c15 100644 --- a/docs/data-sources/photo.md +++ b/docs/data-sources/photo.md @@ -1,11 +1,11 @@ -# keeper_secret_photo Data Source +# secretsmanager_photo Data Source Use this data source to read secrets of type `photo` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_photo" "photo" { +data "secretsmanager_photo" "photo" { path = "" } ``` diff --git a/docs/data-sources/server_credentials.md b/docs/data-sources/server_credentials.md index 9046ca8..40ff415 100644 --- a/docs/data-sources/server_credentials.md +++ b/docs/data-sources/server_credentials.md @@ -1,11 +1,11 @@ -# keeper_secret_server_credentials Data Source +# secretsmanager_server_credentials Data Source Use this data source to read secrets of type `serverCredentials` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_server_credentials" "server_credentials" { +data "secretsmanager_server_credentials" "server_credentials" { path = "" } ``` diff --git a/docs/data-sources/software_license.md b/docs/data-sources/software_license.md index cd29e93..349f8ca 100644 --- a/docs/data-sources/software_license.md +++ b/docs/data-sources/software_license.md @@ -1,11 +1,11 @@ -# keeper_secret_software_license Data Source +# secretsmanager_software_license Data Source Use this data source to read secrets of type `softwareLicense` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_software_license" "software_license" { +data "secretsmanager_software_license" "software_license" { path = "" } ``` diff --git a/docs/data-sources/ssh_keys.md b/docs/data-sources/ssh_keys.md index 9502f8f..dc72378 100644 --- a/docs/data-sources/ssh_keys.md +++ b/docs/data-sources/ssh_keys.md @@ -1,11 +1,11 @@ -# keeper_secret_ssh_keys Data Source +# secretsmanager_ssh_keys Data Source Use this data source to read secrets of type `sshKeys` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_ssh_keys" "ssh_keys" { +data "secretsmanager_ssh_keys" "ssh_keys" { path = "" } ``` diff --git a/docs/data-sources/ssn_card.md b/docs/data-sources/ssn_card.md index 3899e3b..2c8df02 100644 --- a/docs/data-sources/ssn_card.md +++ b/docs/data-sources/ssn_card.md @@ -1,11 +1,11 @@ -# keeper_secret_ssn_card Data Source +# secretsmanager_ssn_card Data Source Use this data source to read secrets of type `ssnCard` stored in Keeper Vault ## Example Usage ```terraform -data "keeper_secret_ssn_card" "ssn_card" { +data "secretsmanager_ssn_card" "ssn_card" { path = "" } ``` diff --git a/docs/index.md b/docs/index.md index 3a8fa52..714d78c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -7,16 +7,34 @@ You can set environment variable `KEEPER_CREDENTIAL` or read it from disk using ## Installation +### Terraform 0.13+ ([Terraform Registry](https://registry.terraform.io/)) +To install this provider, copy and paste this code into your Terraform configuration. Then, run `terraform init`. +```hcl +terraform { + required_providers { + secretsmanager = { + source = "keeper-security/secretsmanager" + version = ">= 1.0.0" + } + } +} + +provider "secretsmanager" { + # Configuration options +} +``` + ### Manual Install -Download archive from [latest release](https://github.com/keeper-security/terraform-provider-keeper/releases/latest) for your platform and copy it to the corresponding plugin folder (_Linux and MacOS:_ `~/.terraform.d/plugins/github.com/keeper-security/keeper` _Windows:_ `%APPDATA%/terraform.d/plugins/github.com/keeper-security/keeper`) +Download archive with the [latest release](https://github.com/keeper-security/terraform-provider-secretsmanager/releases/latest) for your platform and copy it to the corresponding plugin folder (_Linux and MacOS:_ `~/.terraform.d/plugins/github.com/keeper-security/secretsmanager` _Windows:_ `%APPDATA%/terraform.d/plugins/github.com/keeper-security/secretsmanager`) +Use the same config from above just remember to initialize `source` with the full URL `source = "github.com/keeper-security/secretsmanager"` For help on manually installing Terraform Providers, please refer to the [official Terraform documentation](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins). ## Example Usage ```hcl -provider "keeper" { +provider "secretsmanager" { credential = file("~/.keeper/credential") } ``` diff --git a/examples/address.tf b/examples/address.tf index 61c189b..5b43b93 100644 --- a/examples/address.tf +++ b/examples/address.tf @@ -1,8 +1,8 @@ terraform { required_providers { - keeper = { - source = "github.com/keeper-security/keeper" - version = ">= 0.1.0" + secretsmanager = { + source = "keeper-security/secretsmanager" + version = ">= 1.0.0" } local = { source = "hashicorp/local" @@ -12,12 +12,12 @@ terraform { } provider "local" { } -provider "keeper" { +provider "secretsmanager" { credential = "" # credential = file("~/.keeper/credential") } -data "keeper_secret_address" "address" { +data "secretsmanager_address" "my_address" { path = "" } @@ -25,15 +25,15 @@ resource "local_file" "out" { filename = "${path.module}/out.txt" file_permission = "0644" content = <