ibm.getKmsInstancePolicies
Explore with Pulumi AI
Import the details of existing Key Protect and Hyper Protect Crypto Service (HPCS) instance policies as a read-only data source. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. Retreives a list of instance policies from the hs-crypto or key-protect instance for the provided instance id.
Example Usage
To Create A Instance And Associated Instance Policies.
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const test = ibm.getKmsInstancePolicies({
    instanceId: "guid-of-keyprotect-or hs-crypto-instance",
});
import pulumi
import pulumi_ibm as ibm
test = ibm.get_kms_instance_policies(instance_id="guid-of-keyprotect-or hs-crypto-instance")
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.LookupKmsInstancePolicies(ctx, &ibm.LookupKmsInstancePoliciesArgs{
			InstanceId: "guid-of-keyprotect-or hs-crypto-instance",
		}, 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 test = Ibm.GetKmsInstancePolicies.Invoke(new()
    {
        InstanceId = "guid-of-keyprotect-or hs-crypto-instance",
    });
});
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.GetKmsInstancePoliciesArgs;
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.getKmsInstancePolicies(GetKmsInstancePoliciesArgs.builder()
            .instanceId("guid-of-keyprotect-or hs-crypto-instance")
            .build());
    }
}
variables:
  test:
    fn::invoke:
      function: ibm:getKmsInstancePolicies
      arguments:
        instanceId: guid-of-keyprotect-or hs-crypto-instance
Using getKmsInstancePolicies
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 getKmsInstancePolicies(args: GetKmsInstancePoliciesArgs, opts?: InvokeOptions): Promise<GetKmsInstancePoliciesResult>
function getKmsInstancePoliciesOutput(args: GetKmsInstancePoliciesOutputArgs, opts?: InvokeOptions): Output<GetKmsInstancePoliciesResult>def get_kms_instance_policies(id: Optional[str] = None,
                              instance_id: Optional[str] = None,
                              policy_type: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetKmsInstancePoliciesResult
def get_kms_instance_policies_output(id: Optional[pulumi.Input[str]] = None,
                              instance_id: Optional[pulumi.Input[str]] = None,
                              policy_type: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetKmsInstancePoliciesResult]func LookupKmsInstancePolicies(ctx *Context, args *LookupKmsInstancePoliciesArgs, opts ...InvokeOption) (*LookupKmsInstancePoliciesResult, error)
func LookupKmsInstancePoliciesOutput(ctx *Context, args *LookupKmsInstancePoliciesOutputArgs, opts ...InvokeOption) LookupKmsInstancePoliciesResultOutput> Note: This function is named LookupKmsInstancePolicies in the Go SDK.
public static class GetKmsInstancePolicies 
{
    public static Task<GetKmsInstancePoliciesResult> InvokeAsync(GetKmsInstancePoliciesArgs args, InvokeOptions? opts = null)
    public static Output<GetKmsInstancePoliciesResult> Invoke(GetKmsInstancePoliciesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetKmsInstancePoliciesResult> getKmsInstancePolicies(GetKmsInstancePoliciesArgs args, InvokeOptions options)
public static Output<GetKmsInstancePoliciesResult> getKmsInstancePolicies(GetKmsInstancePoliciesArgs args, InvokeOptions options)
fn::invoke:
  function: ibm:index/getKmsInstancePolicies:getKmsInstancePolicies
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Instance
Id string - The key-protect instance ID for creating policies.
 - Id string
 - (String) The CRN of the instance.
 - Policy
Type string The type of policy to be retrieved. Allowed inputs ('dualAuthDelete', 'keyCreateImportAccess', 'metrics', 'rotation')
For Reference to the Policy : https://cloud.ibm.com/docs/key-protect?topic=key-protect-manage-keyCreateImportAccess
NOTE : Policies
allowedIPandallowedNetworkare not supported by instance_policies resource, and can be set using Context Based Restrictions (CBR).
- Instance
Id string - The key-protect instance ID for creating policies.
 - Id string
 - (String) The CRN of the instance.
 - Policy
Type string The type of policy to be retrieved. Allowed inputs ('dualAuthDelete', 'keyCreateImportAccess', 'metrics', 'rotation')
For Reference to the Policy : https://cloud.ibm.com/docs/key-protect?topic=key-protect-manage-keyCreateImportAccess
NOTE : Policies
allowedIPandallowedNetworkare not supported by instance_policies resource, and can be set using Context Based Restrictions (CBR).
- instance
Id String - The key-protect instance ID for creating policies.
 - id String
 - (String) The CRN of the instance.
 - policy
Type String The type of policy to be retrieved. Allowed inputs ('dualAuthDelete', 'keyCreateImportAccess', 'metrics', 'rotation')
For Reference to the Policy : https://cloud.ibm.com/docs/key-protect?topic=key-protect-manage-keyCreateImportAccess
NOTE : Policies
allowedIPandallowedNetworkare not supported by instance_policies resource, and can be set using Context Based Restrictions (CBR).
- instance
Id string - The key-protect instance ID for creating policies.
 - id string
 - (String) The CRN of the instance.
 - policy
Type string The type of policy to be retrieved. Allowed inputs ('dualAuthDelete', 'keyCreateImportAccess', 'metrics', 'rotation')
For Reference to the Policy : https://cloud.ibm.com/docs/key-protect?topic=key-protect-manage-keyCreateImportAccess
NOTE : Policies
allowedIPandallowedNetworkare not supported by instance_policies resource, and can be set using Context Based Restrictions (CBR).
- instance_
id str - The key-protect instance ID for creating policies.
 - id str
 - (String) The CRN of the instance.
 - policy_
type str The type of policy to be retrieved. Allowed inputs ('dualAuthDelete', 'keyCreateImportAccess', 'metrics', 'rotation')
For Reference to the Policy : https://cloud.ibm.com/docs/key-protect?topic=key-protect-manage-keyCreateImportAccess
NOTE : Policies
allowedIPandallowedNetworkare not supported by instance_policies resource, and can be set using Context Based Restrictions (CBR).
- instance
Id String - The key-protect instance ID for creating policies.
 - id String
 - (String) The CRN of the instance.
 - policy
Type String The type of policy to be retrieved. Allowed inputs ('dualAuthDelete', 'keyCreateImportAccess', 'metrics', 'rotation')
For Reference to the Policy : https://cloud.ibm.com/docs/key-protect?topic=key-protect-manage-keyCreateImportAccess
NOTE : Policies
allowedIPandallowedNetworkare not supported by instance_policies resource, and can be set using Context Based Restrictions (CBR).
getKmsInstancePolicies Result
The following output properties are available:
- Dual
Auth List<GetDeletes Kms Instance Policies Dual Auth Delete>  - (List) The data associated with the dual authorization delete policy.
 - Id string
 - (String) The CRN of the instance.
 - Instance
Id string - Key
Create List<GetImport Accesses Kms Instance Policies Key Create Import Access>  - (List) The data associated with the key_create_import_access policy.
 - Metrics
List<Get
Kms Instance Policies Metric>  - (List) The data associated with the metrics policy.
 - Rotations
List<Get
Kms Instance Policies Rotation>  - (List) The rotation time interval in months, with a minimum of 1, and a maximum of 12.
 - Policy
Type string 
- Dual
Auth []GetDeletes Kms Instance Policies Dual Auth Delete  - (List) The data associated with the dual authorization delete policy.
 - Id string
 - (String) The CRN of the instance.
 - Instance
Id string - Key
Create []GetImport Accesses Kms Instance Policies Key Create Import Access  - (List) The data associated with the key_create_import_access policy.
 - Metrics
[]Get
Kms Instance Policies Metric  - (List) The data associated with the metrics policy.
 - Rotations
[]Get
Kms Instance Policies Rotation  - (List) The rotation time interval in months, with a minimum of 1, and a maximum of 12.
 - Policy
Type string 
- dual
Auth List<GetDeletes Kms Instance Policies Dual Auth Delete>  - (List) The data associated with the dual authorization delete policy.
 - id String
 - (String) The CRN of the instance.
 - instance
Id String - key
Create List<GetImport Accesses Kms Instance Policies Key Create Import Access>  - (List) The data associated with the key_create_import_access policy.
 - metrics
List<Get
Kms Instance Policies Metric>  - (List) The data associated with the metrics policy.
 - rotations
List<Get
Kms Instance Policies Rotation>  - (List) The rotation time interval in months, with a minimum of 1, and a maximum of 12.
 - policy
Type String 
- dual
Auth GetDeletes Kms Instance Policies Dual Auth Delete[]  - (List) The data associated with the dual authorization delete policy.
 - id string
 - (String) The CRN of the instance.
 - instance
Id string - key
Create GetImport Accesses Kms Instance Policies Key Create Import Access[]  - (List) The data associated with the key_create_import_access policy.
 - metrics
Get
Kms Instance Policies Metric[]  - (List) The data associated with the metrics policy.
 - rotations
Get
Kms Instance Policies Rotation[]  - (List) The rotation time interval in months, with a minimum of 1, and a maximum of 12.
 - policy
Type string 
- dual_
auth_ Sequence[Getdeletes Kms Instance Policies Dual Auth Delete]  - (List) The data associated with the dual authorization delete policy.
 - id str
 - (String) The CRN of the instance.
 - instance_
id str - key_
create_ Sequence[Getimport_ accesses Kms Instance Policies Key Create Import Access]  - (List) The data associated with the key_create_import_access policy.
 - metrics
Sequence[Get
Kms Instance Policies Metric]  - (List) The data associated with the metrics policy.
 - rotations
Sequence[Get
Kms Instance Policies Rotation]  - (List) The rotation time interval in months, with a minimum of 1, and a maximum of 12.
 - policy_
type str 
- dual
Auth List<Property Map>Deletes  - (List) The data associated with the dual authorization delete policy.
 - id String
 - (String) The CRN of the instance.
 - instance
Id String - key
Create List<Property Map>Import Accesses  - (List) The data associated with the key_create_import_access policy.
 - metrics List<Property Map>
 - (List) The data associated with the metrics policy.
 - rotations List<Property Map>
 - (List) The rotation time interval in months, with a minimum of 1, and a maximum of 12.
 - policy
Type String 
Supporting Types
GetKmsInstancePoliciesDualAuthDelete      
- 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.
 - Enabled bool
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - Last
Updated string - 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.
 - Enabled bool
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - Last
Updated string - 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.
 - enabled Boolean
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - last
Updated String - 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.
 - enabled boolean
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - last
Updated string - 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.
 - enabled bool
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - last_
updated str - 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.
 - enabled Boolean
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - last
Updated String - updated
By String - (String) The unique ID for the resource that updated the policy.
 
GetKmsInstancePoliciesKeyCreateImportAccess       
- Create
Root boolKey  - (Bool) If set to true it enables the create_root_key attribute for the policy.
 - Create
Standard boolKey  - (Bool) If set to true it enables the create_standard_key attribute for 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.
 - Enabled bool
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - Enforce
Token bool - (Bool) If set to true it enables the enforce_token attribute of the policy.
 - Import
Root boolKey  - (Bool) If set to true it enables import_root_key attribute of the policy.
 - Import
Standard boolKey  - (Bool) If set to true it enables the import_standard_key attribute of the policy.
 - Last
Updated string - Updated
By string - (String) The unique ID for the resource that updated the policy.
 
- Create
Root boolKey  - (Bool) If set to true it enables the create_root_key attribute for the policy.
 - Create
Standard boolKey  - (Bool) If set to true it enables the create_standard_key attribute for 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.
 - Enabled bool
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - Enforce
Token bool - (Bool) If set to true it enables the enforce_token attribute of the policy.
 - Import
Root boolKey  - (Bool) If set to true it enables import_root_key attribute of the policy.
 - Import
Standard boolKey  - (Bool) If set to true it enables the import_standard_key attribute of the policy.
 - Last
Updated string - Updated
By string - (String) The unique ID for the resource that updated the policy.
 
- create
Root BooleanKey  - (Bool) If set to true it enables the create_root_key attribute for the policy.
 - create
Standard BooleanKey  - (Bool) If set to true it enables the create_standard_key attribute for 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.
 - enabled Boolean
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - enforce
Token Boolean - (Bool) If set to true it enables the enforce_token attribute of the policy.
 - import
Root BooleanKey  - (Bool) If set to true it enables import_root_key attribute of the policy.
 - import
Standard BooleanKey  - (Bool) If set to true it enables the import_standard_key attribute of the policy.
 - last
Updated String - updated
By String - (String) The unique ID for the resource that updated the policy.
 
- create
Root booleanKey  - (Bool) If set to true it enables the create_root_key attribute for the policy.
 - create
Standard booleanKey  - (Bool) If set to true it enables the create_standard_key attribute for 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.
 - enabled boolean
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - enforce
Token boolean - (Bool) If set to true it enables the enforce_token attribute of the policy.
 - import
Root booleanKey  - (Bool) If set to true it enables import_root_key attribute of the policy.
 - import
Standard booleanKey  - (Bool) If set to true it enables the import_standard_key attribute of the policy.
 - last
Updated string - updated
By string - (String) The unique ID for the resource that updated the policy.
 
- create_
root_ boolkey  - (Bool) If set to true it enables the create_root_key attribute for the policy.
 - create_
standard_ boolkey  - (Bool) If set to true it enables the create_standard_key attribute for 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.
 - enabled bool
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - enforce_
token bool - (Bool) If set to true it enables the enforce_token attribute of the policy.
 - import_
root_ boolkey  - (Bool) If set to true it enables import_root_key attribute of the policy.
 - import_
standard_ boolkey  - (Bool) If set to true it enables the import_standard_key attribute of the policy.
 - last_
updated str - updated_
by str - (String) The unique ID for the resource that updated the policy.
 
- create
Root BooleanKey  - (Bool) If set to true it enables the create_root_key attribute for the policy.
 - create
Standard BooleanKey  - (Bool) If set to true it enables the create_standard_key attribute for 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.
 - enabled Boolean
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - enforce
Token Boolean - (Bool) If set to true it enables the enforce_token attribute of the policy.
 - import
Root BooleanKey  - (Bool) If set to true it enables import_root_key attribute of the policy.
 - import
Standard BooleanKey  - (Bool) If set to true it enables the import_standard_key attribute of the policy.
 - last
Updated String - updated
By String - (String) The unique ID for the resource that updated the policy.
 
GetKmsInstancePoliciesMetric    
- 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.
 - Enabled bool
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - Last
Updated string - 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.
 - Enabled bool
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - Last
Updated string - 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.
 - enabled Boolean
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - last
Updated String - 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.
 - enabled boolean
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - last
Updated string - 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.
 - enabled bool
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - last_
updated str - 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.
 - enabled Boolean
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - last
Updated String - updated
By String - (String) The unique ID for the resource that updated the policy.
 
GetKmsInstancePoliciesRotation    
- 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.
 - Enabled bool
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - Interval
Month double - (Int) The rotation time interval in months.
 - Last
Updated string - 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.
 - Enabled bool
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - Interval
Month float64 - (Int) The rotation time interval in months.
 - Last
Updated string - 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.
 - enabled Boolean
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - interval
Month Double - (Int) The rotation time interval in months.
 - last
Updated String - 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.
 - enabled boolean
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - interval
Month number - (Int) The rotation time interval in months.
 - last
Updated string - 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.
 - enabled bool
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - interval_
month float - (Int) The rotation time interval in months.
 - last_
updated str - 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.
 - enabled Boolean
 - (Bool) Data associated with enable/disbale value for the rotation policy on the instance.
 - interval
Month Number - (Int) The rotation time interval in months.
 - last
Updated String - 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 
ibmTerraform Provider.