All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.vault.generic.Endpoint Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing HashiCorp Vault cloud resources.

There is a newer version: 6.6.0
Show newest version
// *** 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.generic;

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.generic.EndpointArgs;
import com.pulumi.vault.generic.inputs.EndpointState;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
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.AuthBackend;
 * import com.pulumi.vault.AuthBackendArgs;
 * import com.pulumi.vault.generic.Endpoint;
 * import com.pulumi.vault.generic.EndpointArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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 userpass = new AuthBackend("userpass", AuthBackendArgs.builder()
 *             .type("userpass")
 *             .build());
 * 
 *         var u1 = new Endpoint("u1", EndpointArgs.builder()
 *             .path("auth/userpass/users/u1")
 *             .ignoreAbsentFields(true)
 *             .dataJson("""
 * {
 *   "policies": ["p1"],
 *   "password": "changeme"
 * }
 *             """)
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(userpass)
 *                 .build());
 * 
 *         var u1Token = new Endpoint("u1Token", EndpointArgs.builder()
 *             .path("auth/userpass/login/u1")
 *             .disableRead(true)
 *             .disableDelete(true)
 *             .dataJson("""
 * {
 *   "password": "changeme"
 * }
 *             """)
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(u1)
 *                 .build());
 * 
 *         var u1Entity = new Endpoint("u1Entity", EndpointArgs.builder()
 *             .disableRead(true)
 *             .disableDelete(true)
 *             .path("identity/lookup/entity")
 *             .ignoreAbsentFields(true)
 *             .writeFields("id")
 *             .dataJson("""
 * {
 *   "alias_name": "u1",
 *   "alias_mount_accessor": vault_auth_backend.userpass.accessor
 * }
 *             """)
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(u1Token)
 *                 .build());
 * 
 *         ctx.export("u1Id", u1Entity.writeData().applyValue(writeData -> writeData.id()));
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Required Vault Capabilities * * Use of this resource requires the `create` or `update` capability * (depending on whether the resource already exists) on the given path. If * `disable_delete` is false, the `delete` capability is also required. If * `disable_read` is false, the `read` capability is required. * * ## Import * * Import is not supported for this resource. * */ @ResourceType(type="vault:generic/endpoint:Endpoint") public class Endpoint extends com.pulumi.resources.CustomResource { /** * String containing a JSON-encoded object that will be * written to the given path as the secret data. * */ @Export(name="dataJson", refs={String.class}, tree="[0]") private Output dataJson; /** * @return String containing a JSON-encoded object that will be * written to the given path as the secret data. * */ public Output dataJson() { return this.dataJson; } /** * - (Optional) True/false. Set this to true if your * vault authentication is not able to delete the data or if the endpoint * does not support the `DELETE` method. Defaults to false. * */ @Export(name="disableDelete", refs={Boolean.class}, tree="[0]") private Output disableDelete; /** * @return - (Optional) True/false. Set this to true if your * vault authentication is not able to delete the data or if the endpoint * does not support the `DELETE` method. Defaults to false. * */ public Output> disableDelete() { return Codegen.optional(this.disableDelete); } /** * True/false. Set this to true if your vault * authentication is not able to read the data or if the endpoint does * not support the `GET` method. Setting this to `true` will break drift * detection. You should set this to `true` for endpoints that are * write-only. Defaults to false. * */ @Export(name="disableRead", refs={Boolean.class}, tree="[0]") private Output disableRead; /** * @return True/false. Set this to true if your vault * authentication is not able to read the data or if the endpoint does * not support the `GET` method. Setting this to `true` will break drift * detection. You should set this to `true` for endpoints that are * write-only. Defaults to false. * */ public Output> disableRead() { return Codegen.optional(this.disableRead); } /** * - (Optional) True/false. If set to true, * ignore any fields present when the endpoint is read but that were not * in `data_json`. Also, if a field that was written is not returned when * the endpoint is read, treat that field as being up to date. You should * set this to `true` when writing to endpoint that, when read, returns a * different set of fields from the ones you wrote, as is common with * many configuration endpoints. Defaults to false. * */ @Export(name="ignoreAbsentFields", refs={Boolean.class}, tree="[0]") private Output ignoreAbsentFields; /** * @return - (Optional) True/false. If set to true, * ignore any fields present when the endpoint is read but that were not * in `data_json`. Also, if a field that was written is not returned when * the endpoint is read, treat that field as being up to date. You should * set this to `true` when writing to endpoint that, when read, returns a * different set of fields from the ones you wrote, as is common with * many configuration endpoints. Defaults to false. * */ public Output> ignoreAbsentFields() { return Codegen.optional(this.ignoreAbsentFields); } /** * 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 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); } /** * The full logical path at which to write the given * data. Consult each backend's documentation to see which endpoints * support the `PUT` methods and to determine whether they also support * `DELETE` and `GET`. * */ @Export(name="path", refs={String.class}, tree="[0]") private Output path; /** * @return The full logical path at which to write the given * data. Consult each backend's documentation to see which endpoints * support the `PUT` methods and to determine whether they also support * `DELETE` and `GET`. * */ public Output path() { return this.path; } /** * - A map whose keys are the top-level data keys * returned from Vault by the write operation and whose values are the * corresponding values. This map can only represent string data, so * any non-string values returned from Vault are serialized as JSON. * Only fields set in `write_fields` are present in the JSON data. * */ @Export(name="writeData", refs={Map.class,String.class}, tree="[0,1,1]") private Output> writeData; /** * @return - A map whose keys are the top-level data keys * returned from Vault by the write operation and whose values are the * corresponding values. This map can only represent string data, so * any non-string values returned from Vault are serialized as JSON. * Only fields set in `write_fields` are present in the JSON data. * */ public Output> writeData() { return this.writeData; } /** * - The JSON data returned by the write operation. * Only fields set in `write_fields` are present in the JSON data. * */ @Export(name="writeDataJson", refs={String.class}, tree="[0]") private Output writeDataJson; /** * @return - The JSON data returned by the write operation. * Only fields set in `write_fields` are present in the JSON data. * */ public Output writeDataJson() { return this.writeDataJson; } /** * - (Optional). A list of fields that should be returned * in `write_data_json` and `write_data`. If omitted, data returned by * the write operation is not available to the resource or included in * state. This helps to avoid accidental storage of sensitive values in * state. Some endpoints, such as many dynamic secrets endpoints, return * data from writing to an endpoint rather than reading it. You should * use `write_fields` if you need information returned in this way. * */ @Export(name="writeFields", refs={List.class,String.class}, tree="[0,1]") private Output> writeFields; /** * @return - (Optional). A list of fields that should be returned * in `write_data_json` and `write_data`. If omitted, data returned by * the write operation is not available to the resource or included in * state. This helps to avoid accidental storage of sensitive values in * state. Some endpoints, such as many dynamic secrets endpoints, return * data from writing to an endpoint rather than reading it. You should * use `write_fields` if you need information returned in this way. * */ public Output>> writeFields() { return Codegen.optional(this.writeFields); } /** * * @param name The _unique_ name of the resulting resource. */ public Endpoint(java.lang.String name) { this(name, EndpointArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public Endpoint(java.lang.String name, EndpointArgs 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 Endpoint(java.lang.String name, EndpointArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("vault:generic/endpoint:Endpoint", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private Endpoint(java.lang.String name, Output id, @Nullable EndpointState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("vault:generic/endpoint:Endpoint", name, state, makeResourceOptions(options, id), false); } private static EndpointArgs makeArgs(EndpointArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? EndpointArgs.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()) .additionalSecretOutputs(List.of( "dataJson" )) .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 Endpoint get(java.lang.String name, Output id, @Nullable EndpointState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new Endpoint(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy