GetCipherText
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
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var oauthConfig = new Aws.Kms.Key("oauthConfig", new Aws.Kms.KeyArgs
{
Description = "oauth config",
IsEnabled = true,
});
var oauth = oauthConfig.KeyId.Apply(keyId => Aws.Kms.GetCipherText.InvokeAsync(new Aws.Kms.GetCipherTextArgs
{
KeyId = keyId,
Plaintext = @"{
""client_id"": ""e587dbae22222f55da22"",
""client_secret"": ""8289575d00000ace55e1815ec13673955721b8a5""
}
",
}));
}
}
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/kms"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
oauthConfig, err := kms.NewKey(ctx, "oauthConfig", &kms.KeyArgs{
Description: pulumi.String("oauth config"),
IsEnabled: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
oauth_config = aws.kms.Key("oauthConfig",
description="oauth config",
is_enabled=True)
oauth = oauth_config.key_id.apply(lambda key_id: aws.kms.get_cipher_text(key_id=key_id,
plaintext="""{
"client_id": "e587dbae22222f55da22",
"client_secret": "8289575d00000ace55e1815ec13673955721b8a5"
}
"""))import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const oauthConfig = new aws.kms.Key("oauth_config", {
description: "oauth config",
isEnabled: true,
});
const oauth = oauthConfig.keyId.apply(keyId => aws.kms.getCipherText({
keyId: keyId,
plaintext: `{
"client_id": "e587dbae22222f55da22",
"client_secret": "8289575d00000ace55e1815ec13673955721b8a5"
}
`,
}, { async: true }));Using GetCipherText
function getCipherText(args: GetCipherTextArgs, opts?: InvokeOptions): Promise<GetCipherTextResult>function get_cipher_text(context=None, key_id=None, plaintext=None, opts=None)func GetCipherText(ctx *Context, args *GetCipherTextArgs, opts ...InvokeOption) (*GetCipherTextResult, error)public static class GetCipherText {
public static Task<GetCipherTextResult> InvokeAsync(GetCipherTextArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
GetCipherText Result
The following output properties are available:
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.