1. Packages
  2. Spectrocloud Provider
  3. API Docs
  4. getClusterConfigPolicy
spectrocloud 0.26.0 published on Saturday, Nov 22, 2025 by spectrocloud
spectrocloud logo
spectrocloud 0.26.0 published on Saturday, Nov 22, 2025 by spectrocloud

    Data source for retrieving information about a cluster config policy (maintenance policy).

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as spectrocloud from "@pulumi/spectrocloud";
    
    const policy = spectrocloud.getClusterConfigPolicy({
        name: "weekly-maintenance-policy",
        context: "project",
    });
    export const policySchedules = policy.then(policy => policy.schedules);
    export const policyTags = policy.then(policy => policy.tags);
    
    import pulumi
    import pulumi_spectrocloud as spectrocloud
    
    policy = spectrocloud.get_cluster_config_policy(name="weekly-maintenance-policy",
        context="project")
    pulumi.export("policySchedules", policy.schedules)
    pulumi.export("policyTags", policy.tags)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/spectrocloud/spectrocloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		policy, err := spectrocloud.LookupClusterConfigPolicy(ctx, &spectrocloud.LookupClusterConfigPolicyArgs{
    			Name:    "weekly-maintenance-policy",
    			Context: pulumi.StringRef("project"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("policySchedules", policy.Schedules)
    		ctx.Export("policyTags", policy.Tags)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Spectrocloud = Pulumi.Spectrocloud;
    
    return await Deployment.RunAsync(() => 
    {
        var policy = Spectrocloud.GetClusterConfigPolicy.Invoke(new()
        {
            Name = "weekly-maintenance-policy",
            Context = "project",
        });
    
        return new Dictionary<string, object?>
        {
            ["policySchedules"] = policy.Apply(getClusterConfigPolicyResult => getClusterConfigPolicyResult.Schedules),
            ["policyTags"] = policy.Apply(getClusterConfigPolicyResult => getClusterConfigPolicyResult.Tags),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.spectrocloud.SpectrocloudFunctions;
    import com.pulumi.spectrocloud.inputs.GetClusterConfigPolicyArgs;
    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 policy = SpectrocloudFunctions.getClusterConfigPolicy(GetClusterConfigPolicyArgs.builder()
                .name("weekly-maintenance-policy")
                .context("project")
                .build());
    
            ctx.export("policySchedules", policy.schedules());
            ctx.export("policyTags", policy.tags());
        }
    }
    
    variables:
      policy:
        fn::invoke:
          function: spectrocloud:getClusterConfigPolicy
          arguments:
            name: weekly-maintenance-policy
            context: project
    outputs:
      policySchedules: ${policy.schedules}
      policyTags: ${policy.tags}
    

    Using getClusterConfigPolicy

    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 getClusterConfigPolicy(args: GetClusterConfigPolicyArgs, opts?: InvokeOptions): Promise<GetClusterConfigPolicyResult>
    function getClusterConfigPolicyOutput(args: GetClusterConfigPolicyOutputArgs, opts?: InvokeOptions): Output<GetClusterConfigPolicyResult>
    def get_cluster_config_policy(context: Optional[str] = None,
                                  id: Optional[str] = None,
                                  name: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetClusterConfigPolicyResult
    def get_cluster_config_policy_output(context: Optional[pulumi.Input[str]] = None,
                                  id: Optional[pulumi.Input[str]] = None,
                                  name: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetClusterConfigPolicyResult]
    func LookupClusterConfigPolicy(ctx *Context, args *LookupClusterConfigPolicyArgs, opts ...InvokeOption) (*LookupClusterConfigPolicyResult, error)
    func LookupClusterConfigPolicyOutput(ctx *Context, args *LookupClusterConfigPolicyOutputArgs, opts ...InvokeOption) LookupClusterConfigPolicyResultOutput

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

    public static class GetClusterConfigPolicy 
    {
        public static Task<GetClusterConfigPolicyResult> InvokeAsync(GetClusterConfigPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetClusterConfigPolicyResult> Invoke(GetClusterConfigPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetClusterConfigPolicyResult> getClusterConfigPolicy(GetClusterConfigPolicyArgs args, InvokeOptions options)
    public static Output<GetClusterConfigPolicyResult> getClusterConfigPolicy(GetClusterConfigPolicyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: spectrocloud:index/getClusterConfigPolicy:getClusterConfigPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the cluster config policy.
    Context string
    The context of the cluster config policy. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    Id string
    The ID of this resource.
    Name string
    The name of the cluster config policy.
    Context string
    The context of the cluster config policy. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    Id string
    The ID of this resource.
    name String
    The name of the cluster config policy.
    context String
    The context of the cluster config policy. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id String
    The ID of this resource.
    name string
    The name of the cluster config policy.
    context string
    The context of the cluster config policy. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id string
    The ID of this resource.
    name str
    The name of the cluster config policy.
    context str
    The context of the cluster config policy. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id str
    The ID of this resource.
    name String
    The name of the cluster config policy.
    context String
    The context of the cluster config policy. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id String
    The ID of this resource.

    getClusterConfigPolicy Result

    The following output properties are available:

    Id string
    The ID of this resource.
    Name string
    The name of the cluster config policy.
    Schedules List<GetClusterConfigPolicySchedule>
    List of maintenance schedules for the policy.
    Tags List<string>
    Tags assigned to the cluster config policy.
    Context string
    The context of the cluster config policy. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    Id string
    The ID of this resource.
    Name string
    The name of the cluster config policy.
    Schedules []GetClusterConfigPolicySchedule
    List of maintenance schedules for the policy.
    Tags []string
    Tags assigned to the cluster config policy.
    Context string
    The context of the cluster config policy. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id String
    The ID of this resource.
    name String
    The name of the cluster config policy.
    schedules List<GetClusterConfigPolicySchedule>
    List of maintenance schedules for the policy.
    tags List<String>
    Tags assigned to the cluster config policy.
    context String
    The context of the cluster config policy. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id string
    The ID of this resource.
    name string
    The name of the cluster config policy.
    schedules GetClusterConfigPolicySchedule[]
    List of maintenance schedules for the policy.
    tags string[]
    Tags assigned to the cluster config policy.
    context string
    The context of the cluster config policy. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id str
    The ID of this resource.
    name str
    The name of the cluster config policy.
    schedules Sequence[GetClusterConfigPolicySchedule]
    List of maintenance schedules for the policy.
    tags Sequence[str]
    Tags assigned to the cluster config policy.
    context str
    The context of the cluster config policy. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.
    id String
    The ID of this resource.
    name String
    The name of the cluster config policy.
    schedules List<Property Map>
    List of maintenance schedules for the policy.
    tags List<String>
    Tags assigned to the cluster config policy.
    context String
    The context of the cluster config policy. Allowed values are project or tenant. Default value is project. If the project context is specified, the project name will sourced from the provider configuration parameter project_name.

    Supporting Types

    GetClusterConfigPolicySchedule

    DurationHrs double
    Name string
    StartCron string
    DurationHrs float64
    Name string
    StartCron string
    durationHrs Double
    name String
    startCron String
    durationHrs number
    name string
    startCron string
    durationHrs Number
    name String
    startCron String

    Package Details

    Repository
    spectrocloud spectrocloud/terraform-provider-spectrocloud
    License
    Notes
    This Pulumi package is based on the spectrocloud Terraform Provider.
    spectrocloud logo
    spectrocloud 0.26.0 published on Saturday, Nov 22, 2025 by spectrocloud
      Meet Neo: Your AI Platform Teammate