Một mục hướng lập trình viên trong kho dữ liệu GitHub của TopGit: keycloak/terraform-provider-keycloak, 960 sao, nhóm Developer Tools, Go. Terraform provider for Keycloak
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
If you are using Terraform 0.12, you can use this provider by downloading it and placing it within
one of the implied local mirror directories.
Or, follow the old instructions for installing third-party plugins.
If you are using any provider version below v2.0.0, you can also follow the old instructions for installing third-party plugins.
A note for users of the legacy Wildfly distribution
Recently, Keycloak has been updated to use Quarkus over the legacy Wildfly distribution. The only significant change here
that affects this Terraform provider is the removal of /auth from the default context path for the Keycloak API.
If you are using the legacy Wildfly distribution of Keycloak, you will need to set the base_path provider argument to
/auth. This can also be done by using the KEYCLOAK_BASE_PATH environment variable.
Supported Versions
This provider will officially support the latest three minor versions of Keycloak, although older versions may still work.
The following versions are used when running acceptance tests in CI:
26.8.2 (latest)
26.7.5
26.6.4
26.5.7
26.4.7
26.3.5
26.2.5
26.1.4
26.0.8
Releases
This provider uses GoReleaser to build and publish releases. Each release published to GitHub
contains binary files for Linux, macOS (darwin), and Windows, as configured within the .goreleaser.yml
file.
Each release also contains a terraform-provider-keycloak_${RELEASE_VERSION}_SHA256SUMS file that can be used to check integrity.
You can find the list of releases here.
You can find the changelog for each version here.
Note: Prior to v2.0.0, a statically linked build for use within Alpine linux was included with each release. This is no longer
done due to GoReleaser not supporting CGO. Instead of using a statically linked,
build you can use the linux_amd64 build as long as libc6-compat is installed.
Development
This project requires Go 1.26 and Terraform 1.15.0.
This project uses Go Modules for dependency management, which allows this project to exist outside an existing GOPATH.
After cloning the repository, you can build the project by running make build.
Debugging
We support remote debugging via delve via the make target build-debug and run-debug.
To debug the plugin, proceed as follows:
Run make build-debug
Run make run-debug
Attach a remote debugger to the printed local address, e.g. 127.0.0.1:58772 from your IDE.
Copy the TF_REATTACH_PROVIDERS='{...}' env variable, that is printed by the delve debugger after attachment.
In a separate terminal prepend the TF_REATTACH_PROVIDERS='{...}' env variable to your terraform ... command
Note that we use the delve options to wait for a debugger. This allows us to debug the complete
plugin lifecycle.
Note for Goland users, there is a preconfigured remote debugger configuration called local debug.
Debugging Example
The easiest way to play with the remote debugger setup is the bundled example project.
To use that run make build-example-debug and follow the steps above.
Local Environment
You can spin up a local developer environment via Docker Compose by running make local.
This will spin up a few containers for Keycloak, PostgreSQL, and OpenLDAP, which can be used for testing the provider.
This environment and its setup via make local is not intended for production use.
You can also use make local-mtls to start Keycloak with required client authentication via mTLS certificate.
To stop the environment you can use the make local-stop. To remove the local environment use make local-down.
Note: The setup scripts require the jq command line utility.
Tests
Every resource supported by this provider will have a reasonable amount of acceptance test coverage.
You can run acceptance tests against a Keycloak instance by running make testacc. You will need to supply some environment
variables in order to set up the provider during tests. Here is an example for running tests against a local environment
that was created via make local:
You can also run the same tests on Keycloak's https port with the Keycloak Terraform provider authenticating to the server with a mTLS client certificate.
For this start the env with make local-mtls. After that run the following command:
You can also run the same test with a provided access token.
For this start the env with make local. To obtain an access token for the admin user via the admin-cli client, run make access-token to
store an acess token in the ./keycloak_access_token file.
After that run the following command:
make access-token
KEYCLOAK_CLIENT_ID=terraform \
KEYCLOAK_CLIENT_TIMEOUT=5 \
KEYCLOAK_ACCESS_TOKEN="$(cat keycloak_access_token)" \
KEYCLOAK_REALM=master \
KEYCLOAK_URL="http://localhost:8080" \
make testauth
Resources that live in a realm
A realm can be renamed (see Renaming a realm), and its internal id stays the same.
Every resource and data source with a required realm_id (or realm) argument automatically gets a realm_internal_id argument
as well. provider/realm_reference.go adds it to the whole provider, so a new resource needs no code for it. The provider
resolves realm_internal_id to the current realm name before it calls your create, read, update or delete function. To keep
renames working in a new resource:
Use data.Get("realm_id") (or realm) to get the realm in create, read, update and delete. It always holds the current
realm name. Do not take the realm from data.Id(), and do not split it out of a composite id: such an id keeps the name the
realm had when the resource was created. Parsing the id in an import function is fine.
If the id of the resource is the realm name (as for keycloak_realm_events), register the resource in
resourceRealmIDFormats in provider/realm_reference.go with realmNameID, so that its id follows a rename.
If the id contains the realm name as its first part (<realm>/<something>), register the resource in
resourceRealmIDFormats with realmPrefixedID, take the realm from realm_id and only the other parts from the id.
The id is then updated after a rename.
A resource that is not registered there is treated as opaqueID: its id is never rewritten, so a realm name in it
would keep the old name after a rename.
Add the resource to TestAccKeycloakRealm_renameWithMixedChildren in
provider/resource_keycloak_realm_rename_test.go, using realm_internal_id, and check that it is not replaced by a rename.
TestRealmInternalIdIsOnEveryRealmScopedResource fails for a resource without a realm argument. If the resource is not
scoped to a realm, add it to that test's exceptions.
Run examples
You can run examples against a Keycloak instance.
Follow the commands for running examples against a local environment that was created via make local:
make build-example
cd example
terraform init
terraform plan -out tfplan
terraform apply tfplan
rm tfplan
Acknowledgments
The Keycloak Terraform Provider was originally created by Michael Parker. Many thanks for the hard work and dedication in building the foundation for this project.
Also, many thanks to all the contributors extending it and approving the license change to maintain it as part of the Keycloak project.
License
This software is licensed under Apache License, Version 2.0, (LICENSE-APACHE-2.0 or https://www.apache.org/licenses/LICENSE-2.0)
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this software by you shall be licensed under the Apache License, Version 2.0, without any additional terms or conditions.
Đọc thêm về keycloak/terraform-provider-keycloak ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/keycloak/terraform-provider-keycloak là nguồn chính thức.
keycloak/terraform-provider-keycloak có bao nhiêu sao?
keycloak/terraform-provider-keycloak có 960 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/keycloak/terraform-provider-keycloak. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
keycloak/terraform-provider-keycloak có phải mã nguồn mở không?
Có — keycloak/terraform-provider-keycloak phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/keycloak/terraform-provider-keycloak.
keycloak/terraform-provider-keycloak còn đang phát triển không?
Commit gần nhất trên keycloak/terraform-provider-keycloak là 4 ngày trước (theo timestamp GitHub). Repo có 462 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
keycloak/terraform-provider-keycloak là gì?
keycloak/terraform-provider-keycloak (keycloak/terraform-provider-keycloak) là dự án Go trên GitHub. Theo mô tả gốc: Terraform provider for Keycloak
keycloak/terraform-provider-keycloak so với các dự án Developer Tools khác thế nào?
keycloak/terraform-provider-keycloak được TopGit xếp vào nhóm Developer Tools, với 960 sao GitHub và viết bằng Go. Xem trang chủ đề Developer Tools trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc terraform-provider-keycloak có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về terraform-provider-keycloak.