com.pulumi.keycloak.Group 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.GroupArgs;
import com.pulumi.keycloak.Utilities;
import com.pulumi.keycloak.inputs.GroupState;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* ## # keycloak.Group
*
* Allows for creating and managing Groups within Keycloak.
*
* Groups provide a logical wrapping for users within Keycloak. Users within a
* group can share attributes and roles, and group membership can be mapped
* to a claim.
*
* Attributes can also be defined on Groups.
*
* Groups can also be federated from external data sources, such as LDAP or Active Directory.
* This resource **should not** be used to manage groups that were created this way.
*
* ### 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.Group;
* import com.pulumi.keycloak.GroupArgs;
* 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 parentGroup = new Group("parentGroup", GroupArgs.builder()
* .realmId(realm.id())
* .name("parent-group")
* .build());
*
* var childGroup = new Group("childGroup", GroupArgs.builder()
* .realmId(realm.id())
* .parentId(parentGroup.id())
* .name("child-group")
* .build());
*
* var childGroupWithOptionalAttributes = new Group("childGroupWithOptionalAttributes", GroupArgs.builder()
* .realmId(realm.id())
* .parentId(parentGroup.id())
* .name("child-group-with-optional-attributes")
* .attributes(Map.ofEntries(
* Map.entry("key1", "value1"),
* Map.entry("key2", "value2")
* ))
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ### Argument Reference
*
* The following arguments are supported:
*
* - `realm_id` - (Required) The realm this group exists in.
* - `parent_id` - (Optional) The ID of this group's parent. If omitted, this group will be defined at the root level.
* - `name` - (Required) The name of the group.
* - `attributes` - (Optional) A dict of key/value pairs to set as custom attributes for the group.
*
* ### Attributes Reference
*
* In addition to the arguments listed above, the following computed attributes are exported:
*
* - `path` - The complete path of the group. For example, the child group's path in the example configuration would be `/parent-group/child-group`.
*
* ### Import
*
* Groups can be imported using the format `{{realm_id}}/{{group_id}}`, where `group_id` is the unique ID that Keycloak
* assigns to the group upon creation. This value can be found in the URI when editing this group in the GUI, and is typically a GUID.
*
* Example:
*
*/
@ResourceType(type="keycloak:index/group:Group")
public class Group extends com.pulumi.resources.CustomResource {
@Export(name="attributes", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> attributes;
public Output>> attributes() {
return Codegen.optional(this.attributes);
}
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
public Output name() {
return this.name;
}
@Export(name="parentId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> parentId;
public Output> parentId() {
return Codegen.optional(this.parentId);
}
@Export(name="path", refs={String.class}, tree="[0]")
private Output path;
public Output path() {
return this.path;
}
@Export(name="realmId", refs={String.class}, tree="[0]")
private Output realmId;
public Output realmId() {
return this.realmId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Group(java.lang.String name) {
this(name, GroupArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Group(java.lang.String name, GroupArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public Group(java.lang.String name, GroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("keycloak:index/group:Group", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Group(java.lang.String name, Output id, @Nullable GroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("keycloak:index/group:Group", name, state, makeResourceOptions(options, id), false);
}
private static GroupArgs makeArgs(GroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? GroupArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static Group get(java.lang.String name, Output id, @Nullable GroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Group(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy