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

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

// *** 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.AclRoleArgs;
import com.pulumi.consul.Utilities;
import com.pulumi.consul.inputs.AclRoleState;
import com.pulumi.consul.outputs.AclRoleNodeIdentity;
import com.pulumi.consul.outputs.AclRoleServiceIdentity;
import com.pulumi.consul.outputs.AclRoleTemplatedPolicy;
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.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.consul.AclPolicy;
 * import com.pulumi.consul.AclPolicyArgs;
 * import com.pulumi.consul.AclRole;
 * import com.pulumi.consul.AclRoleArgs;
 * import com.pulumi.consul.inputs.AclRoleServiceIdentityArgs;
 * 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 read_policy = new AclPolicy("read-policy", AclPolicyArgs.builder()        
 *             .name("read-policy")
 *             .rules("node \"\" { policy = \"read\" }")
 *             .datacenters("dc1")
 *             .build());
 * 
 *         var read = new AclRole("read", AclRoleArgs.builder()        
 *             .name("foo")
 *             .description("bar")
 *             .policies(read_policy.id())
 *             .serviceIdentities(AclRoleServiceIdentityArgs.builder()
 *                 .serviceName("foo")
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * ```
 * <!--End PulumiCodeChooser -->
 * 
 * ## Import
 * 
 * ```sh
 * $ pulumi import consul:index/aclRole:AclRole read 816a195f-6cb1-2e8d-92af-3011ae706318
 * ```
 * 
 */
@ResourceType(type="consul:index/aclRole:AclRole")
public class AclRole extends com.pulumi.resources.CustomResource {
    /**
     * A free form human readable description of the role.
     * 
     */
    @Export(name="description", refs={String.class}, tree="[0]")
    private Output description;

    /**
     * @return A free form human readable description of the role.
     * 
     */
    public Output> description() {
        return Codegen.optional(this.description);
    }
    /**
     * The name of the ACL role.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output name;

    /**
     * @return The name of the ACL role.
     * 
     */
    public Output name() {
        return this.name;
    }
    /**
     * The namespace to create the role within.
     * 
     */
    @Export(name="namespace", refs={String.class}, tree="[0]")
    private Output namespace;

    /**
     * @return The namespace to create the role within.
     * 
     */
    public Output> namespace() {
        return Codegen.optional(this.namespace);
    }
    /**
     * The list of node identities that should be applied to the role.
     * 
     */
    @Export(name="nodeIdentities", refs={List.class,AclRoleNodeIdentity.class}, tree="[0,1]")
    private Output> nodeIdentities;

    /**
     * @return The list of node identities that should be applied to the role.
     * 
     */
    public Output>> nodeIdentities() {
        return Codegen.optional(this.nodeIdentities);
    }
    /**
     * The partition the ACL role is associated with.
     * 
     */
    @Export(name="partition", refs={String.class}, tree="[0]")
    private Output partition;

    /**
     * @return The partition the ACL role is associated with.
     * 
     */
    public Output> partition() {
        return Codegen.optional(this.partition);
    }
    /**
     * The list of policies that should be applied to the role. Both the policy ID or its name can be used.
     * 
     */
    @Export(name="policies", refs={List.class,String.class}, tree="[0,1]")
    private Output> policies;

    /**
     * @return The list of policies that should be applied to the role. Both the policy ID or its name can be used.
     * 
     */
    public Output>> policies() {
        return Codegen.optional(this.policies);
    }
    /**
     * The list of service identities that should be applied to the role.
     * 
     */
    @Export(name="serviceIdentities", refs={List.class,AclRoleServiceIdentity.class}, tree="[0,1]")
    private Output> serviceIdentities;

    /**
     * @return The list of service identities that should be applied to the role.
     * 
     */
    public Output>> serviceIdentities() {
        return Codegen.optional(this.serviceIdentities);
    }
    /**
     * The list of templated policies that should be applied to the token.
     * 
     */
    @Export(name="templatedPolicies", refs={List.class,AclRoleTemplatedPolicy.class}, tree="[0,1]")
    private Output> templatedPolicies;

    /**
     * @return The list of templated policies that should be applied to the token.
     * 
     */
    public Output>> templatedPolicies() {
        return Codegen.optional(this.templatedPolicies);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public AclRole(String name) {
        this(name, AclRoleArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public AclRole(String name, @Nullable AclRoleArgs 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 AclRole(String name, @Nullable AclRoleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("consul:index/aclRole:AclRole", name, args == null ? AclRoleArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private AclRole(String name, Output id, @Nullable AclRoleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("consul:index/aclRole:AclRole", name, state, makeResourceOptions(options, id));
    }

    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 AclRole get(String name, Output id, @Nullable AclRoleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new AclRole(name, id, state, options);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy