Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.kms.getKeyVersions
Explore with Pulumi AI
This data source provides a list of KMS KeyVersions in an Alibaba Cloud account according to the specified filters.
NOTE: Available in v1.85.0+
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
// Declare the data source
const alicloudKmsKeyVersionsDs = alicloud.kms.getKeyVersions({
keyId: "08438c-b4d5-4d05-928c-07b7xxxx",
ids: ["d89e8a53-b708-41aa-8c67-6873axxx"],
});
export const allVersions = alicloudKmsKeyVersionsDs.then(alicloudKmsKeyVersionsDs => alicloudKmsKeyVersionsDs.versions);
import pulumi
import pulumi_alicloud as alicloud
# Declare the data source
alicloud_kms_key_versions_ds = alicloud.kms.get_key_versions(key_id="08438c-b4d5-4d05-928c-07b7xxxx",
ids=["d89e8a53-b708-41aa-8c67-6873axxx"])
pulumi.export("allVersions", alicloud_kms_key_versions_ds.versions)
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 {
// Declare the data source
alicloudKmsKeyVersionsDs, err := kms.GetKeyVersions(ctx, &kms.GetKeyVersionsArgs{
KeyId: "08438c-b4d5-4d05-928c-07b7xxxx",
Ids: []string{
"d89e8a53-b708-41aa-8c67-6873axxx",
},
}, nil)
if err != nil {
return err
}
ctx.Export("allVersions", alicloudKmsKeyVersionsDs.Versions)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
// Declare the data source
var alicloudKmsKeyVersionsDs = AliCloud.Kms.GetKeyVersions.Invoke(new()
{
KeyId = "08438c-b4d5-4d05-928c-07b7xxxx",
Ids = new[]
{
"d89e8a53-b708-41aa-8c67-6873axxx",
},
});
return new Dictionary<string, object?>
{
["allVersions"] = alicloudKmsKeyVersionsDs.Apply(getKeyVersionsResult => getKeyVersionsResult.Versions),
};
});
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.GetKeyVersionsArgs;
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) {
// Declare the data source
final var alicloudKmsKeyVersionsDs = KmsFunctions.getKeyVersions(GetKeyVersionsArgs.builder()
.keyId("08438c-b4d5-4d05-928c-07b7xxxx")
.ids("d89e8a53-b708-41aa-8c67-6873axxx")
.build());
ctx.export("allVersions", alicloudKmsKeyVersionsDs.applyValue(getKeyVersionsResult -> getKeyVersionsResult.versions()));
}
}
variables:
# Declare the data source
alicloudKmsKeyVersionsDs:
fn::invoke:
Function: alicloud:kms:getKeyVersions
Arguments:
keyId: 08438c-b4d5-4d05-928c-07b7xxxx
ids:
- d89e8a53-b708-41aa-8c67-6873axxx
outputs:
allVersions: ${alicloudKmsKeyVersionsDs.versions}
Using getKeyVersions
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 getKeyVersions(args: GetKeyVersionsArgs, opts?: InvokeOptions): Promise<GetKeyVersionsResult>
function getKeyVersionsOutput(args: GetKeyVersionsOutputArgs, opts?: InvokeOptions): Output<GetKeyVersionsResult>
def get_key_versions(ids: Optional[Sequence[str]] = None,
key_id: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetKeyVersionsResult
def get_key_versions_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
key_id: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetKeyVersionsResult]
func GetKeyVersions(ctx *Context, args *GetKeyVersionsArgs, opts ...InvokeOption) (*GetKeyVersionsResult, error)
func GetKeyVersionsOutput(ctx *Context, args *GetKeyVersionsOutputArgs, opts ...InvokeOption) GetKeyVersionsResultOutput
> Note: This function is named GetKeyVersions
in the Go SDK.
public static class GetKeyVersions
{
public static Task<GetKeyVersionsResult> InvokeAsync(GetKeyVersionsArgs args, InvokeOptions? opts = null)
public static Output<GetKeyVersionsResult> Invoke(GetKeyVersionsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetKeyVersionsResult> getKeyVersions(GetKeyVersionsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:kms/getKeyVersions:getKeyVersions
arguments:
# arguments dictionary
The following arguments are supported:
- Key
Id string - The id of kms key.
- Ids List<string>
- A list of KMS KeyVersion IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Key
Id string - The id of kms key.
- Ids []string
- A list of KMS KeyVersion IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- key
Id String - The id of kms key.
- ids List<String>
- A list of KMS KeyVersion IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- key
Id string - The id of kms key.
- ids string[]
- A list of KMS KeyVersion IDs.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- key_
id str - The id of kms key.
- ids Sequence[str]
- A list of KMS KeyVersion IDs.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- key
Id String - The id of kms key.
- ids List<String>
- A list of KMS KeyVersion IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getKeyVersions 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 KeyVersion IDs.
- Key
Id string - ID of the key.
- Versions
List<Pulumi.
Ali Cloud. Kms. Outputs. Get Key Versions Version> - A list of KMS KeyVersions. Each element contains the following attributes:
- Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of KMS KeyVersion IDs.
- Key
Id string - ID of the key.
- Versions
[]Get
Key Versions Version - A list of KMS KeyVersions. Each element contains the following attributes:
- Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of KMS KeyVersion IDs.
- key
Id String - ID of the key.
- versions
List<Get
Key Versions Version> - A list of KMS KeyVersions. Each element contains the following attributes:
- output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of KMS KeyVersion IDs.
- key
Id string - ID of the key.
- versions
Get
Key Versions Version[] - A list of KMS KeyVersions. Each element contains the following attributes:
- output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of KMS KeyVersion IDs.
- key_
id str - ID of the key.
- versions
Sequence[Get
Key Versions Version] - A list of KMS KeyVersions. Each element contains the following attributes:
- output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of KMS KeyVersion IDs.
- key
Id String - ID of the key.
- versions List<Property Map>
- A list of KMS KeyVersions. Each element contains the following attributes:
- output
File String
Supporting Types
GetKeyVersionsVersion
- Create
Time string - Date and time when the key version was created (UTC time).
- Creation
Date string - (Removed from v1.124.4) It has been removed and using
create_time
instead. - Id string
- ID of the KMS KeyVersion resource.
- Key
Id string - The id of kms key.
- Key
Version stringId - ID of the key version.
- Create
Time string - Date and time when the key version was created (UTC time).
- Creation
Date string - (Removed from v1.124.4) It has been removed and using
create_time
instead. - Id string
- ID of the KMS KeyVersion resource.
- Key
Id string - The id of kms key.
- Key
Version stringId - ID of the key version.
- create
Time String - Date and time when the key version was created (UTC time).
- creation
Date String - (Removed from v1.124.4) It has been removed and using
create_time
instead. - id String
- ID of the KMS KeyVersion resource.
- key
Id String - The id of kms key.
- key
Version StringId - ID of the key version.
- create
Time string - Date and time when the key version was created (UTC time).
- creation
Date string - (Removed from v1.124.4) It has been removed and using
create_time
instead. - id string
- ID of the KMS KeyVersion resource.
- key
Id string - The id of kms key.
- key
Version stringId - ID of the key version.
- create_
time str - Date and time when the key version was created (UTC time).
- creation_
date str - (Removed from v1.124.4) It has been removed and using
create_time
instead. - id str
- ID of the KMS KeyVersion resource.
- key_
id str - The id of kms key.
- key_
version_ strid - ID of the key version.
- create
Time String - Date and time when the key version was created (UTC time).
- creation
Date String - (Removed from v1.124.4) It has been removed and using
create_time
instead. - id String
- ID of the KMS KeyVersion resource.
- key
Id String - The id of kms key.
- key
Version StringId - ID of the key version.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.