Terraform provider is based on latest Terraform Plugin Framework and IdentityNow Go SDK
Include provider
terraform {
required_providers {
identitynow = {
source = "swissre/identitynow"
}
}
}
For local usage you can use hardcoded provider configuration, but it is highly recommended to use environment variables.
provider "identitynow" {
host = "https://<tenant>.api.identitynow.com"
client_id = "CLIENT_ID"
client_secret = "CLIENT_SECRET"
}
Environment Variables:
- IDN_HOST
- IDN_CLIENT_ID
- IDN_CLIENT_SECRET
List of implemented data sources:
- Identity -
identitynow_identity
- Cluster -
identitynow_cluster
- Connector -
identitynow_connector
- Entitlement -
identitynow_entitlement
List of implemented resources:
- Identity Attribute -
identitynow_identity_attribute
- Transform -
identitynow_transform
- Source -
identitynow_source
- Source Schema -
identitynow_source_schema
- Identity Profile -
identitynow_identity_profile
- Lifecycle State -
identitynow_lifecycle_state
- Connector Rule -
identitynow_connector_rule
- Workflow -
identitynow_workflow
Using jsontype
as a workaround for unstructured data type
https://stackoverflow.com/questions/75024670/how-can-i-create-an-attribute-in-my-terraform-plugin-that-accepts-multiple-data
Download and install Go
Download latest terraform (>= 1.7.2) and add it to the PATH.
For local development follow up steps - https://developer.hashicorp.com/terraform/tutorials/providers-plugin-framework/providers-plugin-framework-provider#prepare-terraform-for-local-provider-install
In short: create terraform.rc
in your %APPDATA%
folder with similar content
provider_installation {
dev_overrides {
"swissre/identitynow" = "C:\\Users\\<USER_ID>\\go\\bin"
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
Download dependencies
go mod download
Build provider
go install .
Terraform Plugin Framework supports integration tests - and it is recommended to use mock server for testing. For mocking IdentityNow API we have used Mockoon which allows to create and run mock servers.
- Download and install Mockoon Desktop App (use portable version)
- Import
mock/identitynow_mockoon.json
configuration file
Mockoon has CLI and Docker image. If possible use Docker image, but if you don't have Docker installed you can use CLI.
docker run -d --mount type=bind,source=./mock/identitynow_mockoon.json,target=/data,readonly -p 3000:3000 mockoon/cli:latest -d data -p 3000
mockoon-cli start --data ./mock/identitynow_mockoon.json --port 3000
To enable Terraform Testing set environment variable TF_ACC=1
and run tests
go test ./... -v
To enable Terraform Testing set environment variable TF_ACC=1
, IDN_HOST
, IDN_CLIENT_ID
and IDN_CLIENT_SECRET
and run integration tests
go test ./... -v -tags=integration
Documentation is generated using tfplugindocs
tool. To generate documentation run
go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
Add all release notes in CHANGELOG.md
with new version number and date.
Create new branch starting with release-prep/X.Y.Z
and create a pull request to main
branch.
When Pull Request will be merged to main
branch, then release process will start automatically.