/
getKMSSecretCiphertext.go
112 lines (94 loc) · 4.52 KB
/
getKMSSecretCiphertext.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package kms
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// !> **Warning:** This data source is deprecated. Use the `kms.SecretCiphertext` **resource** instead.
//
// This data source allows you to encrypt data with Google Cloud KMS and use the
// ciphertext within your resource definitions.
//
// For more information see
// [the official documentation](https://cloud.google.com/kms/docs/encrypt-decrypt).
//
// > **NOTE:** Using this data source will allow you to conceal secret data within your
// resource definitions, but it does not take care of protecting that data in the
// logging output, plan output, or state output. Please take care to secure your secret
// data outside of resource definitions.
func GetKMSSecretCiphertext(ctx *pulumi.Context, args *GetKMSSecretCiphertextArgs, opts ...pulumi.InvokeOption) (*GetKMSSecretCiphertextResult, error) {
var rv GetKMSSecretCiphertextResult
err := ctx.Invoke("gcp:kms/getKMSSecretCiphertext:getKMSSecretCiphertext", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getKMSSecretCiphertext.
type GetKMSSecretCiphertextArgs struct {
// The id of the CryptoKey that will be used to
// encrypt the provided plaintext. This is represented by the format
// `{projectId}/{location}/{keyRingName}/{cryptoKeyName}`.
CryptoKey string `pulumi:"cryptoKey"`
// The plaintext to be encrypted
Plaintext string `pulumi:"plaintext"`
}
// A collection of values returned by getKMSSecretCiphertext.
type GetKMSSecretCiphertextResult struct {
// Contains the result of encrypting the provided plaintext, encoded in base64.
Ciphertext string `pulumi:"ciphertext"`
CryptoKey string `pulumi:"cryptoKey"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Plaintext string `pulumi:"plaintext"`
}
func GetKMSSecretCiphertextOutput(ctx *pulumi.Context, args GetKMSSecretCiphertextOutputArgs, opts ...pulumi.InvokeOption) GetKMSSecretCiphertextResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetKMSSecretCiphertextResult, error) {
args := v.(GetKMSSecretCiphertextArgs)
r, err := GetKMSSecretCiphertext(ctx, &args, opts...)
return *r, err
}).(GetKMSSecretCiphertextResultOutput)
}
// A collection of arguments for invoking getKMSSecretCiphertext.
type GetKMSSecretCiphertextOutputArgs struct {
// The id of the CryptoKey that will be used to
// encrypt the provided plaintext. This is represented by the format
// `{projectId}/{location}/{keyRingName}/{cryptoKeyName}`.
CryptoKey pulumi.StringInput `pulumi:"cryptoKey"`
// The plaintext to be encrypted
Plaintext pulumi.StringInput `pulumi:"plaintext"`
}
func (GetKMSSecretCiphertextOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetKMSSecretCiphertextArgs)(nil)).Elem()
}
// A collection of values returned by getKMSSecretCiphertext.
type GetKMSSecretCiphertextResultOutput struct{ *pulumi.OutputState }
func (GetKMSSecretCiphertextResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetKMSSecretCiphertextResult)(nil)).Elem()
}
func (o GetKMSSecretCiphertextResultOutput) ToGetKMSSecretCiphertextResultOutput() GetKMSSecretCiphertextResultOutput {
return o
}
func (o GetKMSSecretCiphertextResultOutput) ToGetKMSSecretCiphertextResultOutputWithContext(ctx context.Context) GetKMSSecretCiphertextResultOutput {
return o
}
// Contains the result of encrypting the provided plaintext, encoded in base64.
func (o GetKMSSecretCiphertextResultOutput) Ciphertext() pulumi.StringOutput {
return o.ApplyT(func(v GetKMSSecretCiphertextResult) string { return v.Ciphertext }).(pulumi.StringOutput)
}
func (o GetKMSSecretCiphertextResultOutput) CryptoKey() pulumi.StringOutput {
return o.ApplyT(func(v GetKMSSecretCiphertextResult) string { return v.CryptoKey }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetKMSSecretCiphertextResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetKMSSecretCiphertextResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetKMSSecretCiphertextResultOutput) Plaintext() pulumi.StringOutput {
return o.ApplyT(func(v GetKMSSecretCiphertextResult) string { return v.Plaintext }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetKMSSecretCiphertextResultOutput{})
}