ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud
ibm.getKmsKeys
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const test = ibm.getKmsKeys({
instanceId: "guid-of-keyprotect-or hs-crypto-instance",
limit: 100,
});
const smart_us_south = new ibm.CosBucket("smart-us-south", {
bucketName: "atest-bucket",
resourceInstanceId: "cos-instance-id",
regionLocation: "us-south",
storageClass: "smart",
kmsKeyCrn: test.then(test => test.keys?.[0]?.crn),
});
import pulumi
import pulumi_ibm as ibm
test = ibm.get_kms_keys(instance_id="guid-of-keyprotect-or hs-crypto-instance",
limit=100)
smart_us_south = ibm.CosBucket("smart-us-south",
bucket_name="atest-bucket",
resource_instance_id="cos-instance-id",
region_location="us-south",
storage_class="smart",
kms_key_crn=test.keys[0].crn)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := ibm.GetKmsKeys(ctx, &ibm.GetKmsKeysArgs{
InstanceId: "guid-of-keyprotect-or hs-crypto-instance",
Limit: pulumi.Float64Ref(100),
}, nil)
if err != nil {
return err
}
_, err = ibm.NewCosBucket(ctx, "smart-us-south", &ibm.CosBucketArgs{
BucketName: pulumi.String("atest-bucket"),
ResourceInstanceId: pulumi.String("cos-instance-id"),
RegionLocation: pulumi.String("us-south"),
StorageClass: pulumi.String("smart"),
KmsKeyCrn: pulumi.String(test.Keys[0].Crn),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var test = Ibm.GetKmsKeys.Invoke(new()
{
InstanceId = "guid-of-keyprotect-or hs-crypto-instance",
Limit = 100,
});
var smart_us_south = new Ibm.CosBucket("smart-us-south", new()
{
BucketName = "atest-bucket",
ResourceInstanceId = "cos-instance-id",
RegionLocation = "us-south",
StorageClass = "smart",
KmsKeyCrn = test.Apply(getKmsKeysResult => getKmsKeysResult.Keys[0]?.Crn),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.IbmFunctions;
import com.pulumi.ibm.inputs.GetKmsKeysArgs;
import com.pulumi.ibm.CosBucket;
import com.pulumi.ibm.CosBucketArgs;
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 test = IbmFunctions.getKmsKeys(GetKmsKeysArgs.builder()
.instanceId("guid-of-keyprotect-or hs-crypto-instance")
.limit(100)
.build());
var smart_us_south = new CosBucket("smart-us-south", CosBucketArgs.builder()
.bucketName("atest-bucket")
.resourceInstanceId("cos-instance-id")
.regionLocation("us-south")
.storageClass("smart")
.kmsKeyCrn(test.applyValue(getKmsKeysResult -> getKmsKeysResult.keys()[0].crn()))
.build());
}
}
resources:
smart-us-south:
type: ibm:CosBucket
properties:
bucketName: atest-bucket
resourceInstanceId: cos-instance-id
regionLocation: us-south
storageClass: smart
kmsKeyCrn: ${test.keys[0].crn}
variables:
test:
fn::invoke:
function: ibm:getKmsKeys
arguments:
instanceId: guid-of-keyprotect-or hs-crypto-instance
limit: 100
Note:
key_protect
attribute has been renamed as kms_key_crn
, hence it is recommended to all the new users to use kms_key_crn
.Although the support for older attribute name key_protect
will be continued for existing customers.
Using getKmsKeys
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 getKmsKeys(args: GetKmsKeysArgs, opts?: InvokeOptions): Promise<GetKmsKeysResult>
function getKmsKeysOutput(args: GetKmsKeysOutputArgs, opts?: InvokeOptions): Output<GetKmsKeysResult>
def get_kms_keys(alias: Optional[str] = None,
endpoint_type: Optional[str] = None,
id: Optional[str] = None,
instance_id: Optional[str] = None,
key_id: Optional[str] = None,
key_name: Optional[str] = None,
limit: Optional[float] = None,
opts: Optional[InvokeOptions] = None) -> GetKmsKeysResult
def get_kms_keys_output(alias: Optional[pulumi.Input[str]] = None,
endpoint_type: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
instance_id: Optional[pulumi.Input[str]] = None,
key_id: Optional[pulumi.Input[str]] = None,
key_name: Optional[pulumi.Input[str]] = None,
limit: Optional[pulumi.Input[float]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetKmsKeysResult]
func GetKmsKeys(ctx *Context, args *GetKmsKeysArgs, opts ...InvokeOption) (*GetKmsKeysResult, error)
func GetKmsKeysOutput(ctx *Context, args *GetKmsKeysOutputArgs, opts ...InvokeOption) GetKmsKeysResultOutput
> Note: This function is named GetKmsKeys
in the Go SDK.
public static class GetKmsKeys
{
public static Task<GetKmsKeysResult> InvokeAsync(GetKmsKeysArgs args, InvokeOptions? opts = null)
public static Output<GetKmsKeysResult> Invoke(GetKmsKeysInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetKmsKeysResult> getKmsKeys(GetKmsKeysArgs args, InvokeOptions options)
public static Output<GetKmsKeysResult> getKmsKeys(GetKmsKeysArgs args, InvokeOptions options)
fn::invoke:
function: ibm:index/getKmsKeys:getKmsKeys
arguments:
# arguments dictionary
The following arguments are supported:
- Instance
Id string - The key-protect instance ID.
- Alias string
- The alias of the key.
- Endpoint
Type string - The type of the public or private endpoint to be used for fetching keys.
- Id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- Key
Id string - The keyID of the key to be fetched.
- Key
Name string - The name of the key. Only matching name of the keys are retrieved.
- Limit double
- The limit till the keys need to be fetched in the instance.
- Instance
Id string - The key-protect instance ID.
- Alias string
- The alias of the key.
- Endpoint
Type string - The type of the public or private endpoint to be used for fetching keys.
- Id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- Key
Id string - The keyID of the key to be fetched.
- Key
Name string - The name of the key. Only matching name of the keys are retrieved.
- Limit float64
- The limit till the keys need to be fetched in the instance.
- instance
Id String - The key-protect instance ID.
- alias String
- The alias of the key.
- endpoint
Type String - The type of the public or private endpoint to be used for fetching keys.
- id String
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- key
Id String - The keyID of the key to be fetched.
- key
Name String - The name of the key. Only matching name of the keys are retrieved.
- limit Double
- The limit till the keys need to be fetched in the instance.
- instance
Id string - The key-protect instance ID.
- alias string
- The alias of the key.
- endpoint
Type string - The type of the public or private endpoint to be used for fetching keys.
- id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- key
Id string - The keyID of the key to be fetched.
- key
Name string - The name of the key. Only matching name of the keys are retrieved.
- limit number
- The limit till the keys need to be fetched in the instance.
- instance_
id str - The key-protect instance ID.
- alias str
- The alias of the key.
- endpoint_
type str - The type of the public or private endpoint to be used for fetching keys.
- id str
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- key_
id str - The keyID of the key to be fetched.
- key_
name str - The name of the key. Only matching name of the keys are retrieved.
- limit float
- The limit till the keys need to be fetched in the instance.
- instance
Id String - The key-protect instance ID.
- alias String
- The alias of the key.
- endpoint
Type String - The type of the public or private endpoint to be used for fetching keys.
- id String
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- key
Id String - The keyID of the key to be fetched.
- key
Name String - The name of the key. Only matching name of the keys are retrieved.
- limit Number
- The limit till the keys need to be fetched in the instance.
getKmsKeys Result
The following output properties are available:
- Id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- Instance
Id string - Keys
List<Get
Kms Keys Key> - (String) Lists the Keys of HPCS or Key-protect instance.
- Alias string
- Endpoint
Type string - Key
Id string - Key
Name string - Limit double
- Id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- Instance
Id string - Keys
[]Get
Kms Keys Key - (String) Lists the Keys of HPCS or Key-protect instance.
- Alias string
- Endpoint
Type string - Key
Id string - Key
Name string - Limit float64
- id String
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- instance
Id String - keys
List<Get
Kms Keys Key> - (String) Lists the Keys of HPCS or Key-protect instance.
- alias String
- endpoint
Type String - key
Id String - key
Name String - limit Double
- id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- instance
Id string - keys
Get
Kms Keys Key[] - (String) Lists the Keys of HPCS or Key-protect instance.
- alias string
- endpoint
Type string - key
Id string - key
Name string - limit number
- id str
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- instance_
id str - keys
Sequence[Get
Kms Keys Key] - (String) Lists the Keys of HPCS or Key-protect instance.
- alias str
- endpoint_
type str - key_
id str - key_
name str - limit float
- id String
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- instance
Id String - keys List<Property Map>
- (String) Lists the Keys of HPCS or Key-protect instance.
- alias String
- endpoint
Type String - key
Id String - key
Name String - limit Number
Supporting Types
GetKmsKeysKey
- Aliases List<string>
- (String) A list of alias names that are assigned to the key.
- Crn string
- (String) The CRN of the key.
- Description string
- Id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- Key
Ring stringId - (String) The ID of the key ring that the key belongs to.
- Name string
- (String) The name for the key.
- Policies
List<Get
Kms Keys Key Policy> - Standard
Key bool - (String) Set the flag true for standard key, and false for root key. Default value is false.
- Aliases []string
- (String) A list of alias names that are assigned to the key.
- Crn string
- (String) The CRN of the key.
- Description string
- Id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- Key
Ring stringId - (String) The ID of the key ring that the key belongs to.
- Name string
- (String) The name for the key.
- Policies
[]Get
Kms Keys Key Policy - Standard
Key bool - (String) Set the flag true for standard key, and false for root key. Default value is false.
- aliases List<String>
- (String) A list of alias names that are assigned to the key.
- crn String
- (String) The CRN of the key.
- description String
- id String
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- key
Ring StringId - (String) The ID of the key ring that the key belongs to.
- name String
- (String) The name for the key.
- policies
List<Get
Kms Keys Key Policy> - standard
Key Boolean - (String) Set the flag true for standard key, and false for root key. Default value is false.
- aliases string[]
- (String) A list of alias names that are assigned to the key.
- crn string
- (String) The CRN of the key.
- description string
- id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- key
Ring stringId - (String) The ID of the key ring that the key belongs to.
- name string
- (String) The name for the key.
- policies
Get
Kms Keys Key Policy[] - standard
Key boolean - (String) Set the flag true for standard key, and false for root key. Default value is false.
- aliases Sequence[str]
- (String) A list of alias names that are assigned to the key.
- crn str
- (String) The CRN of the key.
- description str
- id str
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- key_
ring_ strid - (String) The ID of the key ring that the key belongs to.
- name str
- (String) The name for the key.
- policies
Sequence[Get
Kms Keys Key Policy] - standard_
key bool - (String) Set the flag true for standard key, and false for root key. Default value is false.
- aliases List<String>
- (String) A list of alias names that are assigned to the key.
- crn String
- (String) The CRN of the key.
- description String
- id String
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- key
Ring StringId - (String) The ID of the key ring that the key belongs to.
- name String
- (String) The name for the key.
- policies List<Property Map>
- standard
Key Boolean - (String) Set the flag true for standard key, and false for root key. Default value is false.
GetKmsKeysKeyPolicy
- Dual
Auth List<GetDeletes Kms Keys Key Policy Dual Auth Delete> - (String) The data associated with the dual authorization delete policy.
- Rotations
List<Get
Kms Keys Key Policy Rotation> - (String) The key rotation time interval in months, with a minimum of 1, and a maximum of 12.
- Dual
Auth []GetDeletes Kms Keys Key Policy Dual Auth Delete - (String) The data associated with the dual authorization delete policy.
- Rotations
[]Get
Kms Keys Key Policy Rotation - (String) The key rotation time interval in months, with a minimum of 1, and a maximum of 12.
- dual
Auth List<GetDeletes Kms Keys Key Policy Dual Auth Delete> - (String) The data associated with the dual authorization delete policy.
- rotations
List<Get
Kms Keys Key Policy Rotation> - (String) The key rotation time interval in months, with a minimum of 1, and a maximum of 12.
- dual
Auth GetDeletes Kms Keys Key Policy Dual Auth Delete[] - (String) The data associated with the dual authorization delete policy.
- rotations
Get
Kms Keys Key Policy Rotation[] - (String) The key rotation time interval in months, with a minimum of 1, and a maximum of 12.
- dual_
auth_ Sequence[Getdeletes Kms Keys Key Policy Dual Auth Delete] - (String) The data associated with the dual authorization delete policy.
- rotations
Sequence[Get
Kms Keys Key Policy Rotation] - (String) The key rotation time interval in months, with a minimum of 1, and a maximum of 12.
- dual
Auth List<Property Map>Deletes - (String) The data associated with the dual authorization delete policy.
- rotations List<Property Map>
- (String) The key rotation time interval in months, with a minimum of 1, and a maximum of 12.
GetKmsKeysKeyPolicyDualAuthDelete
- Created
By string - (String) The unique ID for the resource that created the policy.
- Creation
Date string - (Timestamp) The date the policy was created. The date format follows RFC 3339.
- Crn string
- (String) The CRN of the key.
- Enabled bool
- (String) If set to true, Key Protect enables a dual authorization policy on the key.
- Id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- Last
Update stringDate - (Timestamp) The date when the policy last replaced or modified. The date format follows RFC 3339.
- Updated
By string - (String) The unique ID for the resource that updated the policy.
- Created
By string - (String) The unique ID for the resource that created the policy.
- Creation
Date string - (Timestamp) The date the policy was created. The date format follows RFC 3339.
- Crn string
- (String) The CRN of the key.
- Enabled bool
- (String) If set to true, Key Protect enables a dual authorization policy on the key.
- Id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- Last
Update stringDate - (Timestamp) The date when the policy last replaced or modified. The date format follows RFC 3339.
- Updated
By string - (String) The unique ID for the resource that updated the policy.
- created
By String - (String) The unique ID for the resource that created the policy.
- creation
Date String - (Timestamp) The date the policy was created. The date format follows RFC 3339.
- crn String
- (String) The CRN of the key.
- enabled Boolean
- (String) If set to true, Key Protect enables a dual authorization policy on the key.
- id String
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- last
Update StringDate - (Timestamp) The date when the policy last replaced or modified. The date format follows RFC 3339.
- updated
By String - (String) The unique ID for the resource that updated the policy.
- created
By string - (String) The unique ID for the resource that created the policy.
- creation
Date string - (Timestamp) The date the policy was created. The date format follows RFC 3339.
- crn string
- (String) The CRN of the key.
- enabled boolean
- (String) If set to true, Key Protect enables a dual authorization policy on the key.
- id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- last
Update stringDate - (Timestamp) The date when the policy last replaced or modified. The date format follows RFC 3339.
- updated
By string - (String) The unique ID for the resource that updated the policy.
- created_
by str - (String) The unique ID for the resource that created the policy.
- creation_
date str - (Timestamp) The date the policy was created. The date format follows RFC 3339.
- crn str
- (String) The CRN of the key.
- enabled bool
- (String) If set to true, Key Protect enables a dual authorization policy on the key.
- id str
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- last_
update_ strdate - (Timestamp) The date when the policy last replaced or modified. The date format follows RFC 3339.
- updated_
by str - (String) The unique ID for the resource that updated the policy.
- created
By String - (String) The unique ID for the resource that created the policy.
- creation
Date String - (Timestamp) The date the policy was created. The date format follows RFC 3339.
- crn String
- (String) The CRN of the key.
- enabled Boolean
- (String) If set to true, Key Protect enables a dual authorization policy on the key.
- id String
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- last
Update StringDate - (Timestamp) The date when the policy last replaced or modified. The date format follows RFC 3339.
- updated
By String - (String) The unique ID for the resource that updated the policy.
GetKmsKeysKeyPolicyRotation
- Created
By string - (String) The unique ID for the resource that created the policy.
- Creation
Date string - (Timestamp) The date the policy was created. The date format follows RFC 3339.
- Crn string
- (String) The CRN of the key.
- Enabled bool
- (String) If set to true, Key Protect enables a dual authorization policy on the key.
- Id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- Interval
Month double - (String) The key rotation time interval in months.
- Last
Update stringDate - (Timestamp) The date when the policy last replaced or modified. The date format follows RFC 3339.
- Updated
By string - (String) The unique ID for the resource that updated the policy.
- Created
By string - (String) The unique ID for the resource that created the policy.
- Creation
Date string - (Timestamp) The date the policy was created. The date format follows RFC 3339.
- Crn string
- (String) The CRN of the key.
- Enabled bool
- (String) If set to true, Key Protect enables a dual authorization policy on the key.
- Id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- Interval
Month float64 - (String) The key rotation time interval in months.
- Last
Update stringDate - (Timestamp) The date when the policy last replaced or modified. The date format follows RFC 3339.
- Updated
By string - (String) The unique ID for the resource that updated the policy.
- created
By String - (String) The unique ID for the resource that created the policy.
- creation
Date String - (Timestamp) The date the policy was created. The date format follows RFC 3339.
- crn String
- (String) The CRN of the key.
- enabled Boolean
- (String) If set to true, Key Protect enables a dual authorization policy on the key.
- id String
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- interval
Month Double - (String) The key rotation time interval in months.
- last
Update StringDate - (Timestamp) The date when the policy last replaced or modified. The date format follows RFC 3339.
- updated
By String - (String) The unique ID for the resource that updated the policy.
- created
By string - (String) The unique ID for the resource that created the policy.
- creation
Date string - (Timestamp) The date the policy was created. The date format follows RFC 3339.
- crn string
- (String) The CRN of the key.
- enabled boolean
- (String) If set to true, Key Protect enables a dual authorization policy on the key.
- id string
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- interval
Month number - (String) The key rotation time interval in months.
- last
Update stringDate - (Timestamp) The date when the policy last replaced or modified. The date format follows RFC 3339.
- updated
By string - (String) The unique ID for the resource that updated the policy.
- created_
by str - (String) The unique ID for the resource that created the policy.
- creation_
date str - (Timestamp) The date the policy was created. The date format follows RFC 3339.
- crn str
- (String) The CRN of the key.
- enabled bool
- (String) If set to true, Key Protect enables a dual authorization policy on the key.
- id str
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- interval_
month float - (String) The key rotation time interval in months.
- last_
update_ strdate - (Timestamp) The date when the policy last replaced or modified. The date format follows RFC 3339.
- updated_
by str - (String) The unique ID for the resource that updated the policy.
- created
By String - (String) The unique ID for the resource that created the policy.
- creation
Date String - (Timestamp) The date the policy was created. The date format follows RFC 3339.
- crn String
- (String) The CRN of the key.
- enabled Boolean
- (String) If set to true, Key Protect enables a dual authorization policy on the key.
- id String
- (String) The v4 UUID is used to uniquely identify the policy resource, as specified by RFC 4122.
- interval
Month Number - (String) The key rotation time interval in months.
- last
Update StringDate - (Timestamp) The date when the policy last replaced or modified. The date format follows RFC 3339.
- updated
By String - (String) The unique ID for the resource that updated the policy.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.