com.pulumi.aws.kms.KmsFunctions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws Show documentation
Show all versions of aws Show documentation
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
The newest version!
// *** 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.aws.kms;
import com.pulumi.aws.Utilities;
import com.pulumi.aws.kms.inputs.GetAliasArgs;
import com.pulumi.aws.kms.inputs.GetAliasPlainArgs;
import com.pulumi.aws.kms.inputs.GetCipherTextArgs;
import com.pulumi.aws.kms.inputs.GetCipherTextPlainArgs;
import com.pulumi.aws.kms.inputs.GetCustomKeyStoreArgs;
import com.pulumi.aws.kms.inputs.GetCustomKeyStorePlainArgs;
import com.pulumi.aws.kms.inputs.GetKeyArgs;
import com.pulumi.aws.kms.inputs.GetKeyPlainArgs;
import com.pulumi.aws.kms.inputs.GetPublicKeyArgs;
import com.pulumi.aws.kms.inputs.GetPublicKeyPlainArgs;
import com.pulumi.aws.kms.inputs.GetSecretArgs;
import com.pulumi.aws.kms.inputs.GetSecretPlainArgs;
import com.pulumi.aws.kms.inputs.GetSecretsArgs;
import com.pulumi.aws.kms.inputs.GetSecretsPlainArgs;
import com.pulumi.aws.kms.outputs.GetAliasResult;
import com.pulumi.aws.kms.outputs.GetCipherTextResult;
import com.pulumi.aws.kms.outputs.GetCustomKeyStoreResult;
import com.pulumi.aws.kms.outputs.GetKeyResult;
import com.pulumi.aws.kms.outputs.GetPublicKeyResult;
import com.pulumi.aws.kms.outputs.GetSecretResult;
import com.pulumi.aws.kms.outputs.GetSecretsResult;
import com.pulumi.core.Output;
import com.pulumi.core.TypeShape;
import com.pulumi.deployment.Deployment;
import com.pulumi.deployment.InvokeOptions;
import java.util.concurrent.CompletableFuture;
public final class KmsFunctions {
/**
* Use this data source to get the ARN of a KMS key alias.
* By using this data source, you can reference key alias
* without having to hard code the ARN as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetAliasArgs;
* 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) {
* final var s3 = KmsFunctions.getAlias(GetAliasArgs.builder()
* .name("alias/aws/s3")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static Output getAlias(GetAliasArgs args) {
return getAlias(args, InvokeOptions.Empty);
}
/**
* Use this data source to get the ARN of a KMS key alias.
* By using this data source, you can reference key alias
* without having to hard code the ARN as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetAliasArgs;
* 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) {
* final var s3 = KmsFunctions.getAlias(GetAliasArgs.builder()
* .name("alias/aws/s3")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static CompletableFuture getAliasPlain(GetAliasPlainArgs args) {
return getAliasPlain(args, InvokeOptions.Empty);
}
/**
* Use this data source to get the ARN of a KMS key alias.
* By using this data source, you can reference key alias
* without having to hard code the ARN as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetAliasArgs;
* 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) {
* final var s3 = KmsFunctions.getAlias(GetAliasArgs.builder()
* .name("alias/aws/s3")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static Output getAlias(GetAliasArgs args, InvokeOptions options) {
return Deployment.getInstance().invoke("aws:kms/getAlias:getAlias", TypeShape.of(GetAliasResult.class), args, Utilities.withVersion(options));
}
/**
* Use this data source to get the ARN of a KMS key alias.
* By using this data source, you can reference key alias
* without having to hard code the ARN as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetAliasArgs;
* 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) {
* final var s3 = KmsFunctions.getAlias(GetAliasArgs.builder()
* .name("alias/aws/s3")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static CompletableFuture getAliasPlain(GetAliasPlainArgs args, InvokeOptions options) {
return Deployment.getInstance().invokeAsync("aws:kms/getAlias:getAlias", TypeShape.of(GetAliasResult.class), args, Utilities.withVersion(options));
}
/**
* The KMS ciphertext data source allows you to encrypt plaintext into ciphertext
* by using an AWS KMS customer master key. The value returned by this data source
* changes every apply. For a stable ciphertext value, see the `aws.kms.Ciphertext`
* resource.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.Key;
* import com.pulumi.aws.kms.KeyArgs;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetCipherTextArgs;
* 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 oauthConfig = new Key("oauthConfig", KeyArgs.builder()
* .description("oauth config")
* .isEnabled(true)
* .build());
*
* final var oauth = KmsFunctions.getCipherText(GetCipherTextArgs.builder()
* .keyId(oauthConfig.keyId())
* .plaintext("""
* {
* "client_id": "e587dbae22222f55da22",
* "client_secret": "8289575d00000ace55e1815ec13673955721b8a5"
* }
* """)
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static Output getCipherText(GetCipherTextArgs args) {
return getCipherText(args, InvokeOptions.Empty);
}
/**
* The KMS ciphertext data source allows you to encrypt plaintext into ciphertext
* by using an AWS KMS customer master key. The value returned by this data source
* changes every apply. For a stable ciphertext value, see the `aws.kms.Ciphertext`
* resource.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.Key;
* import com.pulumi.aws.kms.KeyArgs;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetCipherTextArgs;
* 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 oauthConfig = new Key("oauthConfig", KeyArgs.builder()
* .description("oauth config")
* .isEnabled(true)
* .build());
*
* final var oauth = KmsFunctions.getCipherText(GetCipherTextArgs.builder()
* .keyId(oauthConfig.keyId())
* .plaintext("""
* {
* "client_id": "e587dbae22222f55da22",
* "client_secret": "8289575d00000ace55e1815ec13673955721b8a5"
* }
* """)
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static CompletableFuture getCipherTextPlain(GetCipherTextPlainArgs args) {
return getCipherTextPlain(args, InvokeOptions.Empty);
}
/**
* The KMS ciphertext data source allows you to encrypt plaintext into ciphertext
* by using an AWS KMS customer master key. The value returned by this data source
* changes every apply. For a stable ciphertext value, see the `aws.kms.Ciphertext`
* resource.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.Key;
* import com.pulumi.aws.kms.KeyArgs;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetCipherTextArgs;
* 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 oauthConfig = new Key("oauthConfig", KeyArgs.builder()
* .description("oauth config")
* .isEnabled(true)
* .build());
*
* final var oauth = KmsFunctions.getCipherText(GetCipherTextArgs.builder()
* .keyId(oauthConfig.keyId())
* .plaintext("""
* {
* "client_id": "e587dbae22222f55da22",
* "client_secret": "8289575d00000ace55e1815ec13673955721b8a5"
* }
* """)
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static Output getCipherText(GetCipherTextArgs args, InvokeOptions options) {
return Deployment.getInstance().invoke("aws:kms/getCipherText:getCipherText", TypeShape.of(GetCipherTextResult.class), args, Utilities.withVersion(options));
}
/**
* The KMS ciphertext data source allows you to encrypt plaintext into ciphertext
* by using an AWS KMS customer master key. The value returned by this data source
* changes every apply. For a stable ciphertext value, see the `aws.kms.Ciphertext`
* resource.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.Key;
* import com.pulumi.aws.kms.KeyArgs;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetCipherTextArgs;
* 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 oauthConfig = new Key("oauthConfig", KeyArgs.builder()
* .description("oauth config")
* .isEnabled(true)
* .build());
*
* final var oauth = KmsFunctions.getCipherText(GetCipherTextArgs.builder()
* .keyId(oauthConfig.keyId())
* .plaintext("""
* {
* "client_id": "e587dbae22222f55da22",
* "client_secret": "8289575d00000ace55e1815ec13673955721b8a5"
* }
* """)
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static CompletableFuture getCipherTextPlain(GetCipherTextPlainArgs args, InvokeOptions options) {
return Deployment.getInstance().invokeAsync("aws:kms/getCipherText:getCipherText", TypeShape.of(GetCipherTextResult.class), args, Utilities.withVersion(options));
}
/**
* Use this data source to get the metadata KMS custom key store.
* By using this data source, you can reference KMS custom key store
* without having to hard code the ID as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetCustomKeyStoreArgs;
* 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) {
* final var keystore = KmsFunctions.getCustomKeyStore(GetCustomKeyStoreArgs.builder()
* .customKeyStoreName("my_cloudhsm")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static Output getCustomKeyStore() {
return getCustomKeyStore(GetCustomKeyStoreArgs.Empty, InvokeOptions.Empty);
}
/**
* Use this data source to get the metadata KMS custom key store.
* By using this data source, you can reference KMS custom key store
* without having to hard code the ID as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetCustomKeyStoreArgs;
* 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) {
* final var keystore = KmsFunctions.getCustomKeyStore(GetCustomKeyStoreArgs.builder()
* .customKeyStoreName("my_cloudhsm")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static CompletableFuture getCustomKeyStorePlain() {
return getCustomKeyStorePlain(GetCustomKeyStorePlainArgs.Empty, InvokeOptions.Empty);
}
/**
* Use this data source to get the metadata KMS custom key store.
* By using this data source, you can reference KMS custom key store
* without having to hard code the ID as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetCustomKeyStoreArgs;
* 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) {
* final var keystore = KmsFunctions.getCustomKeyStore(GetCustomKeyStoreArgs.builder()
* .customKeyStoreName("my_cloudhsm")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static Output getCustomKeyStore(GetCustomKeyStoreArgs args) {
return getCustomKeyStore(args, InvokeOptions.Empty);
}
/**
* Use this data source to get the metadata KMS custom key store.
* By using this data source, you can reference KMS custom key store
* without having to hard code the ID as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetCustomKeyStoreArgs;
* 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) {
* final var keystore = KmsFunctions.getCustomKeyStore(GetCustomKeyStoreArgs.builder()
* .customKeyStoreName("my_cloudhsm")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static CompletableFuture getCustomKeyStorePlain(GetCustomKeyStorePlainArgs args) {
return getCustomKeyStorePlain(args, InvokeOptions.Empty);
}
/**
* Use this data source to get the metadata KMS custom key store.
* By using this data source, you can reference KMS custom key store
* without having to hard code the ID as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetCustomKeyStoreArgs;
* 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) {
* final var keystore = KmsFunctions.getCustomKeyStore(GetCustomKeyStoreArgs.builder()
* .customKeyStoreName("my_cloudhsm")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static Output getCustomKeyStore(GetCustomKeyStoreArgs args, InvokeOptions options) {
return Deployment.getInstance().invoke("aws:kms/getCustomKeyStore:getCustomKeyStore", TypeShape.of(GetCustomKeyStoreResult.class), args, Utilities.withVersion(options));
}
/**
* Use this data source to get the metadata KMS custom key store.
* By using this data source, you can reference KMS custom key store
* without having to hard code the ID as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetCustomKeyStoreArgs;
* 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) {
* final var keystore = KmsFunctions.getCustomKeyStore(GetCustomKeyStoreArgs.builder()
* .customKeyStoreName("my_cloudhsm")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static CompletableFuture getCustomKeyStorePlain(GetCustomKeyStorePlainArgs args, InvokeOptions options) {
return Deployment.getInstance().invokeAsync("aws:kms/getCustomKeyStore:getCustomKeyStore", TypeShape.of(GetCustomKeyStoreResult.class), args, Utilities.withVersion(options));
}
/**
* Use this data source to get detailed information about
* the specified KMS Key with flexible key id input.
* This can be useful to reference key alias
* without having to hard code the ARN as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetKeyArgs;
* 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) {
* final var byAlias = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("alias/my-key")
* .build());
*
* final var byId = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* final var byAliasArn = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:alias/my-key")
* .build());
*
* final var byKeyArn = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static Output getKey(GetKeyArgs args) {
return getKey(args, InvokeOptions.Empty);
}
/**
* Use this data source to get detailed information about
* the specified KMS Key with flexible key id input.
* This can be useful to reference key alias
* without having to hard code the ARN as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetKeyArgs;
* 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) {
* final var byAlias = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("alias/my-key")
* .build());
*
* final var byId = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* final var byAliasArn = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:alias/my-key")
* .build());
*
* final var byKeyArn = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static CompletableFuture getKeyPlain(GetKeyPlainArgs args) {
return getKeyPlain(args, InvokeOptions.Empty);
}
/**
* Use this data source to get detailed information about
* the specified KMS Key with flexible key id input.
* This can be useful to reference key alias
* without having to hard code the ARN as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetKeyArgs;
* 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) {
* final var byAlias = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("alias/my-key")
* .build());
*
* final var byId = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* final var byAliasArn = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:alias/my-key")
* .build());
*
* final var byKeyArn = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static Output getKey(GetKeyArgs args, InvokeOptions options) {
return Deployment.getInstance().invoke("aws:kms/getKey:getKey", TypeShape.of(GetKeyResult.class), args, Utilities.withVersion(options));
}
/**
* Use this data source to get detailed information about
* the specified KMS Key with flexible key id input.
* This can be useful to reference key alias
* without having to hard code the ARN as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetKeyArgs;
* 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) {
* final var byAlias = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("alias/my-key")
* .build());
*
* final var byId = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* final var byAliasArn = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:alias/my-key")
* .build());
*
* final var byKeyArn = KmsFunctions.getKey(GetKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static CompletableFuture getKeyPlain(GetKeyPlainArgs args, InvokeOptions options) {
return Deployment.getInstance().invokeAsync("aws:kms/getKey:getKey", TypeShape.of(GetKeyResult.class), args, Utilities.withVersion(options));
}
/**
* Use this data source to get the public key about the specified KMS Key with flexible key id input. This can be useful to reference key alias without having to hard code the ARN as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetPublicKeyArgs;
* 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) {
* final var byAlias = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("alias/my-key")
* .build());
*
* final var byId = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* final var byAliasArn = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:alias/my-key")
* .build());
*
* final var byKeyArn = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static Output getPublicKey(GetPublicKeyArgs args) {
return getPublicKey(args, InvokeOptions.Empty);
}
/**
* Use this data source to get the public key about the specified KMS Key with flexible key id input. This can be useful to reference key alias without having to hard code the ARN as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetPublicKeyArgs;
* 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) {
* final var byAlias = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("alias/my-key")
* .build());
*
* final var byId = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* final var byAliasArn = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:alias/my-key")
* .build());
*
* final var byKeyArn = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static CompletableFuture getPublicKeyPlain(GetPublicKeyPlainArgs args) {
return getPublicKeyPlain(args, InvokeOptions.Empty);
}
/**
* Use this data source to get the public key about the specified KMS Key with flexible key id input. This can be useful to reference key alias without having to hard code the ARN as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetPublicKeyArgs;
* 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) {
* final var byAlias = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("alias/my-key")
* .build());
*
* final var byId = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* final var byAliasArn = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:alias/my-key")
* .build());
*
* final var byKeyArn = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static Output getPublicKey(GetPublicKeyArgs args, InvokeOptions options) {
return Deployment.getInstance().invoke("aws:kms/getPublicKey:getPublicKey", TypeShape.of(GetPublicKeyResult.class), args, Utilities.withVersion(options));
}
/**
* Use this data source to get the public key about the specified KMS Key with flexible key id input. This can be useful to reference key alias without having to hard code the ARN as input.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.kms.KmsFunctions;
* import com.pulumi.aws.kms.inputs.GetPublicKeyArgs;
* 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) {
* final var byAlias = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("alias/my-key")
* .build());
*
* final var byId = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* final var byAliasArn = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:alias/my-key")
* .build());
*
* final var byKeyArn = KmsFunctions.getPublicKey(GetPublicKeyArgs.builder()
* .keyId("arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
public static CompletableFuture getPublicKeyPlain(GetPublicKeyPlainArgs args, InvokeOptions options) {
return Deployment.getInstance().invokeAsync("aws:kms/getPublicKey:getPublicKey", TypeShape.of(GetPublicKeyResult.class), args, Utilities.withVersion(options));
}
public static Output getSecret(GetSecretArgs args) {
return getSecret(args, InvokeOptions.Empty);
}
public static CompletableFuture getSecretPlain(GetSecretPlainArgs args) {
return getSecretPlain(args, InvokeOptions.Empty);
}
public static Output getSecret(GetSecretArgs args, InvokeOptions options) {
return Deployment.getInstance().invoke("aws:kms/getSecret:getSecret", TypeShape.of(GetSecretResult.class), args, Utilities.withVersion(options));
}
public static CompletableFuture getSecretPlain(GetSecretPlainArgs args, InvokeOptions options) {
return Deployment.getInstance().invokeAsync("aws:kms/getSecret:getSecret", TypeShape.of(GetSecretResult.class), args, Utilities.withVersion(options));
}
/**
* Decrypt multiple secrets from data encrypted with the AWS KMS service.
*
* ## Example Usage
*
* If you do not already have a `CiphertextBlob` from encrypting a KMS secret, you can use the below commands to obtain one using the [AWS CLI kms encrypt](https://docs.aws.amazon.com/cli/latest/reference/kms/encrypt.html) command. This requires you to have your AWS CLI setup correctly and replace the `--key-id` with your own. Alternatively you can use `--plaintext 'master-password'` (CLIv1) or `--plaintext fileb://<(echo -n 'master-password')` (CLIv2) instead of reading from a file.
*
* > If you have a newline character at the end of your file, it will be decrypted with this newline character intact. For most use cases this is undesirable and leads to incorrect passwords or invalid values, as well as possible changes in the plan. Be sure to use `echo -n` if necessary.
* If you are using asymmetric keys ensure you are using the right encryption algorithm when you encrypt and decrypt else you will get IncorrectKeyException during the decrypt phase.
*
* That encrypted output can now be inserted into provider configurations without exposing the plaintext secret directly.
*
*/
public static Output getSecrets(GetSecretsArgs args) {
return getSecrets(args, InvokeOptions.Empty);
}
/**
* Decrypt multiple secrets from data encrypted with the AWS KMS service.
*
* ## Example Usage
*
* If you do not already have a `CiphertextBlob` from encrypting a KMS secret, you can use the below commands to obtain one using the [AWS CLI kms encrypt](https://docs.aws.amazon.com/cli/latest/reference/kms/encrypt.html) command. This requires you to have your AWS CLI setup correctly and replace the `--key-id` with your own. Alternatively you can use `--plaintext 'master-password'` (CLIv1) or `--plaintext fileb://<(echo -n 'master-password')` (CLIv2) instead of reading from a file.
*
* > If you have a newline character at the end of your file, it will be decrypted with this newline character intact. For most use cases this is undesirable and leads to incorrect passwords or invalid values, as well as possible changes in the plan. Be sure to use `echo -n` if necessary.
* If you are using asymmetric keys ensure you are using the right encryption algorithm when you encrypt and decrypt else you will get IncorrectKeyException during the decrypt phase.
*
* That encrypted output can now be inserted into provider configurations without exposing the plaintext secret directly.
*
*/
public static CompletableFuture getSecretsPlain(GetSecretsPlainArgs args) {
return getSecretsPlain(args, InvokeOptions.Empty);
}
/**
* Decrypt multiple secrets from data encrypted with the AWS KMS service.
*
* ## Example Usage
*
* If you do not already have a `CiphertextBlob` from encrypting a KMS secret, you can use the below commands to obtain one using the [AWS CLI kms encrypt](https://docs.aws.amazon.com/cli/latest/reference/kms/encrypt.html) command. This requires you to have your AWS CLI setup correctly and replace the `--key-id` with your own. Alternatively you can use `--plaintext 'master-password'` (CLIv1) or `--plaintext fileb://<(echo -n 'master-password')` (CLIv2) instead of reading from a file.
*
* > If you have a newline character at the end of your file, it will be decrypted with this newline character intact. For most use cases this is undesirable and leads to incorrect passwords or invalid values, as well as possible changes in the plan. Be sure to use `echo -n` if necessary.
* If you are using asymmetric keys ensure you are using the right encryption algorithm when you encrypt and decrypt else you will get IncorrectKeyException during the decrypt phase.
*
* That encrypted output can now be inserted into provider configurations without exposing the plaintext secret directly.
*
*/
public static Output getSecrets(GetSecretsArgs args, InvokeOptions options) {
return Deployment.getInstance().invoke("aws:kms/getSecrets:getSecrets", TypeShape.of(GetSecretsResult.class), args, Utilities.withVersion(options));
}
/**
* Decrypt multiple secrets from data encrypted with the AWS KMS service.
*
* ## Example Usage
*
* If you do not already have a `CiphertextBlob` from encrypting a KMS secret, you can use the below commands to obtain one using the [AWS CLI kms encrypt](https://docs.aws.amazon.com/cli/latest/reference/kms/encrypt.html) command. This requires you to have your AWS CLI setup correctly and replace the `--key-id` with your own. Alternatively you can use `--plaintext 'master-password'` (CLIv1) or `--plaintext fileb://<(echo -n 'master-password')` (CLIv2) instead of reading from a file.
*
* > If you have a newline character at the end of your file, it will be decrypted with this newline character intact. For most use cases this is undesirable and leads to incorrect passwords or invalid values, as well as possible changes in the plan. Be sure to use `echo -n` if necessary.
* If you are using asymmetric keys ensure you are using the right encryption algorithm when you encrypt and decrypt else you will get IncorrectKeyException during the decrypt phase.
*
* That encrypted output can now be inserted into provider configurations without exposing the plaintext secret directly.
*
*/
public static CompletableFuture getSecretsPlain(GetSecretsPlainArgs args, InvokeOptions options) {
return Deployment.getInstance().invokeAsync("aws:kms/getSecrets:getSecrets", TypeShape.of(GetSecretsResult.class), args, Utilities.withVersion(options));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy