Package com.pulumi.aws.iam
Class UserLoginProfile
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.iam.UserLoginProfile
-
public class UserLoginProfile extends com.pulumi.resources.CustomResourceManages an IAM User Login Profile with limited support for password creation during this provider resource creation. Uses PGP to encrypt the password for safe transport to the user. PGP keys can be obtained from Keybase. > To reset an IAM User login password via this provider, you can use delete and recreate this resource or change any of the arguments. ## Example Usage
## Import Using `pulumi import`, import IAM User Login Profiles without password information via the IAM User name. For example: ```sh $ pulumi import aws:iam/userLoginProfile:UserLoginProfile example myusername ``` Since Pulumi has no method to read the PGP or password information during import, use the resource options `ignoreChanges` argument to ignore them (unless you want to recreate a password). For example:package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.iam.User; import com.pulumi.aws.iam.UserArgs; import com.pulumi.aws.iam.UserLoginProfile; import com.pulumi.aws.iam.UserLoginProfileArgs; import java.util.ArrayList; import java.util.Arrays; 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 User("example", UserArgs.builder() .name("example") .path("/") .forceDestroy(true) .build()); var exampleUserLoginProfile = new UserLoginProfile("exampleUserLoginProfile", UserLoginProfileArgs.builder() .user(example.name()) .pgpKey("keybase:some_person_that_exists") .build()); ctx.export("password", exampleUserLoginProfile.encryptedPassword()); } }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.iam.UserLoginProfile; import com.pulumi.aws.iam.UserLoginProfileArgs; import com.pulumi.resources.CustomResourceOptions; import java.util.ArrayList; import java.util.Arrays; 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 UserLoginProfile("example", UserLoginProfileArgs.Empty, CustomResourceOptions.builder() .ignoreChanges("passwordLength", "passwordResetRequired", "pgpKey") .build()); } }
-
-
Constructor Summary
Constructors Constructor Description UserLoginProfile(java.lang.String name)UserLoginProfile(java.lang.String name, UserLoginProfileArgs args)UserLoginProfile(java.lang.String name, UserLoginProfileArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>encryptedPassword()static UserLoginProfileget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, UserLoginProfileState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>keyFingerprint()com.pulumi.core.Output<java.lang.String>password()com.pulumi.core.Output<java.util.Optional<java.lang.Integer>>passwordLength()com.pulumi.core.Output<java.lang.Boolean>passwordResetRequired()com.pulumi.core.Output<java.util.Optional<java.lang.String>>pgpKey()com.pulumi.core.Output<java.lang.String>user()
-
-
-
Constructor Detail
-
UserLoginProfile
public UserLoginProfile(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
UserLoginProfile
public UserLoginProfile(java.lang.String name, UserLoginProfileArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
UserLoginProfile
public UserLoginProfile(java.lang.String name, UserLoginProfileArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
encryptedPassword
public com.pulumi.core.Output<java.lang.String> encryptedPassword()
- Returns:
- The encrypted password, base64 encoded. Only available if password was handled on resource creation, not import.
-
keyFingerprint
public com.pulumi.core.Output<java.lang.String> keyFingerprint()
- Returns:
- The fingerprint of the PGP key used to encrypt the password. Only available if password was handled on this provider resource creation, not import.
-
password
public com.pulumi.core.Output<java.lang.String> password()
- Returns:
- The plain text password, only available when `pgpKey` is not provided.
-
passwordLength
public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> passwordLength()
- Returns:
- The length of the generated password on resource creation. Only applies on resource creation. Drift detection is not possible with this argument. Default value is `20`.
-
passwordResetRequired
public com.pulumi.core.Output<java.lang.Boolean> passwordResetRequired()
- Returns:
- Whether the user should be forced to reset the generated password on resource creation. Only applies on resource creation.
-
pgpKey
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> pgpKey()
- Returns:
- Either a base-64 encoded PGP public key, or a keybase username in the form `keybase:username`. Only applies on resource creation. Drift detection is not possible with this argument.
-
user
public com.pulumi.core.Output<java.lang.String> user()
- Returns:
- The IAM user's name.
-
get
public static UserLoginProfile get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable UserLoginProfileState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-