1. Packages
  2. Ibm Provider
  3. API Docs
  4. getKmsKmipObjects
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getKmsKmipObjects

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Example Usage

    Sample example to list KMIP objects in a given adapter

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const kmsInstance = new ibm.ResourceInstance("kmsInstance", {
        service: "kms",
        plan: "tiered-pricing",
        location: "us-south",
    });
    const myadapter = ibm.getKmsKmipAdapter({
        instanceId: ibm_resource_instance.kp_instance.guid,
        name: "myadapter",
    });
    const objectsList = myadapter.then(myadapter => ibm.getKmsKmipObjects({
        instanceId: ibm_resource_instance.kp_instance.guid,
        adapterId: myadapter.id,
        objectStateFilters: [
            1,
            2,
            3,
            4,
        ],
    }));
    
    import pulumi
    import pulumi_ibm as ibm
    
    kms_instance = ibm.ResourceInstance("kmsInstance",
        service="kms",
        plan="tiered-pricing",
        location="us-south")
    myadapter = ibm.get_kms_kmip_adapter(instance_id=ibm_resource_instance["kp_instance"]["guid"],
        name="myadapter")
    objects_list = ibm.get_kms_kmip_objects(instance_id=ibm_resource_instance["kp_instance"]["guid"],
        adapter_id=myadapter.id,
        object_state_filters=[
            1,
            2,
            3,
            4,
        ])
    
    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 {
    		_, err := ibm.NewResourceInstance(ctx, "kmsInstance", &ibm.ResourceInstanceArgs{
    			Service:  pulumi.String("kms"),
    			Plan:     pulumi.String("tiered-pricing"),
    			Location: pulumi.String("us-south"),
    		})
    		if err != nil {
    			return err
    		}
    		myadapter, err := ibm.LookupKmsKmipAdapter(ctx, &ibm.LookupKmsKmipAdapterArgs{
    			InstanceId: ibm_resource_instance.Kp_instance.Guid,
    			Name:       pulumi.StringRef("myadapter"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ibm.GetKmsKmipObjects(ctx, &ibm.GetKmsKmipObjectsArgs{
    			InstanceId: ibm_resource_instance.Kp_instance.Guid,
    			AdapterId:  pulumi.StringRef(myadapter.Id),
    			ObjectStateFilters: []float64{
    				1,
    				2,
    				3,
    				4,
    			},
    		}, nil)
    		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 kmsInstance = new Ibm.ResourceInstance("kmsInstance", new()
        {
            Service = "kms",
            Plan = "tiered-pricing",
            Location = "us-south",
        });
    
        var myadapter = Ibm.GetKmsKmipAdapter.Invoke(new()
        {
            InstanceId = ibm_resource_instance.Kp_instance.Guid,
            Name = "myadapter",
        });
    
        var objectsList = Ibm.GetKmsKmipObjects.Invoke(new()
        {
            InstanceId = ibm_resource_instance.Kp_instance.Guid,
            AdapterId = myadapter.Apply(getKmsKmipAdapterResult => getKmsKmipAdapterResult.Id),
            ObjectStateFilters = new[]
            {
                1,
                2,
                3,
                4,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.ResourceInstance;
    import com.pulumi.ibm.ResourceInstanceArgs;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetKmsKmipAdapterArgs;
    import com.pulumi.ibm.inputs.GetKmsKmipObjectsArgs;
    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) {
            var kmsInstance = new ResourceInstance("kmsInstance", ResourceInstanceArgs.builder()
                .service("kms")
                .plan("tiered-pricing")
                .location("us-south")
                .build());
    
            final var myadapter = IbmFunctions.getKmsKmipAdapter(GetKmsKmipAdapterArgs.builder()
                .instanceId(ibm_resource_instance.kp_instance().guid())
                .name("myadapter")
                .build());
    
            final var objectsList = IbmFunctions.getKmsKmipObjects(GetKmsKmipObjectsArgs.builder()
                .instanceId(ibm_resource_instance.kp_instance().guid())
                .adapterId(myadapter.applyValue(getKmsKmipAdapterResult -> getKmsKmipAdapterResult.id()))
                .objectStateFilters(            
                    1,
                    2,
                    3,
                    4)
                .build());
    
        }
    }
    
    resources:
      kmsInstance:
        type: ibm:ResourceInstance
        properties:
          service: kms
          plan: tiered-pricing
          location: us-south
    variables:
      myadapter:
        fn::invoke:
          function: ibm:getKmsKmipAdapter
          arguments:
            instanceId: ${ibm_resource_instance.kp_instance.guid}
            name: myadapter
      objectsList:
        fn::invoke:
          function: ibm:getKmsKmipObjects
          arguments:
            instanceId: ${ibm_resource_instance.kp_instance.guid}
            adapterId: ${myadapter.id}
            objectStateFilters:
              - 1
              - 2
              - 3
              - 4
    

    Using getKmsKmipObjects

    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 getKmsKmipObjects(args: GetKmsKmipObjectsArgs, opts?: InvokeOptions): Promise<GetKmsKmipObjectsResult>
    function getKmsKmipObjectsOutput(args: GetKmsKmipObjectsOutputArgs, opts?: InvokeOptions): Output<GetKmsKmipObjectsResult>
    def get_kms_kmip_objects(adapter_id: Optional[str] = None,
                             adapter_name: Optional[str] = None,
                             endpoint_type: Optional[str] = None,
                             id: Optional[str] = None,
                             instance_id: Optional[str] = None,
                             limit: Optional[float] = None,
                             object_state_filters: Optional[Sequence[float]] = None,
                             offset: Optional[float] = None,
                             show_total_count: Optional[bool] = None,
                             opts: Optional[InvokeOptions] = None) -> GetKmsKmipObjectsResult
    def get_kms_kmip_objects_output(adapter_id: Optional[pulumi.Input[str]] = None,
                             adapter_name: 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,
                             limit: Optional[pulumi.Input[float]] = None,
                             object_state_filters: Optional[pulumi.Input[Sequence[pulumi.Input[float]]]] = None,
                             offset: Optional[pulumi.Input[float]] = None,
                             show_total_count: Optional[pulumi.Input[bool]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetKmsKmipObjectsResult]
    func GetKmsKmipObjects(ctx *Context, args *GetKmsKmipObjectsArgs, opts ...InvokeOption) (*GetKmsKmipObjectsResult, error)
    func GetKmsKmipObjectsOutput(ctx *Context, args *GetKmsKmipObjectsOutputArgs, opts ...InvokeOption) GetKmsKmipObjectsResultOutput

    > Note: This function is named GetKmsKmipObjects in the Go SDK.

    public static class GetKmsKmipObjects 
    {
        public static Task<GetKmsKmipObjectsResult> InvokeAsync(GetKmsKmipObjectsArgs args, InvokeOptions? opts = null)
        public static Output<GetKmsKmipObjectsResult> Invoke(GetKmsKmipObjectsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKmsKmipObjectsResult> getKmsKmipObjects(GetKmsKmipObjectsArgs args, InvokeOptions options)
    public static Output<GetKmsKmipObjectsResult> getKmsKmipObjects(GetKmsKmipObjectsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getKmsKmipObjects:getKmsKmipObjects
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    The key protect instance GUID.
    AdapterId string
    AdapterName string
    EndpointType string
    The type of the public endpoint, or private endpoint to be used for creating keys.
    Id string
    Limit double
    Limit of how many objects to be fetched.
    ObjectStateFilters List<double>
    A list of integers representing Object States to filter for
    Offset double
    Offset of objects to be fetched.
    ShowTotalCount bool
    Flag to return the count of how many objects there are in total after the filter.
    InstanceId string
    The key protect instance GUID.
    AdapterId string
    AdapterName string
    EndpointType string
    The type of the public endpoint, or private endpoint to be used for creating keys.
    Id string
    Limit float64
    Limit of how many objects to be fetched.
    ObjectStateFilters []float64
    A list of integers representing Object States to filter for
    Offset float64
    Offset of objects to be fetched.
    ShowTotalCount bool
    Flag to return the count of how many objects there are in total after the filter.
    instanceId String
    The key protect instance GUID.
    adapterId String
    adapterName String
    endpointType String
    The type of the public endpoint, or private endpoint to be used for creating keys.
    id String
    limit Double
    Limit of how many objects to be fetched.
    objectStateFilters List<Double>
    A list of integers representing Object States to filter for
    offset Double
    Offset of objects to be fetched.
    showTotalCount Boolean
    Flag to return the count of how many objects there are in total after the filter.
    instanceId string
    The key protect instance GUID.
    adapterId string
    adapterName string
    endpointType string
    The type of the public endpoint, or private endpoint to be used for creating keys.
    id string
    limit number
    Limit of how many objects to be fetched.
    objectStateFilters number[]
    A list of integers representing Object States to filter for
    offset number
    Offset of objects to be fetched.
    showTotalCount boolean
    Flag to return the count of how many objects there are in total after the filter.
    instance_id str
    The key protect instance GUID.
    adapter_id str
    adapter_name str
    endpoint_type str
    The type of the public endpoint, or private endpoint to be used for creating keys.
    id str
    limit float
    Limit of how many objects to be fetched.
    object_state_filters Sequence[float]
    A list of integers representing Object States to filter for
    offset float
    Offset of objects to be fetched.
    show_total_count bool
    Flag to return the count of how many objects there are in total after the filter.
    instanceId String
    The key protect instance GUID.
    adapterId String
    adapterName String
    endpointType String
    The type of the public endpoint, or private endpoint to be used for creating keys.
    id String
    limit Number
    Limit of how many objects to be fetched.
    objectStateFilters List<Number>
    A list of integers representing Object States to filter for
    offset Number
    Offset of objects to be fetched.
    showTotalCount Boolean
    Flag to return the count of how many objects there are in total after the filter.

    getKmsKmipObjects Result

    The following output properties are available:

    AdapterId string
    AdapterName string
    EndpointType string
    Id string
    InstanceId string
    Objects List<GetKmsKmipObjectsObject>
    (List of Objects) The list of KMIP objects in an adapter
    TotalCount double
    (Integer) If show_total_count is true, this will contain the total number of objects after the State Filter
    Limit double
    ObjectStateFilters List<double>
    Offset double
    ShowTotalCount bool
    AdapterId string
    AdapterName string
    EndpointType string
    Id string
    InstanceId string
    Objects []GetKmsKmipObjectsObject
    (List of Objects) The list of KMIP objects in an adapter
    TotalCount float64
    (Integer) If show_total_count is true, this will contain the total number of objects after the State Filter
    Limit float64
    ObjectStateFilters []float64
    Offset float64
    ShowTotalCount bool
    adapterId String
    adapterName String
    endpointType String
    id String
    instanceId String
    objects List<GetKmsKmipObjectsObject>
    (List of Objects) The list of KMIP objects in an adapter
    totalCount Double
    (Integer) If show_total_count is true, this will contain the total number of objects after the State Filter
    limit Double
    objectStateFilters List<Double>
    offset Double
    showTotalCount Boolean
    adapterId string
    adapterName string
    endpointType string
    id string
    instanceId string
    objects GetKmsKmipObjectsObject[]
    (List of Objects) The list of KMIP objects in an adapter
    totalCount number
    (Integer) If show_total_count is true, this will contain the total number of objects after the State Filter
    limit number
    objectStateFilters number[]
    offset number
    showTotalCount boolean
    adapter_id str
    adapter_name str
    endpoint_type str
    id str
    instance_id str
    objects Sequence[GetKmsKmipObjectsObject]
    (List of Objects) The list of KMIP objects in an adapter
    total_count float
    (Integer) If show_total_count is true, this will contain the total number of objects after the State Filter
    limit float
    object_state_filters Sequence[float]
    offset float
    show_total_count bool
    adapterId String
    adapterName String
    endpointType String
    id String
    instanceId String
    objects List<Property Map>
    (List of Objects) The list of KMIP objects in an adapter
    totalCount Number
    (Integer) If show_total_count is true, this will contain the total number of objects after the State Filter
    limit Number
    objectStateFilters List<Number>
    offset Number
    showTotalCount Boolean

    Supporting Types

    GetKmsKmipObjectsObject

    CreatedAt string
    (String) The date the resource was created, in RFC 3339 format
    CreatedBy string
    (String) The IBM-ID of the identity that created the resource
    CreatedByCertId string
    (String) The ID of the certificate that created the object
    DestroyedAt string
    (String) The date the resource was destroyed, in RFC 3339 format
    DestroyedBy string
    (String) The IBM-ID of the identity that destroyed the resource
    DestroyedByCertId string
    (String) The ID of the certificate that destroyed the object
    ObjectId string
    (String) The id of the KMIP Object
    ObjectState double
    (Integer) The state of the KMIP object as an enum
    ObjectType double
    (Integer) The type of the KMIP object as an enum
    UpdatedAt string
    (String) The date the resource was updated, in RFC 3339 format
    UpdatedBy string
    (String) The IBM-ID of the identity that updated the resource
    UpdatedByCertId string
    (String) The ID of the certificate that updated the object
    CreatedAt string
    (String) The date the resource was created, in RFC 3339 format
    CreatedBy string
    (String) The IBM-ID of the identity that created the resource
    CreatedByCertId string
    (String) The ID of the certificate that created the object
    DestroyedAt string
    (String) The date the resource was destroyed, in RFC 3339 format
    DestroyedBy string
    (String) The IBM-ID of the identity that destroyed the resource
    DestroyedByCertId string
    (String) The ID of the certificate that destroyed the object
    ObjectId string
    (String) The id of the KMIP Object
    ObjectState float64
    (Integer) The state of the KMIP object as an enum
    ObjectType float64
    (Integer) The type of the KMIP object as an enum
    UpdatedAt string
    (String) The date the resource was updated, in RFC 3339 format
    UpdatedBy string
    (String) The IBM-ID of the identity that updated the resource
    UpdatedByCertId string
    (String) The ID of the certificate that updated the object
    createdAt String
    (String) The date the resource was created, in RFC 3339 format
    createdBy String
    (String) The IBM-ID of the identity that created the resource
    createdByCertId String
    (String) The ID of the certificate that created the object
    destroyedAt String
    (String) The date the resource was destroyed, in RFC 3339 format
    destroyedBy String
    (String) The IBM-ID of the identity that destroyed the resource
    destroyedByCertId String
    (String) The ID of the certificate that destroyed the object
    objectId String
    (String) The id of the KMIP Object
    objectState Double
    (Integer) The state of the KMIP object as an enum
    objectType Double
    (Integer) The type of the KMIP object as an enum
    updatedAt String
    (String) The date the resource was updated, in RFC 3339 format
    updatedBy String
    (String) The IBM-ID of the identity that updated the resource
    updatedByCertId String
    (String) The ID of the certificate that updated the object
    createdAt string
    (String) The date the resource was created, in RFC 3339 format
    createdBy string
    (String) The IBM-ID of the identity that created the resource
    createdByCertId string
    (String) The ID of the certificate that created the object
    destroyedAt string
    (String) The date the resource was destroyed, in RFC 3339 format
    destroyedBy string
    (String) The IBM-ID of the identity that destroyed the resource
    destroyedByCertId string
    (String) The ID of the certificate that destroyed the object
    objectId string
    (String) The id of the KMIP Object
    objectState number
    (Integer) The state of the KMIP object as an enum
    objectType number
    (Integer) The type of the KMIP object as an enum
    updatedAt string
    (String) The date the resource was updated, in RFC 3339 format
    updatedBy string
    (String) The IBM-ID of the identity that updated the resource
    updatedByCertId string
    (String) The ID of the certificate that updated the object
    created_at str
    (String) The date the resource was created, in RFC 3339 format
    created_by str
    (String) The IBM-ID of the identity that created the resource
    created_by_cert_id str
    (String) The ID of the certificate that created the object
    destroyed_at str
    (String) The date the resource was destroyed, in RFC 3339 format
    destroyed_by str
    (String) The IBM-ID of the identity that destroyed the resource
    destroyed_by_cert_id str
    (String) The ID of the certificate that destroyed the object
    object_id str
    (String) The id of the KMIP Object
    object_state float
    (Integer) The state of the KMIP object as an enum
    object_type float
    (Integer) The type of the KMIP object as an enum
    updated_at str
    (String) The date the resource was updated, in RFC 3339 format
    updated_by str
    (String) The IBM-ID of the identity that updated the resource
    updated_by_cert_id str
    (String) The ID of the certificate that updated the object
    createdAt String
    (String) The date the resource was created, in RFC 3339 format
    createdBy String
    (String) The IBM-ID of the identity that created the resource
    createdByCertId String
    (String) The ID of the certificate that created the object
    destroyedAt String
    (String) The date the resource was destroyed, in RFC 3339 format
    destroyedBy String
    (String) The IBM-ID of the identity that destroyed the resource
    destroyedByCertId String
    (String) The ID of the certificate that destroyed the object
    objectId String
    (String) The id of the KMIP Object
    objectState Number
    (Integer) The state of the KMIP object as an enum
    objectType Number
    (Integer) The type of the KMIP object as an enum
    updatedAt String
    (String) The date the resource was updated, in RFC 3339 format
    updatedBy String
    (String) The IBM-ID of the identity that updated the resource
    updatedByCertId String
    (String) The ID of the certificate that updated the object

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud