
com.pulumi.azuread.ApplicationPassword 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.azuread;
import com.pulumi.azuread.ApplicationPasswordArgs;
import com.pulumi.azuread.Utilities;
import com.pulumi.azuread.inputs.ApplicationPasswordState;
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.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* ## Example Usage
*
* *Basic example*
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azuread.ApplicationRegistration;
* import com.pulumi.azuread.ApplicationRegistrationArgs;
* import com.pulumi.azuread.ApplicationPassword;
* import com.pulumi.azuread.ApplicationPasswordArgs;
* 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 example = new ApplicationRegistration("example", ApplicationRegistrationArgs.builder()
* .displayName("example")
* .build());
*
* var exampleApplicationPassword = new ApplicationPassword("exampleApplicationPassword", ApplicationPasswordArgs.builder()
* .applicationId(example.id())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* *Time-based rotation*
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azuread.ApplicationRegistration;
* import com.pulumi.azuread.ApplicationRegistrationArgs;
* import com.pulumi.time.Rotating;
* import com.pulumi.time.RotatingArgs;
* import com.pulumi.azuread.ApplicationPassword;
* import com.pulumi.azuread.ApplicationPasswordArgs;
* 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 example = new ApplicationRegistration("example", ApplicationRegistrationArgs.builder()
* .displayName("example")
* .build());
*
* var exampleRotating = new Rotating("exampleRotating", RotatingArgs.builder()
* .rotationDays(7)
* .build());
*
* var exampleApplicationPassword = new ApplicationPassword("exampleApplicationPassword", ApplicationPasswordArgs.builder()
* .applicationId(example.id())
* .rotateWhenChanged(Map.of("rotation", exampleRotating.id()))
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* This resource does not support importing.
*
*/
@ResourceType(type="azuread:index/applicationPassword:ApplicationPassword")
public class ApplicationPassword extends com.pulumi.resources.CustomResource {
/**
* The resource ID of the application for which this password should be created. Changing this field forces a new resource to be created.
*
*/
@Export(name="applicationId", refs={String.class}, tree="[0]")
private Output applicationId;
/**
* @return The resource ID of the application for which this password should be created. Changing this field forces a new resource to be created.
*
*/
public Output applicationId() {
return this.applicationId;
}
/**
* A display name for the password. Changing this field forces a new resource to be created.
*
*/
@Export(name="displayName", refs={String.class}, tree="[0]")
private Output displayName;
/**
* @return A display name for the password. Changing this field forces a new resource to be created.
*
*/
public Output displayName() {
return this.displayName;
}
/**
* The end date until which the password is valid, formatted as an RFC3339 date string (e.g. `2018-01-01T01:02:03Z`). Changing this field forces a new resource to be created.
*
*/
@Export(name="endDate", refs={String.class}, tree="[0]")
private Output endDate;
/**
* @return The end date until which the password is valid, formatted as an RFC3339 date string (e.g. `2018-01-01T01:02:03Z`). Changing this field forces a new resource to be created.
*
*/
public Output endDate() {
return this.endDate;
}
/**
* A relative duration for which the password is valid until, for example `240h` (10 days) or `2400h30m`. Changing this field forces a new resource to be created.
*
* @deprecated
* The `end_date_relative` property is deprecated and will be removed in a future version of the AzureAD provider. Please instead use the Terraform `timeadd()` function to calculate a value for the `end_date` property.
*
*/
@Deprecated /* The `end_date_relative` property is deprecated and will be removed in a future version of the AzureAD provider. Please instead use the Terraform `timeadd()` function to calculate a value for the `end_date` property. */
@Export(name="endDateRelative", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> endDateRelative;
/**
* @return A relative duration for which the password is valid until, for example `240h` (10 days) or `2400h30m`. Changing this field forces a new resource to be created.
*
*/
public Output> endDateRelative() {
return Codegen.optional(this.endDateRelative);
}
/**
* A UUID used to uniquely identify this password credential.
*
*/
@Export(name="keyId", refs={String.class}, tree="[0]")
private Output keyId;
/**
* @return A UUID used to uniquely identify this password credential.
*
*/
public Output keyId() {
return this.keyId;
}
/**
* A map of arbitrary key/value pairs that will force recreation of the password when they change, enabling password rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
*
*/
@Export(name="rotateWhenChanged", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> rotateWhenChanged;
/**
* @return A map of arbitrary key/value pairs that will force recreation of the password when they change, enabling password rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
*
*/
public Output>> rotateWhenChanged() {
return Codegen.optional(this.rotateWhenChanged);
}
/**
* The start date from which the password is valid, formatted as an RFC3339 date string (e.g. `2018-01-01T01:02:03Z`). If this isn't specified, the current date is used. Changing this field forces a new resource to be created.
*
*/
@Export(name="startDate", refs={String.class}, tree="[0]")
private Output startDate;
/**
* @return The start date from which the password is valid, formatted as an RFC3339 date string (e.g. `2018-01-01T01:02:03Z`). If this isn't specified, the current date is used. Changing this field forces a new resource to be created.
*
*/
public Output startDate() {
return this.startDate;
}
/**
* The password for this application, which is generated by Azure Active Directory.
*
*/
@Export(name="value", refs={String.class}, tree="[0]")
private Output value;
/**
* @return The password for this application, which is generated by Azure Active Directory.
*
*/
public Output value() {
return this.value;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ApplicationPassword(java.lang.String name) {
this(name, ApplicationPasswordArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ApplicationPassword(java.lang.String name, ApplicationPasswordArgs 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 ApplicationPassword(java.lang.String name, ApplicationPasswordArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azuread:index/applicationPassword:ApplicationPassword", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ApplicationPassword(java.lang.String name, Output id, @Nullable ApplicationPasswordState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azuread:index/applicationPassword:ApplicationPassword", name, state, makeResourceOptions(options, id), false);
}
private static ApplicationPasswordArgs makeArgs(ApplicationPasswordArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ApplicationPasswordArgs.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(
"value"
))
.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 ApplicationPassword get(java.lang.String name, Output id, @Nullable ApplicationPasswordState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ApplicationPassword(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy