com.pulumi.rabbitmq.User Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rabbitmq Show documentation
Show all versions of rabbitmq Show documentation
A Pulumi package for creating and managing RabbitMQ 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.rabbitmq;
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.rabbitmq.UserArgs;
import com.pulumi.rabbitmq.Utilities;
import com.pulumi.rabbitmq.inputs.UserState;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* The ``rabbitmq.User`` resource creates and manages a user.
*
* > **Note:** All arguments including username and password will be stored in the raw state as plain-text.
* [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html).
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.rabbitmq.User;
* import com.pulumi.rabbitmq.UserArgs;
* 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 test = new User("test", UserArgs.builder()
* .name("mctest")
* .password("foobar")
* .tags(
* "administrator",
* "management")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Users can be imported using the `name`, e.g.
*
* ```sh
* $ pulumi import rabbitmq:index/user:User test mctest
* ```
*
*/
@ResourceType(type="rabbitmq:index/user:User")
public class User extends com.pulumi.resources.CustomResource {
/**
* The name of the user.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the user.
*
*/
public Output name() {
return this.name;
}
/**
* The password of the user. The value of this argument
* is plain-text so make sure to secure where this is defined.
*
*/
@Export(name="password", refs={String.class}, tree="[0]")
private Output password;
/**
* @return The password of the user. The value of this argument
* is plain-text so make sure to secure where this is defined.
*
*/
public Output password() {
return this.password;
}
/**
* Which permission model to apply to the user. Valid
* options are: management, policymaker, monitoring, and administrator.
*
*/
@Export(name="tags", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> tags;
/**
* @return Which permission model to apply to the user. Valid
* options are: management, policymaker, monitoring, and administrator.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public User(java.lang.String name) {
this(name, UserArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public User(java.lang.String name, UserArgs 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 User(java.lang.String name, UserArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("rabbitmq:index/user:User", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private User(java.lang.String name, Output id, @Nullable UserState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("rabbitmq:index/user:User", name, state, makeResourceOptions(options, id), false);
}
private static UserArgs makeArgs(UserArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? UserArgs.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(
"password"
))
.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 User get(java.lang.String name, Output id, @Nullable UserState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new User(name, id, state, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy