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

ibm.getCmPreset

Explore with Pulumi AI

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

    Provides a read-only data source for ibm_cm_preset. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const cmPreset = ibm.getCmPreset({
        id: `${ibm_cm_object.my_object.id}@1.0.0`,
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    cm_preset = ibm.get_cm_preset(id=f"{ibm_cm_object['my_object']['id']}@1.0.0")
    
    package main
    
    import (
    	"fmt"
    
    	"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.GetCmPreset(ctx, &ibm.GetCmPresetArgs{
    			Id: fmt.Sprintf("%v@1.0.0", ibm_cm_object.My_object.Id),
    		}, 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 cmPreset = Ibm.GetCmPreset.Invoke(new()
        {
            Id = $"{ibm_cm_object.My_object.Id}@1.0.0",
        });
    
    });
    
    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.GetCmPresetArgs;
    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 cmPreset = IbmFunctions.getCmPreset(GetCmPresetArgs.builder()
                .id(String.format("%s@1.0.0", ibm_cm_object.my_object().id()))
                .build());
    
        }
    }
    
    variables:
      cmPreset:
        fn::invoke:
          function: ibm:getCmPreset
          arguments:
            id: ${ibm_cm_object.my_object.id}@1.0.0
    

    Using getCmPreset

    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 getCmPreset(args: GetCmPresetArgs, opts?: InvokeOptions): Promise<GetCmPresetResult>
    function getCmPresetOutput(args: GetCmPresetOutputArgs, opts?: InvokeOptions): Output<GetCmPresetResult>
    def get_cm_preset(id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetCmPresetResult
    def get_cm_preset_output(id: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetCmPresetResult]
    func GetCmPreset(ctx *Context, args *GetCmPresetArgs, opts ...InvokeOption) (*GetCmPresetResult, error)
    func GetCmPresetOutput(ctx *Context, args *GetCmPresetOutputArgs, opts ...InvokeOption) GetCmPresetResultOutput

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

    public static class GetCmPreset 
    {
        public static Task<GetCmPresetResult> InvokeAsync(GetCmPresetArgs args, InvokeOptions? opts = null)
        public static Output<GetCmPresetResult> Invoke(GetCmPresetInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCmPresetResult> getCmPreset(GetCmPresetArgs args, InvokeOptions options)
    public static Output<GetCmPresetResult> getCmPreset(GetCmPresetArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getCmPreset:getCmPreset
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The ID of the preset. Format is <catalog_id>-<object_name>@<preset_version>
    Id string
    The ID of the preset. Format is <catalog_id>-<object_name>@<preset_version>
    id String
    The ID of the preset. Format is <catalog_id>-<object_name>@<preset_version>
    id string
    The ID of the preset. Format is <catalog_id>-<object_name>@<preset_version>
    id str
    The ID of the preset. Format is <catalog_id>-<object_name>@<preset_version>
    id String
    The ID of the preset. Format is <catalog_id>-<object_name>@<preset_version>

    getCmPreset Result

    The following output properties are available:

    Id string
    Preset string
    (String) The map of preset values as a JSON string.
    Id string
    Preset string
    (String) The map of preset values as a JSON string.
    id String
    preset String
    (String) The map of preset values as a JSON string.
    id string
    preset string
    (String) The map of preset values as a JSON string.
    id str
    preset str
    (String) The map of preset values as a JSON string.
    id String
    preset String
    (String) The map of preset values as a JSON string.

    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