com.pulumi.keycloak.GenericProtocolMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of keycloak Show documentation
Show all versions of keycloak Show documentation
A Pulumi package for creating and managing keycloak cloud resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.keycloak;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.keycloak.GenericProtocolMapperArgs;
import com.pulumi.keycloak.Utilities;
import com.pulumi.keycloak.inputs.GenericProtocolMapperState;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Allows for creating and managing protocol mappers for both types of clients (openid-connect and saml) within Keycloak.
*
* There are two uses cases for using this resource:
* * If you implemented a custom protocol mapper, this resource can be used to configure it
* * If the provider doesn't support a particular protocol mapper, this resource can be used instead.
*
* Due to the generic nature of this mapper, it is less user-friendly and more prone to configuration errors.
* Therefore, if possible, a specific mapper should be used instead.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.keycloak.Realm;
* import com.pulumi.keycloak.RealmArgs;
* import com.pulumi.keycloak.saml.Client;
* import com.pulumi.keycloak.saml.ClientArgs;
* import com.pulumi.keycloak.GenericProtocolMapper;
* import com.pulumi.keycloak.GenericProtocolMapperArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var realm = new Realm("realm", RealmArgs.builder()
* .realm("my-realm")
* .enabled(true)
* .build());
*
* var samlClient = new Client("samlClient", ClientArgs.builder()
* .realmId(realm.id())
* .clientId("test-client")
* .build());
*
* var samlHardcodeAttributeMapper = new GenericProtocolMapper("samlHardcodeAttributeMapper", GenericProtocolMapperArgs.builder()
* .realmId(realm.id())
* .clientId(samlClient.id())
* .name("test-mapper")
* .protocol("saml")
* .protocolMapper("saml-hardcode-attribute-mapper")
* .config(Map.ofEntries(
* Map.entry("attribute.name", "name"),
* Map.entry("attribute.nameformat", "Basic"),
* Map.entry("attribute.value", "value"),
* Map.entry("friendly.name", "display name")
* ))
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Protocol mappers can be imported using the following format: `{{realm_id}}/client/{{client_keycloak_id}}/{{protocol_mapper_id}}`
*
* Example:
*
* bash
*
* ```sh
* $ pulumi import keycloak:index/genericProtocolMapper:GenericProtocolMapper saml_hardcode_attribute_mapper my-realm/client/a7202154-8793-4656-b655-1dd18c181e14/71602afa-f7d1-4788-8c49-ef8fd00af0f4
* ```
*
*/
@ResourceType(type="keycloak:index/genericProtocolMapper:GenericProtocolMapper")
public class GenericProtocolMapper extends com.pulumi.resources.CustomResource {
/**
* The ID of the client this protocol mapper should be added to. Conflicts with `client_scope_id`. This argument is required if `client_scope_id` is not set.
*
*/
@Export(name="clientId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> clientId;
/**
* @return The ID of the client this protocol mapper should be added to. Conflicts with `client_scope_id`. This argument is required if `client_scope_id` is not set.
*
*/
public Output> clientId() {
return Codegen.optional(this.clientId);
}
/**
* The ID of the client scope this protocol mapper should be added to. Conflicts with `client_id`. This argument is required if `client_id` is not set.
*
*/
@Export(name="clientScopeId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> clientScopeId;
/**
* @return The ID of the client scope this protocol mapper should be added to. Conflicts with `client_id`. This argument is required if `client_id` is not set.
*
*/
public Output> clientScopeId() {
return Codegen.optional(this.clientScopeId);
}
/**
* A map with key / value pairs for configuring the protocol mapper. The supported keys depends on the protocol mapper.
*
*/
@Export(name="config", refs={Map.class,String.class}, tree="[0,1,1]")
private Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy