AccessKey

class AccessKey : KotlinCustomResource

Provides a RAM User access key resource.

NOTE: You should set the secret_file if you want to get the access key. NOTE: From version 1.98.0, if not set pgp_key, the resource will output the access key secret to field secret and please protect your backend state file judiciously NOTE: Available since v1.0.0+.

Example Usage

Output the secret to a file.

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ram.User;
import com.pulumi.alicloud.ram.UserArgs;
import com.pulumi.alicloud.ram.AccessKey;
import com.pulumi.alicloud.ram.AccessKeyArgs;
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 user = new User("user", UserArgs.builder()
.displayName("user_display_name")
.mobile("86-18688888888")
.email("hello.uuu@aaa.com")
.comments("yoyoyo")
.force(true)
.build());
var ak = new AccessKey("ak", AccessKeyArgs.builder()
.userName(user.name())
.secretFile("/xxx/xxx/xxx.txt")
.build());
}
}

Properties

Link copied to clipboard
val encryptedSecret: Output<String>
Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val keyFingerprint: Output<String>

The fingerprint of the PGP key used to encrypt the secret

Link copied to clipboard
val pgpKey: Output<String>?

Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val secret: Output<String>

(Available since 1.98.0+) - The secret access key. Note that this will be written to the state file. If you use this, please protect your backend state file judiciously. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext, at the cost of preventing the use of the secret key in automation.

Link copied to clipboard
val secretFile: Output<String>?

The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.

Link copied to clipboard
val status: Output<String>?

Status of access key. It must be Active or Inactive. Default value is Active.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val userName: Output<String>?

Name of the RAM user. This name can have a string of 1 to 64 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin with a hyphen.