alicloud.kms.getSecretVersions
Explore with Pulumi AI
This data source provides a list of KMS Secret Versions in an Alibaba Cloud account according to the specified filters.
NOTE: Available in v1.88.0+.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var kmsSecretVersionsDs = AliCloud.Kms.GetSecretVersions.Invoke(new()
{
EnableDetails = true,
SecretName = "secret_name",
});
return new Dictionary<string, object?>
{
["firstSecretData"] = kmsSecretVersionsDs.Apply(getSecretVersionsResult => getSecretVersionsResult.Versions[0]?.SecretData),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/kms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
kmsSecretVersionsDs, err := kms.GetSecretVersions(ctx, &kms.GetSecretVersionsArgs{
EnableDetails: pulumi.BoolRef(true),
SecretName: "secret_name",
}, nil)
if err != nil {
return err
}
ctx.Export("firstSecretData", kmsSecretVersionsDs.Versions[0].SecretData)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.kms.KmsFunctions;
import com.pulumi.alicloud.kms.inputs.GetSecretVersionsArgs;
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 kmsSecretVersionsDs = KmsFunctions.getSecretVersions(GetSecretVersionsArgs.builder()
.enableDetails(true)
.secretName("secret_name")
.build());
ctx.export("firstSecretData", kmsSecretVersionsDs.applyValue(getSecretVersionsResult -> getSecretVersionsResult.versions()[0].secretData()));
}
}
import pulumi
import pulumi_alicloud as alicloud
kms_secret_versions_ds = alicloud.kms.get_secret_versions(enable_details=True,
secret_name="secret_name")
pulumi.export("firstSecretData", kms_secret_versions_ds.versions[0].secret_data)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const kmsSecretVersionsDs = alicloud.kms.getSecretVersions({
enableDetails: true,
secretName: "secret_name",
});
export const firstSecretData = kmsSecretVersionsDs.then(kmsSecretVersionsDs => kmsSecretVersionsDs.versions?.[0]?.secretData);
variables:
kmsSecretVersionsDs:
fn::invoke:
Function: alicloud:kms:getSecretVersions
Arguments:
enableDetails: true
secretName: secret_name
outputs:
firstSecretData: ${kmsSecretVersionsDs.versions[0].secretData}
Using getSecretVersions
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getSecretVersions(args: GetSecretVersionsArgs, opts?: InvokeOptions): Promise<GetSecretVersionsResult>
function getSecretVersionsOutput(args: GetSecretVersionsOutputArgs, opts?: InvokeOptions): Output<GetSecretVersionsResult>
def get_secret_versions(enable_details: Optional[bool] = None,
ids: Optional[Sequence[str]] = None,
include_deprecated: Optional[str] = None,
output_file: Optional[str] = None,
secret_name: Optional[str] = None,
version_stage: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSecretVersionsResult
def get_secret_versions_output(enable_details: Optional[pulumi.Input[bool]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
include_deprecated: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
secret_name: Optional[pulumi.Input[str]] = None,
version_stage: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSecretVersionsResult]
func GetSecretVersions(ctx *Context, args *GetSecretVersionsArgs, opts ...InvokeOption) (*GetSecretVersionsResult, error)
func GetSecretVersionsOutput(ctx *Context, args *GetSecretVersionsOutputArgs, opts ...InvokeOption) GetSecretVersionsResultOutput
> Note: This function is named GetSecretVersions
in the Go SDK.
public static class GetSecretVersions
{
public static Task<GetSecretVersionsResult> InvokeAsync(GetSecretVersionsArgs args, InvokeOptions? opts = null)
public static Output<GetSecretVersionsResult> Invoke(GetSecretVersionsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSecretVersionsResult> getSecretVersions(GetSecretVersionsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:kms/getSecretVersions:getSecretVersions
arguments:
# arguments dictionary
The following arguments are supported:
- Secret
Name string The name of the secret.
- Enable
Details bool Default to false and only output
secret_name
,version_id
,version_stages
. Set it to true can output more details.- Ids List<string>
A list of KMS Secret Version ids.
- Include
Deprecated string Specifies whether to return deprecated secret versions. Default to
false
.- Output
File string File name where to save data source results (after running
pulumi preview
).- Version
Stage string The stage of the secret version.
- Secret
Name string The name of the secret.
- Enable
Details bool Default to false and only output
secret_name
,version_id
,version_stages
. Set it to true can output more details.- Ids []string
A list of KMS Secret Version ids.
- Include
Deprecated string Specifies whether to return deprecated secret versions. Default to
false
.- Output
File string File name where to save data source results (after running
pulumi preview
).- Version
Stage string The stage of the secret version.
- secret
Name String The name of the secret.
- enable
Details Boolean Default to false and only output
secret_name
,version_id
,version_stages
. Set it to true can output more details.- ids List<String>
A list of KMS Secret Version ids.
- include
Deprecated String Specifies whether to return deprecated secret versions. Default to
false
.- output
File String File name where to save data source results (after running
pulumi preview
).- version
Stage String The stage of the secret version.
- secret
Name string The name of the secret.
- enable
Details boolean Default to false and only output
secret_name
,version_id
,version_stages
. Set it to true can output more details.- ids string[]
A list of KMS Secret Version ids.
- include
Deprecated string Specifies whether to return deprecated secret versions. Default to
false
.- output
File string File name where to save data source results (after running
pulumi preview
).- version
Stage string The stage of the secret version.
- secret_
name str The name of the secret.
- enable_
details bool Default to false and only output
secret_name
,version_id
,version_stages
. Set it to true can output more details.- ids Sequence[str]
A list of KMS Secret Version ids.
- include_
deprecated str Specifies whether to return deprecated secret versions. Default to
false
.- output_
file str File name where to save data source results (after running
pulumi preview
).- version_
stage str The stage of the secret version.
- secret
Name String The name of the secret.
- enable
Details Boolean Default to false and only output
secret_name
,version_id
,version_stages
. Set it to true can output more details.- ids List<String>
A list of KMS Secret Version ids.
- include
Deprecated String Specifies whether to return deprecated secret versions. Default to
false
.- output
File String File name where to save data source results (after running
pulumi preview
).- version
Stage String The stage of the secret version.
getSecretVersions Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
A list of Kms Secret Version ids.
- Secret
Name string The name of the secret.
- Versions
List<Pulumi.
Ali Cloud. Kms. Outputs. Get Secret Versions Version> A list of KMS Secret Versions. Each element contains the following attributes:
- Enable
Details bool - Include
Deprecated string - Output
File string - Version
Stage string
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
A list of Kms Secret Version ids.
- Secret
Name string The name of the secret.
- Versions
[]Get
Secret Versions Version A list of KMS Secret Versions. Each element contains the following attributes:
- Enable
Details bool - Include
Deprecated string - Output
File string - Version
Stage string
- id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
A list of Kms Secret Version ids.
- secret
Name String The name of the secret.
- versions
List<Get
Secret Versions Version> A list of KMS Secret Versions. Each element contains the following attributes:
- enable
Details Boolean - include
Deprecated String - output
File String - version
Stage String
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
A list of Kms Secret Version ids.
- secret
Name string The name of the secret.
- versions
Get
Secret Versions Version[] A list of KMS Secret Versions. Each element contains the following attributes:
- enable
Details boolean - include
Deprecated string - output
File string - version
Stage string
- id str
The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
A list of Kms Secret Version ids.
- secret_
name str The name of the secret.
- versions
Sequence[Get
Secret Versions Version] A list of KMS Secret Versions. Each element contains the following attributes:
- enable_
details bool - include_
deprecated str - output_
file str - version_
stage str
- id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
A list of Kms Secret Version ids.
- secret
Name String The name of the secret.
- versions List<Property Map>
A list of KMS Secret Versions. Each element contains the following attributes:
- enable
Details Boolean - include
Deprecated String - output
File String - version
Stage String
Supporting Types
GetSecretVersionsVersion
- Secret
Data string The secret value. Secrets Manager decrypts the stored secret value in ciphertext and returns it. (Returned when
enable_details
is true).- Secret
Data stringType The type of the secret value. (Returned when
enable_details
is true).- Secret
Name string The name of the secret.
- Version
Id string The version number of the secret value.
- Version
Stages List<string> Stage labels that mark the secret version.
- Secret
Data string The secret value. Secrets Manager decrypts the stored secret value in ciphertext and returns it. (Returned when
enable_details
is true).- Secret
Data stringType The type of the secret value. (Returned when
enable_details
is true).- Secret
Name string The name of the secret.
- Version
Id string The version number of the secret value.
- Version
Stages []string Stage labels that mark the secret version.
- secret
Data String The secret value. Secrets Manager decrypts the stored secret value in ciphertext and returns it. (Returned when
enable_details
is true).- secret
Data StringType The type of the secret value. (Returned when
enable_details
is true).- secret
Name String The name of the secret.
- version
Id String The version number of the secret value.
- version
Stages List<String> Stage labels that mark the secret version.
- secret
Data string The secret value. Secrets Manager decrypts the stored secret value in ciphertext and returns it. (Returned when
enable_details
is true).- secret
Data stringType The type of the secret value. (Returned when
enable_details
is true).- secret
Name string The name of the secret.
- version
Id string The version number of the secret value.
- version
Stages string[] Stage labels that mark the secret version.
- secret_
data str The secret value. Secrets Manager decrypts the stored secret value in ciphertext and returns it. (Returned when
enable_details
is true).- secret_
data_ strtype The type of the secret value. (Returned when
enable_details
is true).- secret_
name str The name of the secret.
- version_
id str The version number of the secret value.
- version_
stages Sequence[str] Stage labels that mark the secret version.
- secret
Data String The secret value. Secrets Manager decrypts the stored secret value in ciphertext and returns it. (Returned when
enable_details
is true).- secret
Data StringType The type of the secret value. (Returned when
enable_details
is true).- secret
Name String The name of the secret.
- version
Id String The version number of the secret value.
- version
Stages List<String> Stage labels that mark the secret version.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.