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

com.pulumi.consul.AclBindingRule Maven / Gradle / Ivy

There is a newer version: 3.13.0-alpha.1732771629
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.consul;

import com.pulumi.consul.AclBindingRuleArgs;
import com.pulumi.consul.Utilities;
import com.pulumi.consul.inputs.AclBindingRuleState;
import com.pulumi.consul.outputs.AclBindingRuleBindVars;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Starting with Consul 1.5.0, the consul.AclBindingRule resource can be used to managed Consul ACL binding rules.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.consul.AclAuthMethod;
 * import com.pulumi.consul.AclAuthMethodArgs;
 * import com.pulumi.consul.AclBindingRule;
 * import com.pulumi.consul.AclBindingRuleArgs;
 * 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 minikube = new AclAuthMethod("minikube", AclAuthMethodArgs.builder()
 *             .name("minikube")
 *             .type("kubernetes")
 *             .description("dev minikube cluster")
 *             .config(Map.ofEntries(
 *                 Map.entry("Host", "https://192.0.2.42:8443"),
 *                 Map.entry("CACert", """
 * -----BEGIN CERTIFICATE-----
 * ...-----END CERTIFICATE-----
 *                 """),
 *                 Map.entry("ServiceAccountJWT", "eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9...")
 *             ))
 *             .build());
 * 
 *         var test = new AclBindingRule("test", AclBindingRuleArgs.builder()
 *             .authMethod(minikube.name())
 *             .description("foobar")
 *             .selector("serviceaccount.namespace==default")
 *             .bindType("service")
 *             .bindName("minikube")
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * */ @ResourceType(type="consul:index/aclBindingRule:AclBindingRule") public class AclBindingRule extends com.pulumi.resources.CustomResource { /** * The name of the ACL auth method this rule apply. * */ @Export(name="authMethod", refs={String.class}, tree="[0]") private Output authMethod; /** * @return The name of the ACL auth method this rule apply. * */ public Output authMethod() { return this.authMethod; } /** * The name to bind to a token at login-time. * */ @Export(name="bindName", refs={String.class}, tree="[0]") private Output bindName; /** * @return The name to bind to a token at login-time. * */ public Output bindName() { return this.bindName; } /** * Specifies the way the binding rule affects a token created at login. * */ @Export(name="bindType", refs={String.class}, tree="[0]") private Output bindType; /** * @return Specifies the way the binding rule affects a token created at login. * */ public Output bindType() { return this.bindType; } /** * The variables used when binding rule type is `templated-policy`. Can be lightly templated using HIL `${foo}` syntax from available field names. * */ @Export(name="bindVars", refs={AclBindingRuleBindVars.class}, tree="[0]") private Output bindVars; /** * @return The variables used when binding rule type is `templated-policy`. Can be lightly templated using HIL `${foo}` syntax from available field names. * */ public Output> bindVars() { return Codegen.optional(this.bindVars); } /** * A free form human readable description of the binding rule. * */ @Export(name="description", refs={String.class}, tree="[0]") private Output description; /** * @return A free form human readable description of the binding rule. * */ public Output> description() { return Codegen.optional(this.description); } /** * The namespace to create the binding rule within. * */ @Export(name="namespace", refs={String.class}, tree="[0]") private Output namespace; /** * @return The namespace to create the binding rule within. * */ public Output> namespace() { return Codegen.optional(this.namespace); } /** * The partition the ACL binding rule is associated with. * */ @Export(name="partition", refs={String.class}, tree="[0]") private Output partition; /** * @return The partition the ACL binding rule is associated with. * */ public Output> partition() { return Codegen.optional(this.partition); } /** * The expression used to match this rule against valid identities returned from an auth method validation. * */ @Export(name="selector", refs={String.class}, tree="[0]") private Output selector; /** * @return The expression used to match this rule against valid identities returned from an auth method validation. * */ public Output> selector() { return Codegen.optional(this.selector); } /** * * @param name The _unique_ name of the resulting resource. */ public AclBindingRule(java.lang.String name) { this(name, AclBindingRuleArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public AclBindingRule(java.lang.String name, AclBindingRuleArgs 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 AclBindingRule(java.lang.String name, AclBindingRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("consul:index/aclBindingRule:AclBindingRule", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private AclBindingRule(java.lang.String name, Output id, @Nullable AclBindingRuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("consul:index/aclBindingRule:AclBindingRule", name, state, makeResourceOptions(options, id), false); } private static AclBindingRuleArgs makeArgs(AclBindingRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? AclBindingRuleArgs.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 AclBindingRule get(java.lang.String name, Output id, @Nullable AclBindingRuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new AclBindingRule(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy