com.pulumi.vault.ldap.SecretBackendStaticRole Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vault Show documentation
Show all versions of vault Show documentation
A Pulumi package for creating and managing HashiCorp Vault 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.vault.ldap;
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.vault.Utilities;
import com.pulumi.vault.ldap.SecretBackendStaticRoleArgs;
import com.pulumi.vault.ldap.inputs.SecretBackendStaticRoleState;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.ldap.SecretBackend;
* import com.pulumi.vault.ldap.SecretBackendArgs;
* import com.pulumi.vault.ldap.SecretBackendStaticRole;
* import com.pulumi.vault.ldap.SecretBackendStaticRoleArgs;
* 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 config = new SecretBackend("config", SecretBackendArgs.builder()
* .path("my-custom-ldap")
* .binddn("CN=Administrator,CN=Users,DC=corp,DC=example,DC=net")
* .bindpass("SuperSecretPassw0rd")
* .url("ldaps://localhost")
* .insecureTls("true")
* .userdn("CN=Users,DC=corp,DC=example,DC=net")
* .build());
*
* var role = new SecretBackendStaticRole("role", SecretBackendStaticRoleArgs.builder()
* .mount(config.path())
* .username("alice")
* .dn("cn=alice,ou=Users,DC=corp,DC=example,DC=net")
* .roleName("alice")
* .rotationPeriod(60)
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* LDAP secret backend static role can be imported using the full path to the role
* of the form: `<mount_path>/static-role/<role_name>` e.g.
*
* ```sh
* $ pulumi import vault:ldap/secretBackendStaticRole:SecretBackendStaticRole role ldap/static-role/example-role
* ```
*
*/
@ResourceType(type="vault:ldap/secretBackendStaticRole:SecretBackendStaticRole")
public class SecretBackendStaticRole extends com.pulumi.resources.CustomResource {
/**
* Distinguished name (DN) of the existing LDAP entry to manage
* password rotation for. If given, it will take precedence over `username` for the LDAP
* search performed during password rotation. Cannot be modified after creation.
*
*/
@Export(name="dn", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> dn;
/**
* @return Distinguished name (DN) of the existing LDAP entry to manage
* password rotation for. If given, it will take precedence over `username` for the LDAP
* search performed during password rotation. Cannot be modified after creation.
*
*/
public Output> dn() {
return Codegen.optional(this.dn);
}
/**
* The unique path this backend should be mounted at. Must
* not begin or end with a `/`. Defaults to `ldap`.
*
*/
@Export(name="mount", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> mount;
/**
* @return The unique path this backend should be mounted at. Must
* not begin or end with a `/`. Defaults to `ldap`.
*
*/
public Output> mount() {
return Codegen.optional(this.mount);
}
/**
* The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
*
*/
@Export(name="namespace", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> namespace;
/**
* @return The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
*
*/
public Output> namespace() {
return Codegen.optional(this.namespace);
}
/**
* Name of the role.
*
*/
@Export(name="roleName", refs={String.class}, tree="[0]")
private Output roleName;
/**
* @return Name of the role.
*
*/
public Output roleName() {
return this.roleName;
}
/**
* How often Vault should rotate the password of the user entry.
*
*/
@Export(name="rotationPeriod", refs={Integer.class}, tree="[0]")
private Output rotationPeriod;
/**
* @return How often Vault should rotate the password of the user entry.
*
*/
public Output rotationPeriod() {
return this.rotationPeriod;
}
/**
* Causes vault to skip the initial secret rotation on import. Not applicable to updates.
* Requires Vault 1.16 or above.
*
*/
@Export(name="skipImportRotation", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> skipImportRotation;
/**
* @return Causes vault to skip the initial secret rotation on import. Not applicable to updates.
* Requires Vault 1.16 or above.
*
*/
public Output> skipImportRotation() {
return Codegen.optional(this.skipImportRotation);
}
/**
* The username of the existing LDAP entry to manage password rotation for.
*
*/
@Export(name="username", refs={String.class}, tree="[0]")
private Output username;
/**
* @return The username of the existing LDAP entry to manage password rotation for.
*
*/
public Output username() {
return this.username;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public SecretBackendStaticRole(java.lang.String name) {
this(name, SecretBackendStaticRoleArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public SecretBackendStaticRole(java.lang.String name, SecretBackendStaticRoleArgs 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 SecretBackendStaticRole(java.lang.String name, SecretBackendStaticRoleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("vault:ldap/secretBackendStaticRole:SecretBackendStaticRole", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private SecretBackendStaticRole(java.lang.String name, Output id, @Nullable SecretBackendStaticRoleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("vault:ldap/secretBackendStaticRole:SecretBackendStaticRole", name, state, makeResourceOptions(options, id), false);
}
private static SecretBackendStaticRoleArgs makeArgs(SecretBackendStaticRoleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? SecretBackendStaticRoleArgs.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 SecretBackendStaticRole get(java.lang.String name, Output id, @Nullable SecretBackendStaticRoleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new SecretBackendStaticRole(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy