get Cipher Text
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
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());
}
}
Content copied to clipboard
Return
A collection of values returned by getCipherText.
Parameters
argument
A collection of arguments for invoking getCipherText.
suspend fun getCipherText(context: Map<String, String>? = null, keyId: String, plaintext: String): GetCipherTextResult
Return
A collection of values returned by getCipherText.
Parameters
context
An optional mapping that makes up the encryption context.
key Id
Globally unique key ID for the customer master key.
plaintext
Data to be encrypted. Note that this may show up in logs, and it will be stored in the state file.
See also
suspend fun getCipherText(argument: suspend GetCipherTextPlainArgsBuilder.() -> Unit): GetCipherTextResult
Return
A collection of values returned by getCipherText.
Parameters
argument
Builder for com.pulumi.aws.kms.kotlin.inputs.GetCipherTextPlainArgs.