### zitadel_action_target_public_key Resource Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/action_target_public_key.md Example of how to define a zitadel_action_target_public_key resource. It requires the target ID and the public key content, which can be read from a file. ```terraform resource "zitadel_action_target_public_key" "default" { target_id = zitadel_action_target.default.id public_key = file("path/to/public_key.pem") } ``` -------------------------------- ### zitadel_application_key Resource Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/application_key.md Example of how to declare an application key resource in Terraform. ```APIDOC ## zitadel_application_key Resource Resource representing a app key ### Example Usage ```terraform resource "zitadel_application_key" "default" { org_id = data.zitadel_org.default.id project_id = data.zitadel_project.default.id app_id = data.zitadel_application_api.default.id key_type = "KEY_TYPE_JSON" expiration_date = "2519-04-01T08:45:00Z" } ``` ### Schema #### Required - `app_id` (String) ID of the application - `expiration_date` (String) Expiration date of the app key in the RFC3339 format - `key_type` (String) Type of the app key, supported values: KEY_TYPE_UNSPECIFIED, KEY_TYPE_JSON - `project_id` (String) ID of the project #### Optional - `org_id` (String) ID of the organization. If not provided, the organization of the authenticated user/service account is used. #### Read-Only - `id` (String) The ID of this resource. - `key_details` (String, Sensitive) Value of the app key ### Import ```bash # The resource can be imported using the ID format ``. # You can use __SEMICOLON__ to escape :, e.g. terraform import zitadel_application_key.imported "123456789012345678:123456789012345678:123456789012345678:123456789012345678:$(cat ~/Downloads/123456789012345678.json | sed -e 's/:/__SEMICOLON__/g')" ``` ``` -------------------------------- ### zitadel_application_v2 Resource Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/application_v2.md This example demonstrates how to configure a web-based OIDC application (v2) within a Zitadel project. Ensure the `zitadel_project` and `zitadel_org` data sources are properly configured. ```terraform resource "zitadel_application_v2" "default" { project_id = data.zitadel_project.default.id org_id = data.zitadel_org.default.id name = "applicationv2" oidc { redirect_uris = ["https://localhost.com"] response_types = ["OIDC_RESPONSE_TYPE_CODE"] grant_types = ["OIDC_GRANT_TYPE_AUTHORIZATION_CODE"] post_logout_redirect_uris = ["https://localhost.com"] app_type = "OIDC_APP_TYPE_WEB" auth_method_type = "OIDC_AUTH_METHOD_TYPE_BASIC" version = "OIDC_VERSION_1_0" clock_skew = "0s" dev_mode = true access_token_type = "OIDC_TOKEN_TYPE_BEARER" access_token_role_assertion = false id_token_role_assertion = false id_token_userinfo_assertion = false additional_origins = [] skip_native_app_success_page = false } } ``` -------------------------------- ### Example Usage of zitadel_action_execution_response Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/action_execution_response.md This example demonstrates how to set up an action target and then configure the zitadel_action_execution_response to trigger that action on a specific gRPC method call. Ensure the zitadel_action_target resource is defined before this one. ```terraform resource "zitadel_action_target" "default" { name = "response-enricher" endpoint = "https://example.com/api/enrich" target_type = "REST_CALL" timeout = "10s" interrupt_on_error = false } resource "zitadel_action_execution_response" "default" { method = "/zitadel.user.v2.UserService/GetUser" target_ids = [zitadel_action_target.default.id] } ``` -------------------------------- ### Example Usage of zitadel_applications_v2 and zitadel_application_v2 Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/applications_v2.md This example demonstrates how to use the zitadel_applications_v2 data source to retrieve a list of application IDs within a project and then iterate over these IDs to fetch individual application details using the zitadel_application_v2 data source. Finally, it outputs the names of the applications. ```terraform data "zitadel_applications_v2" "default" { org_id = data.zitadel_org.default.id project_id = data.zitadel_project.default.id name = "example-name" } data "zitadel_application_v2" "default" { for_each = toset(data.zitadel_applications_v2.default.app_ids) project_id = data.zitadel_project.default.id app_id = each.value } output "application_v2_names" { value = toset([ for app in data.zitadel_application_v2.default : app.name ]) } ``` -------------------------------- ### zitadel_action Data Source Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/action.md Example usage of the zitadel_action data source to fetch details of an action. ```APIDOC ## zitadel_action (Data Source) ### Description Datasource representing an action belonging to an organization. ### Schema #### Required - `action_id` (String) The ID of this resource. #### Optional - `org_id` (String) ID of the organization. If not provided, the organization of the authenticated user/service account is used. ### Read-Only - `allowed_to_fail` (Boolean) when true, the next action will be called even if this action fails - `id` (String) The ID of this resource. - `name` (String) - `script` (String) - `state` (Number) the state of the action - `timeout` (String) after which time the action will be terminated if not finished ### Example Usage ```terraform data "zitadel_action" "default" { org_id = data.zitadel_org.default.id action_id = "123456789012345678" } output "action" { value = data.zitadel_action.default } ``` ``` -------------------------------- ### Example Usage of zitadel_machine_users Data Source Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/machine_users.md This example shows how to use the zitadel_machine_users data source to find machine users by username and then iterate over the found user IDs to retrieve individual user details using the zitadel_machine_user data source. Finally, it outputs the names of these users. ```terraform data "zitadel_machine_users" "default" { org_id = data.zitadel_org.default.id user_name = "example-name" user_name_method = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE" } data "zitadel_machine_user" "default" { for_each = toset(data.zitadel_machine_users.default.user_ids) id = each.value } output "user_names" { value = toset([ for user in data.zitadel_machine_user.default : user.name ]) } ``` -------------------------------- ### zitadel_instance Data Source Usage Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/instance.md Example of how to use the zitadel_instance data source to fetch instance details. ```APIDOC ## zitadel_instance Data Source Datasource representing the ZITADEL instance. ### Description This data source allows you to retrieve information about a ZITADEL instance, including its ID, name, state, version, custom domains, and trusted domains. ### Example Usage ```terraform data "zitadel_instance" "default" { instance_id = "123456789012345678" } output "instance" { value = data.zitadel_instance.default } ``` ### Schema #### Required - `instance_id` (String) ID of the instance. #### Read-Only - `custom_domains` (List of Object) Custom domains configured for this instance. (see [below for nested schema](#nestedatt--custom_domains)) - `id` (String) The ID of this resource. - `name` (String) Name of the instance. - `state` (String) Current state of the instance. - `trusted_domains` (List of String) Trusted domains configured for this instance. - `version` (String) Version of the ZITADEL system the instance is running on. ### Nested Schema for `custom_domains` Read-Only: - `domain` (String) - `generated` (Boolean) - `primary` (Boolean) ``` -------------------------------- ### Example Usage of zitadel Data Source Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/zitadel.md This example shows how to use the zitadel data source to retrieve the session token and output it. The token is marked as sensitive. ```terraform data "zitadel" "default" { // } output "token" { value = data.zitadel.default.token sensitive = true } ``` -------------------------------- ### zitadel_default_init_message_text Resource Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/default_init_message_text.md This example demonstrates how to configure the zitadel_default_init_message_text resource to set default text for account initialization emails at the instance level. It specifies the language and various text components of the email. ```terraform resource "zitadel_default_init_message_text" "default" { language = "en" title = "title example" pre_header = "pre_header example" subject = "subject example" greeting = "greeting example" text = "text example" button_text = "button_text example" footer_text = "footer_text example" } ``` -------------------------------- ### Example Usage of zitadel_project_roles Data Source Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/project_roles.md This example shows how to use the zitadel_project_roles data source to fetch project roles filtered by a specific role key. The output can then be used to display the retrieved roles. ```terraform data "zitadel_project_roles" "default" { org_id = data.zitadel_org.default.id project_id = data.zitadel_project.default.id role_key = "admin" } output "project_roles" { value = data.zitadel_project_roles.default } ``` -------------------------------- ### Example Usage of zitadel_action_execution_function Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/action_execution_function.md This example shows how to define a zitadel_action_target and then use its ID to configure a zitadel_action_execution_function. The function name must be one of `preuserinfo`, `preaccesstoken`, or `presamlresponse`. ```terraform resource "zitadel_action_target" "default" { name = "token-enricher" endpoint = "https://example.com/oidc/enrich" target_type = "REST_CALL" timeout = "10s" interrupt_on_error = true } resource "zitadel_action_execution_function" "default" { name = "preaccesstoken" target_ids = [zitadel_action_target.default.id] } ``` -------------------------------- ### zitadel_user_metadatas Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/user_metadatas.md Example usage of the zitadel_user_metadatas data source to retrieve all metadata for a user, and a filtered example by key. ```APIDOC ## zitadel_user_metadatas ### Description Datasource representing metadata entries of a user in ZITADEL. ### Schema #### Required - `user_id` (String) ID of the user #### Optional - `key` (String) Filter metadata by key - `org_id` (String) ID of the organization #### Read-Only - `id` (String) The ID of this resource. - `metadata` (List of Object) List of user metadata entries (see [below for nested schema](#nestedatt--metadata)) ### Nested Schema for `metadata` Read-Only: - `key` (String) - `value` (String) ### Example Usage ```terraform data "zitadel_user_metadatas" "default" { org_id = data.zitadel_org.default.id user_id = "123456789012345678" } data "zitadel_user_metadatas" "filtered" { org_id = data.zitadel_org.default.id user_id = "123456789012345678" key = "example" } output "all_metadata" { value = data.zitadel_user_metadatas.default.metadata } ``` ``` -------------------------------- ### ZITADEL Login Texts Resource Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/login_texts.md This example demonstrates how to configure custom login texts for a specific organization and language using the zitadel_login_texts resource. It includes various text fields for different stages of the login and registration process. ```terraform resource "zitadel_login_texts" "default" { org_id = data.zitadel_org.default.id language = "en" email_verification_done_text = { cancel_button_text = "example" description = "example" login_button_text = "example" next_button_text = "example" title = "example" } email_verification_text = { code_label = "example" description = "example" next_button_text = "example" resend_button_text = "example" title = "example" } external_registration_user_overview_text = { back_button_text = "example" description = "example" email_label = "example" firstname_label = "example" language_label = "example" lastname_label = "example" next_button_text = "example" nickname_label = "example" phone_label = "example" privacy_link_text = "example" title = "example" tos_and_privacy_label = "example" tos_confirm = "example" tos_confirm_and = "example" tos_link_text = "example" username_label = "example" } external_user_not_found_text = { auto_register_button_text = "example" description = "example" link_button_text = "example" privacy_link_text = "example" title = "example" tos_and_privacy_label = "example" tos_confirm = "example" tos_confirm_and = "example" tos_link_text = "example" } footer_text = { help = "example" privacy_policy = "example" tos = "example" } init_mfa_done_text = { cancel_button_text = "example" description = "example" next_button_text = "example" title = "example" } init_mfa_otp_text = { cancel_button_text = "example" code_label = "example" description = "example" description_otp = "example" next_button_text = "example" secret_label = "example" title = "example" } init_mfa_prompt_text = { description = "example" next_button_text = "example" otp_option = "example" skip_button_text = "example" title = "example" u2f_option = "example" } init_mfa_u2f_text = { description = "example" error_retry = "example" not_supported = "example" register_token_button_text = "example" title = "example" token_name_label = "example" } init_password_done_text = { cancel_button_text = "example" description = "example" next_button_text = "example" title = "example" } init_password_text = { code_label = "example" description = "example" new_password_confirm_label = "example" new_password_label = "example" next_button_text = "example" resend_button_text = "example" title = "example" } initialize_done_text = { cancel_button_text = "example" description = "example" next_button_text = "example" title = "example" } initialize_user_text = { code_label = "example" description = "example" new_password_confirm_label = "example" new_password_label = "example" next_button_text = "example" resend_button_text = "example" title = "example" } linking_user_done_text = { cancel_button_text = "example" description = "example" next_button_text = "example" title = "example" } login_text = { description = "example" description_linking_process = "example" external_user_description = "example" login_name_label = "example" login_name_placeholder = "example" next_button_text = "example" ``` -------------------------------- ### Basic SMTP Configuration Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/smtp_config.md This example shows how to configure a basic SMTP server connection. Note that this resource is deprecated. ```terraform resource "zitadel_smtp_config" "default" { sender_address = "sender@example.com" sender_name = "no-reply" tls = true host = "localhost:25" user = "user" password = "secret_password" reply_to_address = "replyto@example.com" } ``` -------------------------------- ### Generating Documentation Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/CONTRIBUTING.md Generate the provider's documentation by running the tfplugindocs tool. Ensure manual maintenance of template and example files beforehand. ```bash go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@v0.14.1 generate ``` -------------------------------- ### Example Usage of zitadel_instance_features Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/instance_features.md Configure instance-wide feature flags, including login settings, OIDC features, performance improvements, and user schema. ```terraform resource "zitadel_instance_features" "default" { login_default_org = true oidc_token_exchange = true user_schema = false improved_performance = [ "IMPROVED_PERFORMANCE_PROJECT_GRANT", "IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED" ] debug_oidc_parent_error = false oidc_single_v1_session_termination = true enable_back_channel_logout = true login_v2 { required = true base_uri = "https://login.example.com" } permission_check_v2 = true console_use_v2_user_api = true } ``` -------------------------------- ### zitadel_application_saml Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/application_saml.md Example usage of the zitadel_application_saml data source to fetch SAML application details. ```APIDOC ## zitadel_application_saml (Data Source) Datasource representing a SAML application belonging to a project, with all configuration possibilities. ### Example Usage ```terraform data "zitadel_application_saml" "default" { org_id = data.zitadel_org.default.id project_id = data.zitadel_project.default.id app_id = "123456789012345678" } ``` ## Schema ### Required - `app_id` (String) The ID of this resource. - `project_id` (String) ID of the project ### Optional - `org_id` (String) ID of the organization ### Read-Only - `id` (String) The ID of this resource. - `login_version` (List of Object) Specify the preferred login UI, where the user is redirected to for authentication. If unset, the login UI is chosen by the instance default. (see [below for nested schema](#nestedatt--login_version)) - `metadata_xml` (String) Metadata as XML file - `name` (String) Name of the application ### Nested Schema for `login_version` Read-Only: - `login_v1` (Boolean) - `login_v2` (List of Object) (see [below for nested schema](#nestedobjatt--login_version--login_v2)) ### Nested Schema for `login_version.login_v2` Read-Only: - `base_uri` (String) ``` -------------------------------- ### zitadel_org_idp_saml Data Source Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/org_idp_saml.md Example usage of the zitadel_org_idp_saml data source to retrieve SAML IdP configuration. ```APIDOC ## zitadel_org_idp_saml (Data Source) ### Description Datasource representing a SAML IdP of the organization. ### Schema #### Required - `id` (String) The ID of this resource. #### Optional - `org_id` (String) ID of the organization ### Read-Only - `auto_linking` (String) Enable if users should get prompted to link an existing ZITADEL user to an external account if the selected attribute matches, supported values: AUTO_LINKING_OPTION_UNSPECIFIED, AUTO_LINKING_OPTION_USERNAME, AUTO_LINKING_OPTION_EMAIL - `binding` (String) The binding - `federated_logout_enabled` (Boolean) If enabled, ZITADEL will send a logout request to the identity provider when the user terminates the session in ZITADEL. - `is_auto_creation` (Boolean) enabled if a new account in ZITADEL are created automatically on login with an external account - `is_auto_update` (Boolean) enabled if a the ZITADEL account fields are updated automatically on each login - `is_creation_allowed` (Boolean) enabled if users are able to create a new account in ZITADEL when using an external account - `is_linking_allowed` (Boolean) enabled if users are able to link an existing ZITADEL user with an external account - `metadata_xml` (String) The metadata XML as plain string - `name` (String) Name of the IDP - `name_id_format` (String) The nameid-format requested - `signature_algorithm` (String) Signature Algorithm used to sign SAML requests and responses. - `transient_mapping_attribute_name` (String) Name of the attribute used to map the user in case the nameid-format is `urn:oasis:names:tc:SAML:2.0:nameid-format:transient`. - `with_signed_request` (Boolean) Whether the SAML IDP requires signed requests ### Example Usage ```terraform data "zitadel_org_idp_saml" "default" { org_id = data.zitadel_org.default.id id = "123456789012345678" } ``` ``` -------------------------------- ### Create a zitadel_domain resource Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/domain.md Example of how to create a zitadel_domain resource. Ensure the org_id and name are correctly specified. This resource is deprecated. ```terraform resource "zitadel_domain" "default" { org_id = data.zitadel_org.default.id name = "zitadel.default.127.0.0.1.sslip.io" is_primary = false } ``` -------------------------------- ### zitadel_action_target_public_key Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/action_target_public_key.md Example usage of the zitadel_action_target_public_key data source to retrieve public key details for an action target. ```APIDOC ## zitadel_action_target_public_key (Data Source) Datasource representing a public key for an action target. ### Description Datasource representing a public key for an action target. ### Parameters #### Required - **key_id** (String) - The ID of the public key. - **target_id** (String) - The ID of the action target. #### Read-Only - **active** (Boolean) - Whether the public key is active and used for payload encryption. - **creation_date** (String) - The date the public key was added. - **expiration_date** (String) - The expiration date of the public key in RFC3339 format. - **fingerprint** (String) - The fingerprint of the public key. - **id** (String) - The ID of this resource. - **public_key** (String) - The public key in PEM format (RSA or EC). ### Example Usage ```terraform data "zitadel_action_target_public_key" "default" { target_id = "123456789012345678" key_id = "123456789012345678" } ``` ``` -------------------------------- ### Create a Machine User Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/machine_user.md Example of how to create a machine user (service account) within an organization. Set `with_secret` to `false` if a secret is not required. ```terraform resource "zitadel_machine_user" "default" { org_id = data.zitadel_org.default.id user_name = "machine@example.com" name = "name" description = "a machine user" with_secret = false } ``` -------------------------------- ### Basic zitadel_organization_metadata Resource Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/organization_metadata.md Example of how to define a basic key-value metadata entry for an organization. Ensure the organization resource is defined and its ID is referenced. ```terraform resource "zitadel_organization_metadata" "default" { organization_id = zitadel_organization.default.id key = "example_key" value = "example_value" } ``` -------------------------------- ### Get zitadel_idp_oauth Data Source Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/idp_oauth.md Example of how to retrieve a generic OAuth2 IDP configuration using its ID. ```terraform data "zitadel_idp_oauth" "default" { id = "123456789012345678" } ``` -------------------------------- ### Setting up ZITADEL for Acceptance Tests Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/CONTRIBUTING.md Before running acceptance tests, set your user ID and start a local ZITADEL instance using Docker Compose. ```bash # To have the machine key written with the correct ownership, set your current users ID. export ZITADEL_DEV_UID="$(id -u)" # Setup ZITADEL docker compose --file ./acceptance/docker-compose.yaml run setup ``` -------------------------------- ### Get System Features Configuration Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/system_features.md Use this data source to retrieve the current system feature flags configuration. No additional setup is required. ```terraform data "zitadel_system_features" "default" {} ``` -------------------------------- ### Get Instance Restrictions Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/instance_restrictions.md Use this data source to fetch the current instance restrictions. No setup is required beyond the standard Terraform configuration. ```terraform data "zitadel_instance_restrictions" "default" {} ``` -------------------------------- ### zitadel_trigger_actions Resource Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/trigger_actions.md Resource representing triggers, when actions get started. This resource allows you to configure triggers for actions within ZITADEL. You can specify which flow type and trigger type should initiate specific actions, and associate them with an organization. ```APIDOC ## zitadel_trigger_actions (Resource) Resource representing triggers, when actions get started ### Description This resource allows you to configure triggers for actions within ZITADEL. You can specify which flow type and trigger type should initiate specific actions, and associate them with an organization. ### Schema #### Required - `action_ids` (Set of String) IDs of the triggered actions - `flow_type` (String) Type of the flow to which the action triggers belong, supported values: FLOW_TYPE_EXTERNAL_AUTHENTICATION, FLOW_TYPE_CUSTOMISE_TOKEN, FLOW_TYPE_INTERNAL_AUTHENTICATION, FLOW_TYPE_SAML_RESPONSE - `trigger_type` (String) Trigger type on when the actions get triggered, supported values: TRIGGER_TYPE_POST_AUTHENTICATION, TRIGGER_TYPE_PRE_CREATION, TRIGGER_TYPE_POST_CREATION, TRIGGER_TYPE_PRE_USERINFO_CREATION, TRIGGER_TYPE_PRE_ACCESS_TOKEN_CREATION, TRIGGER_TYPE_PRE_SAML_RESPONSE_CREATION #### Optional - `org_id` (String) ID of the organization. If not provided, the organization of the authenticated user/service account is used. #### Read-Only - `id` (String) The ID of this resource. ### Import ```bash # The resource can be imported using the ID format , # e.g. terraform import zitadel_trigger_actions.imported 'FLOW_TYPE_EXTERNAL_AUTHENTICATION:TRIGGER_TYPE_POST_CREATION:123456789012345678' ``` ``` -------------------------------- ### Example Usage of zitadel_instance_trusted_domains Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/instance_trusted_domains.md Demonstrates how to fetch the list of trusted domains from a ZITADEL instance and output them. The instance_id is optional and will use the current context if not specified. ```terraform data "zitadel_instance_trusted_domains" "default" { # instance_id is optional - uses current context if not provided } output "trusted_domains" { value = data.zitadel_instance_trusted_domains.default.domains } ``` -------------------------------- ### zitadel_default_privacy_policy Resource Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/default_privacy_policy.md Example usage of the zitadel_default_privacy_policy resource to configure the default privacy policy. ```APIDOC ## zitadel_default_privacy_policy ### Description Resource representing the default privacy policy. ### Schema #### Optional - `custom_link` (String) Link to an external resource that will be available to users in the console. - `custom_link_text` (String) The button text that would be shown in console pointing to custom link. - `docs_link` (String) Link to documentation to be shown in the console. - `help_link` (String) Link to the Help/Manual page. - `privacy_link` (String) Link to the Privacy Policy. - `support_email` (String) Help / support email address. - `tos_link` (String) Link to the Terms of Service. #### Read-Only - `id` (String) The ID of this resource. ### Import ```bash # The resource can be imported using the ID format <> terraform import zitadel_default_privacy_policy.imported '' ``` ``` -------------------------------- ### Example Usage of zitadel_active_webkey Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/active_webkey.md This snippet shows how to create both RSA and ECDSA web keys and then activate one of them using the zitadel_active_webkey resource. Ensure the org_id is correctly set and the key_id refers to an existing webkey. ```terraform resource "zitadel_webkey" "key_v1" { org_id = data.zitadel_org.default.id rsa {} } resource "zitadel_webkey" "key_v2" { org_id = data.zitadel_org.default.id ecdsa {} } resource "zitadel_active_webkey" "default" { org_id = data.zitadel_org.default.id key_id = zitadel_webkey.key_v1.id } ``` -------------------------------- ### zitadel_verify_email_otp_message_text Resource Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/verify_email_otp_message_text.md Example of how to configure the zitadel_verify_email_otp_message_text resource to customize OTP verification emails for a specific organization and language. ```terraform resource "zitadel_verify_email_otp_message_text" "default" { org_id = data.zitadel_org.default.id language = "en" title = "title example" pre_header = "pre_header example" subject = "subject example" greeting = "greeting example" text = "text example" button_text = "button_text example" footer_text = "footer_text example" } ``` -------------------------------- ### Create a Human User Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/human_user.md Example of how to create a human user with various details including email, name, contact information, and initial password settings. ```terraform resource "zitadel_human_user" "default" { org_id = data.zitadel_org.default.id user_name = "humanfull@localhost.com" first_name = "firstname" last_name = "lastname" nick_name = "nickname" display_name = "displayname" preferred_language = "de" gender = "GENDER_MALE" phone = "+41799999999" is_phone_verified = true email = "test@zitadel.com" is_email_verified = true initial_password = "Password1!" initial_skip_password_change = true } ``` -------------------------------- ### zitadel_verify_sms_otp_message_text Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/verify_sms_otp_message_text.md This example shows how to configure the `zitadel_verify_sms_otp_message_text` resource to customize the SMS verification message for a specific organization and language. ```terraform resource "zitadel_verify_sms_otp_message_text" "default" { org_id = data.zitadel_org.default.id language = "en" text = "text example" } ``` -------------------------------- ### Import a zitadel_webkey Resource Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/webkey.md Import an existing web key resource using its ID and optionally the organization ID. The format is ``. ```bash # The resource can be imported using the ID format , # e.g. terraform import zitadel_webkey.imported '123456789012345678:123456789012345678' ``` -------------------------------- ### Passwordless Registration Message Text Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/passwordless_registration_message_text.md Example of how to configure the passwordless registration message text for a specific organization and language. ```terraform resource "zitadel_passwordless_registration_message_text" "default" { org_id = data.zitadel_org.default.id language = "en" title = "title example" pre_header = "pre_header example" subject = "subject example" greeting = "greeting example" text = "text example" button_text = "button_text example" footer_text = "footer_text example" } ``` -------------------------------- ### zitadel_domain_claimed_message_text Resource Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/domain_claimed_message_text.md Example of how to configure the zitadel_domain_claimed_message_text resource to customize the notification email sent when a domain is claimed within an organization. ```terraform resource "zitadel_domain_claimed_message_text" "default" { org_id = data.zitadel_org.default.id language = "en" title = "title example" pre_header = "pre_header example" subject = "subject example" greeting = "greeting example" text = "text example" button_text = "button_text example" footer_text = "footer_text example" } ``` -------------------------------- ### zitadel_default_verify_phone_message_text Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/default_verify_phone_message_text.md This example shows how to configure the instance-level default template for phone number verification SMS messages using the zitadel_default_verify_phone_message_text resource. ```terraform resource "zitadel_default_verify_phone_message_text" "default" { language = "en" text = "text example" } ``` -------------------------------- ### Importing zitadel_instance_features Resource Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/instance_features.md Import an existing instance feature configuration using the constant ID 'instance'. ```bash # The resource can be imported using the constant ID "instance" terraform import zitadel_instance_features.imported 'instance' ``` -------------------------------- ### Example Usage of zitadel_action_target_public_key Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/action_target_public_key.md Use the `zitadel_action_target_public_key` data source to retrieve details of a public key associated with an action target. Provide the `target_id` and `key_id` to fetch the specific public key information. ```terraform data "zitadel_action_target_public_key" "default" { target_id = "123456789012345678" key_id = "123456789012345678" } ``` -------------------------------- ### zitadel_trigger_actions Data Source Example Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/trigger_actions.md Example usage of the zitadel_trigger_actions data source to fetch trigger actions for a specific flow and trigger type within an organization. ```APIDOC ## zitadel_trigger_actions Data Source Resource representing triggers, when actions get started ### Description This data source allows you to retrieve information about trigger actions within an organization. You can filter triggers by flow type and trigger type. ### Schema #### Required - `flow_type` (String) Type of the flow to which the action triggers belong - `trigger_type` (String) Trigger type on when the actions get triggered #### Optional - `org_id` (String) ID of the organization. If not provided, the organization of the authenticated user/service account is used. #### Read-Only - `action_ids` (Set of String) IDs of the triggered actions - `id` (String) The ID of this resource. ### Example Usage ```terraform data "zitadel_trigger_actions" "default" { org_id = data.zitadel_org.default.id flow_type = "FLOW_TYPE_EXTERNAL_AUTHENTICATION" trigger_type = "TRIGGER_TYPE_POST_AUTHENTICATION" } output "trigger_actions" { value = data.zitadel_trigger_actions.default } ``` ``` -------------------------------- ### Example Usage of zitadel_idp_github_es Data Source Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/idp_github_es.md Use this data source to retrieve the configuration of an existing GitHub Enterprise IDP. You need to provide the ID of the IDP. ```terraform data "zitadel_idp_github_es" "default" { id = "123456789012345678" } ``` -------------------------------- ### Importing zitadel_action_target_public_key Resource Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/action_target_public_key.md Demonstrates how to import an existing zitadel_action_target_public_key resource into your Terraform state. The import format requires the key ID and the target ID, separated by a colon. ```bash # The resource can be imported using the ID format :, e.g. terraform import zitadel_action_target_public_key.imported '123456789012345678:123456789012345678' ``` -------------------------------- ### Example Usage of zitadel_org_idp_azure_ad Data Source Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/org_idp_azure_ad.md Use this data source to retrieve the configuration of an existing Azure AD IdP for a given organization. Ensure that the `org_id` and `id` are correctly specified. ```terraform data "zitadel_org_idp_azure_ad" "default" { org_id = data.zitadel_org.default.id id = "123456789012345678" } ``` -------------------------------- ### Running Acceptance Tests Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/CONTRIBUTING.md Execute the acceptance tests for the ZITADEL Terraform provider using the generated machine key. ```bash TF_ACC=1 go test ./... ``` -------------------------------- ### zitadel_organization_metadata Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/organization_metadata.md Example usage of the zitadel_organization_metadata data source to retrieve a metadata value. ```APIDOC ## zitadel_organization_metadata (Data Source) Datasource representing a metadata entry of an organization in ZITADEL. ### Description Datasource representing a metadata entry of an organization in ZITADEL. ### Schema #### Required - `key` (String) Key of the metadata entry - `organization_id` (String) ID of the organization #### Read-Only - `id` (String) The ID of this resource. - `value` (String) Value of the metadata entry ### Example Usage ```terraform data "zitadel_organization_metadata" "default" { organization_id = "123456789012345678" key = "example_key" } output "metadata_value" { value = data.zitadel_organization_metadata.default.value } ``` ``` -------------------------------- ### Importing zitadel_action_execution_request Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/action_execution_request.md Provides import commands for different scenarios: specific method, service, or all requests. Ensure the correct identifier format is used for successful import. ```bash # method:/path for specific method, service:name for service, all for all requests terraform import zitadel_action_execution_request.imported 'method:/zitadel.session.v2.SessionService/ListSessions' terraform import zitadel_action_execution_request.imported 'service:zitadel.session.v2.SessionService' terraform import zitadel_action_execution_request.imported 'all' ``` -------------------------------- ### zitadel Data Source Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/zitadel.md Example usage of the zitadel data source to retrieve the session token. ```APIDOC ## zitadel Data Source ### Description This data source retrieves the session token for the Zitadel provider configuration. ### Usage ```terraform data "zitadel" "default" { // Configuration options if any } output "token" { value = data.zitadel.default.token sensitive = true } ``` ### Schema #### Read-Only Attributes - `id` (String): The ID of this resource. - `token` (String, Sensitive): The session token. ``` -------------------------------- ### Example Usage of zitadel_idp_gitlab_self_hosted Data Source Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/idp_gitlab_self_hosted.md Use this data source to retrieve information about an existing GitLab Self Hosted IDP on your instance. You must provide the ID of the IDP. ```terraform data "zitadel_idp_gitlab_self_hosted" "default" { id = "123456789012345678" } ``` -------------------------------- ### zitadel_user_metadata Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/user_metadata.md Example usage of the zitadel_user_metadata data source to retrieve a user's metadata value. ```APIDOC ## zitadel_user_metadata (Data Source) ### Description Datasource representing a metadata entry of a user in ZITADEL. ### Schema #### Required - `key` (String) Key of the metadata entry - `user_id` (String) ID of the user #### Optional - `org_id` (String) ID of the organization #### Read-Only - `id` (String) The ID of this resource. - `value` (String) Value of the metadata entry ### Example Usage ```terraform data "zitadel_user_metadata" "default" { org_id = data.zitadel_org.default.id user_id = "123456789012345678" key = "example_key" } output "metadata_value" { value = data.zitadel_user_metadata.default.value } ``` ``` -------------------------------- ### Example Usage of zitadel_instance Data Source Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/instance.md Use this data source to fetch details about a ZITADEL instance by its ID. The output can then be used for further configuration or inspection. ```terraform data "zitadel_instance" "default" { instance_id = "123456789012345678" } output "instance" { value = data.zitadel_instance.default } ``` -------------------------------- ### zitadel_organization_domains Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/organization_domains.md Example usage of the zitadel_organization_domains data source to retrieve all domains for an organization or filter them by name. ```APIDOC ## zitadel_organization_domains ### Description Datasource representing domains of an organization in ZITADEL. ### Schema #### Required - `organization_id` (String) ID of the organization #### Optional - `domain` (String) Filter domains by name ### Read-Only - `domains` (List of Object) List of organization domains (see [below for nested schema](#nestedatt--domains)) - `id` (String) The ID of this resource. ### Nested Schema for `domains` Read-Only: - `domain` (String) - `is_primary` (Boolean) - `is_verified` (Boolean) - `organization_id` (String) - `validation_type` (String) ``` -------------------------------- ### Default zitadel_verify_email_message_text Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/verify_email_message_text.md Example of how to configure the email address verification message text for a specific organization and language. ```terraform resource "zitadel_verify_email_message_text" "default" { org_id = data.zitadel_org.default.id language = "en" title = "title example" pre_header = "pre_header example" subject = "subject example" greeting = "greeting example" text = "text example" button_text = "button_text example" footer_text = "footer_text example" } ``` -------------------------------- ### Example Usage of zitadel_org_idp_apple Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/org_idp_apple.md Configure an Apple Identity Provider for an organization. Ensure you have your Apple Developer Account details like client ID, team ID, key ID, and private key ready. This snippet shows how to enable automatic user creation and updates. ```terraform resource "zitadel_org_idp_apple" "default" { org_id = data.zitadel_org.default.id name = "Apple" client_id = "com.example.app" team_id = "ABCDE12345" key_id = "FGHIJ67890" private_key = "*****abc123" scopes = ["name", "email"] is_linking_allowed = false is_creation_allowed = true is_auto_creation = false is_auto_update = true auto_linking = "AUTO_LINKING_OPTION_USERNAME" } ``` -------------------------------- ### zitadel_org_idp_jwt Data Source Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/data-sources/org_idp_jwt.md Example usage of the zitadel_org_idp_jwt data source to retrieve JWT IdP configuration. ```APIDOC ## zitadel_org_idp_jwt (Data Source) ### Description Datasource representing a generic JWT IdP on the organization. ### Schema #### Required - `idp_id` (String) The ID of this resource. - `org_id` (String) ID of the organization #### Read-Only - `auto_register` (Boolean) auto register for users from this idp - `header_name` (String) the name of the header where the JWT is sent in, default is authorization - `id` (String) The ID of this resource. - `issuer` (String) the issuer of the jwt (for validation) - `jwt_endpoint` (String) the endpoint where the jwt can be extracted - `keys_endpoint` (String) the endpoint to the key (JWK) which are used to sign the JWT with - `name` (String) Name of the IDP - `styling_type` (String) Some identity providers specify the styling of the button to their login ### Example Usage ```terraform data "zitadel_org_idp_jwt" "default" { org_id = data.zitadel_org.default.id id = "123456789012345678" } output "org_idp_jwt" { value = data.zitadel_org_idp_jwt.default } ``` ``` -------------------------------- ### Importing the Default Login Policy Source: https://github.com/zitadel/terraform-provider-zitadel/blob/main/docs/resources/default_login_policy.md This example shows how to import an existing default login policy resource into your Terraform state. Ensure the ID format is correct for your ZITADEL instance. ```bash # The resource can be imported using the ID format <>, e.g. terraform import zitadel_default_login_policy.imported '' ```