1. Packages
  2. Harness Provider
  3. API Docs
  4. platform
  5. GitopsFilters
Harness v0.7.3 published on Friday, Apr 18, 2025 by Pulumi

harness.platform.GitopsFilters

Explore with Pulumi AI

harness logo
Harness v0.7.3 published on Friday, Apr 18, 2025 by Pulumi

    Resource for creating and managing Harness GitOps Filters.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const example = new harness.platform.GitopsFilters("example", {
        name: "example_filter",
        orgId: "your_org_id",
        projectId: "your_project_id",
        identifier: "example_filter",
        type: "APPLICATION",
        filterProperties: JSON.stringify({
            agentIdentifiers: ["your_agent_identifier"],
            clusters: ["https://your-cluster-url"],
            healthStatus: [
                "Unknown",
                "Progressing",
                "Suspended",
                "Healthy",
                "Degraded",
                "Missing",
            ],
            namespaces: ["your-namespace"],
            repositories: ["your-repo"],
            syncStatus: [
                "OutOfSync",
                "Synced",
                "Unknown",
            ],
        }),
        filterVisibility: "OnlyCreator",
    });
    
    import pulumi
    import json
    import pulumi_harness as harness
    
    example = harness.platform.GitopsFilters("example",
        name="example_filter",
        org_id="your_org_id",
        project_id="your_project_id",
        identifier="example_filter",
        type="APPLICATION",
        filter_properties=json.dumps({
            "agentIdentifiers": ["your_agent_identifier"],
            "clusters": ["https://your-cluster-url"],
            "healthStatus": [
                "Unknown",
                "Progressing",
                "Suspended",
                "Healthy",
                "Degraded",
                "Missing",
            ],
            "namespaces": ["your-namespace"],
            "repositories": ["your-repo"],
            "syncStatus": [
                "OutOfSync",
                "Synced",
                "Unknown",
            ],
        }),
        filter_visibility="OnlyCreator")
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"agentIdentifiers": []string{
    				"your_agent_identifier",
    			},
    			"clusters": []string{
    				"https://your-cluster-url",
    			},
    			"healthStatus": []string{
    				"Unknown",
    				"Progressing",
    				"Suspended",
    				"Healthy",
    				"Degraded",
    				"Missing",
    			},
    			"namespaces": []string{
    				"your-namespace",
    			},
    			"repositories": []string{
    				"your-repo",
    			},
    			"syncStatus": []string{
    				"OutOfSync",
    				"Synced",
    				"Unknown",
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = platform.NewGitopsFilters(ctx, "example", &platform.GitopsFiltersArgs{
    			Name:             pulumi.String("example_filter"),
    			OrgId:            pulumi.String("your_org_id"),
    			ProjectId:        pulumi.String("your_project_id"),
    			Identifier:       pulumi.String("example_filter"),
    			Type:             pulumi.String("APPLICATION"),
    			FilterProperties: pulumi.String(json0),
    			FilterVisibility: pulumi.String("OnlyCreator"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Harness = Pulumi.Harness;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Harness.Platform.GitopsFilters("example", new()
        {
            Name = "example_filter",
            OrgId = "your_org_id",
            ProjectId = "your_project_id",
            Identifier = "example_filter",
            Type = "APPLICATION",
            FilterProperties = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["agentIdentifiers"] = new[]
                {
                    "your_agent_identifier",
                },
                ["clusters"] = new[]
                {
                    "https://your-cluster-url",
                },
                ["healthStatus"] = new[]
                {
                    "Unknown",
                    "Progressing",
                    "Suspended",
                    "Healthy",
                    "Degraded",
                    "Missing",
                },
                ["namespaces"] = new[]
                {
                    "your-namespace",
                },
                ["repositories"] = new[]
                {
                    "your-repo",
                },
                ["syncStatus"] = new[]
                {
                    "OutOfSync",
                    "Synced",
                    "Unknown",
                },
            }),
            FilterVisibility = "OnlyCreator",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.GitopsFilters;
    import com.pulumi.harness.platform.GitopsFiltersArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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 example = new GitopsFilters("example", GitopsFiltersArgs.builder()
                .name("example_filter")
                .orgId("your_org_id")
                .projectId("your_project_id")
                .identifier("example_filter")
                .type("APPLICATION")
                .filterProperties(serializeJson(
                    jsonObject(
                        jsonProperty("agentIdentifiers", jsonArray("your_agent_identifier")),
                        jsonProperty("clusters", jsonArray("https://your-cluster-url")),
                        jsonProperty("healthStatus", jsonArray(
                            "Unknown", 
                            "Progressing", 
                            "Suspended", 
                            "Healthy", 
                            "Degraded", 
                            "Missing"
                        )),
                        jsonProperty("namespaces", jsonArray("your-namespace")),
                        jsonProperty("repositories", jsonArray("your-repo")),
                        jsonProperty("syncStatus", jsonArray(
                            "OutOfSync", 
                            "Synced", 
                            "Unknown"
                        ))
                    )))
                .filterVisibility("OnlyCreator")
                .build());
    
        }
    }
    
    resources:
      example:
        type: harness:platform:GitopsFilters
        properties:
          name: example_filter
          orgId: your_org_id
          projectId: your_project_id
          identifier: example_filter
          type: APPLICATION
          filterProperties:
            fn::toJSON:
              agentIdentifiers:
                - your_agent_identifier
              clusters:
                - https://your-cluster-url
              healthStatus:
                - Unknown
                - Progressing
                - Suspended
                - Healthy
                - Degraded
                - Missing
              namespaces:
                - your-namespace
              repositories:
                - your-repo
              syncStatus:
                - OutOfSync
                - Synced
                - Unknown
          filterVisibility: OnlyCreator
    

    Filter Properties Reference

    The filter_properties field supports the following filter types:

    Note: The following filter properties are only valid for filter type “APPLICATION”. Different filter types may support different properties.

    • agentIdentifiers - Array of GitOps agent identifiers to filter by.
    • clusters - Array of cluster URLs to filter by.
    • healthStatus - Array of health status values to filter by. Valid values include: “Unknown”, “Progressing”, “Suspended”, “Healthy”, “Degraded”, “Missing”.
    • namespaces - Array of Kubernetes namespaces to filter by.
    • repositories - Array of Git repository URLs to filter by.
    • syncStatus - Array of sync status values to filter by. Valid values include: “OutOfSync”, “Synced”, “Unknown”.

    Schema Attributes Reference

    • id - Identifier of the GitOps filter.

    Create GitopsFilters Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new GitopsFilters(name: string, args: GitopsFiltersArgs, opts?: CustomResourceOptions);
    @overload
    def GitopsFilters(resource_name: str,
                      args: GitopsFiltersArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def GitopsFilters(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      filter_properties: Optional[str] = None,
                      identifier: Optional[str] = None,
                      org_id: Optional[str] = None,
                      project_id: Optional[str] = None,
                      type: Optional[str] = None,
                      filter_visibility: Optional[str] = None,
                      name: Optional[str] = None)
    func NewGitopsFilters(ctx *Context, name string, args GitopsFiltersArgs, opts ...ResourceOption) (*GitopsFilters, error)
    public GitopsFilters(string name, GitopsFiltersArgs args, CustomResourceOptions? opts = null)
    public GitopsFilters(String name, GitopsFiltersArgs args)
    public GitopsFilters(String name, GitopsFiltersArgs args, CustomResourceOptions options)
    
    type: harness:platform:GitopsFilters
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args GitopsFiltersArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args GitopsFiltersArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args GitopsFiltersArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GitopsFiltersArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GitopsFiltersArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var gitopsFiltersResource = new Harness.Platform.GitopsFilters("gitopsFiltersResource", new()
    {
        FilterProperties = "string",
        Identifier = "string",
        OrgId = "string",
        ProjectId = "string",
        Type = "string",
        FilterVisibility = "string",
        Name = "string",
    });
    
    example, err := platform.NewGitopsFilters(ctx, "gitopsFiltersResource", &platform.GitopsFiltersArgs{
    	FilterProperties: pulumi.String("string"),
    	Identifier:       pulumi.String("string"),
    	OrgId:            pulumi.String("string"),
    	ProjectId:        pulumi.String("string"),
    	Type:             pulumi.String("string"),
    	FilterVisibility: pulumi.String("string"),
    	Name:             pulumi.String("string"),
    })
    
    var gitopsFiltersResource = new GitopsFilters("gitopsFiltersResource", GitopsFiltersArgs.builder()
        .filterProperties("string")
        .identifier("string")
        .orgId("string")
        .projectId("string")
        .type("string")
        .filterVisibility("string")
        .name("string")
        .build());
    
    gitops_filters_resource = harness.platform.GitopsFilters("gitopsFiltersResource",
        filter_properties="string",
        identifier="string",
        org_id="string",
        project_id="string",
        type="string",
        filter_visibility="string",
        name="string")
    
    const gitopsFiltersResource = new harness.platform.GitopsFilters("gitopsFiltersResource", {
        filterProperties: "string",
        identifier: "string",
        orgId: "string",
        projectId: "string",
        type: "string",
        filterVisibility: "string",
        name: "string",
    });
    
    type: harness:platform:GitopsFilters
    properties:
        filterProperties: string
        filterVisibility: string
        identifier: string
        name: string
        orgId: string
        projectId: string
        type: string
    

    GitopsFilters Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The GitopsFilters resource accepts the following input properties:

    FilterProperties string
    Properties of the filter entity defined in Harness as a JSON string. All values should be arrays of strings. Example: jsonencode({"healthStatus": ["Healthy", "Degraded"], "syncStatus": ["Synced"]}).
    Identifier string
    Unique identifier of the GitOps filter.
    OrgId string
    Organization identifier for the GitOps filter.
    ProjectId string
    Project identifier for the GitOps filter.
    Type string
    Type of GitOps filter. Currently, only "APPLICATION" is supported.
    FilterVisibility string
    Visibility of the filter. Valid values are "EveryOne" and "OnlyCreator". Default is "EveryOne".
    Name string
    Name of the GitOps filter.
    FilterProperties string
    Properties of the filter entity defined in Harness as a JSON string. All values should be arrays of strings. Example: jsonencode({"healthStatus": ["Healthy", "Degraded"], "syncStatus": ["Synced"]}).
    Identifier string
    Unique identifier of the GitOps filter.
    OrgId string
    Organization identifier for the GitOps filter.
    ProjectId string
    Project identifier for the GitOps filter.
    Type string
    Type of GitOps filter. Currently, only "APPLICATION" is supported.
    FilterVisibility string
    Visibility of the filter. Valid values are "EveryOne" and "OnlyCreator". Default is "EveryOne".
    Name string
    Name of the GitOps filter.
    filterProperties String
    Properties of the filter entity defined in Harness as a JSON string. All values should be arrays of strings. Example: jsonencode({"healthStatus": ["Healthy", "Degraded"], "syncStatus": ["Synced"]}).
    identifier String
    Unique identifier of the GitOps filter.
    orgId String
    Organization identifier for the GitOps filter.
    projectId String
    Project identifier for the GitOps filter.
    type String
    Type of GitOps filter. Currently, only "APPLICATION" is supported.
    filterVisibility String
    Visibility of the filter. Valid values are "EveryOne" and "OnlyCreator". Default is "EveryOne".
    name String
    Name of the GitOps filter.
    filterProperties string
    Properties of the filter entity defined in Harness as a JSON string. All values should be arrays of strings. Example: jsonencode({"healthStatus": ["Healthy", "Degraded"], "syncStatus": ["Synced"]}).
    identifier string
    Unique identifier of the GitOps filter.
    orgId string
    Organization identifier for the GitOps filter.
    projectId string
    Project identifier for the GitOps filter.
    type string
    Type of GitOps filter. Currently, only "APPLICATION" is supported.
    filterVisibility string
    Visibility of the filter. Valid values are "EveryOne" and "OnlyCreator". Default is "EveryOne".
    name string
    Name of the GitOps filter.
    filter_properties str
    Properties of the filter entity defined in Harness as a JSON string. All values should be arrays of strings. Example: jsonencode({"healthStatus": ["Healthy", "Degraded"], "syncStatus": ["Synced"]}).
    identifier str
    Unique identifier of the GitOps filter.
    org_id str
    Organization identifier for the GitOps filter.
    project_id str
    Project identifier for the GitOps filter.
    type str
    Type of GitOps filter. Currently, only "APPLICATION" is supported.
    filter_visibility str
    Visibility of the filter. Valid values are "EveryOne" and "OnlyCreator". Default is "EveryOne".
    name str
    Name of the GitOps filter.
    filterProperties String
    Properties of the filter entity defined in Harness as a JSON string. All values should be arrays of strings. Example: jsonencode({"healthStatus": ["Healthy", "Degraded"], "syncStatus": ["Synced"]}).
    identifier String
    Unique identifier of the GitOps filter.
    orgId String
    Organization identifier for the GitOps filter.
    projectId String
    Project identifier for the GitOps filter.
    type String
    Type of GitOps filter. Currently, only "APPLICATION" is supported.
    filterVisibility String
    Visibility of the filter. Valid values are "EveryOne" and "OnlyCreator". Default is "EveryOne".
    name String
    Name of the GitOps filter.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GitopsFilters resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing GitopsFilters Resource

    Get an existing GitopsFilters resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: GitopsFiltersState, opts?: CustomResourceOptions): GitopsFilters
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            filter_properties: Optional[str] = None,
            filter_visibility: Optional[str] = None,
            identifier: Optional[str] = None,
            name: Optional[str] = None,
            org_id: Optional[str] = None,
            project_id: Optional[str] = None,
            type: Optional[str] = None) -> GitopsFilters
    func GetGitopsFilters(ctx *Context, name string, id IDInput, state *GitopsFiltersState, opts ...ResourceOption) (*GitopsFilters, error)
    public static GitopsFilters Get(string name, Input<string> id, GitopsFiltersState? state, CustomResourceOptions? opts = null)
    public static GitopsFilters get(String name, Output<String> id, GitopsFiltersState state, CustomResourceOptions options)
    resources:  _:    type: harness:platform:GitopsFilters    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    FilterProperties string
    Properties of the filter entity defined in Harness as a JSON string. All values should be arrays of strings. Example: jsonencode({"healthStatus": ["Healthy", "Degraded"], "syncStatus": ["Synced"]}).
    FilterVisibility string
    Visibility of the filter. Valid values are "EveryOne" and "OnlyCreator". Default is "EveryOne".
    Identifier string
    Unique identifier of the GitOps filter.
    Name string
    Name of the GitOps filter.
    OrgId string
    Organization identifier for the GitOps filter.
    ProjectId string
    Project identifier for the GitOps filter.
    Type string
    Type of GitOps filter. Currently, only "APPLICATION" is supported.
    FilterProperties string
    Properties of the filter entity defined in Harness as a JSON string. All values should be arrays of strings. Example: jsonencode({"healthStatus": ["Healthy", "Degraded"], "syncStatus": ["Synced"]}).
    FilterVisibility string
    Visibility of the filter. Valid values are "EveryOne" and "OnlyCreator". Default is "EveryOne".
    Identifier string
    Unique identifier of the GitOps filter.
    Name string
    Name of the GitOps filter.
    OrgId string
    Organization identifier for the GitOps filter.
    ProjectId string
    Project identifier for the GitOps filter.
    Type string
    Type of GitOps filter. Currently, only "APPLICATION" is supported.
    filterProperties String
    Properties of the filter entity defined in Harness as a JSON string. All values should be arrays of strings. Example: jsonencode({"healthStatus": ["Healthy", "Degraded"], "syncStatus": ["Synced"]}).
    filterVisibility String
    Visibility of the filter. Valid values are "EveryOne" and "OnlyCreator". Default is "EveryOne".
    identifier String
    Unique identifier of the GitOps filter.
    name String
    Name of the GitOps filter.
    orgId String
    Organization identifier for the GitOps filter.
    projectId String
    Project identifier for the GitOps filter.
    type String
    Type of GitOps filter. Currently, only "APPLICATION" is supported.
    filterProperties string
    Properties of the filter entity defined in Harness as a JSON string. All values should be arrays of strings. Example: jsonencode({"healthStatus": ["Healthy", "Degraded"], "syncStatus": ["Synced"]}).
    filterVisibility string
    Visibility of the filter. Valid values are "EveryOne" and "OnlyCreator". Default is "EveryOne".
    identifier string
    Unique identifier of the GitOps filter.
    name string
    Name of the GitOps filter.
    orgId string
    Organization identifier for the GitOps filter.
    projectId string
    Project identifier for the GitOps filter.
    type string
    Type of GitOps filter. Currently, only "APPLICATION" is supported.
    filter_properties str
    Properties of the filter entity defined in Harness as a JSON string. All values should be arrays of strings. Example: jsonencode({"healthStatus": ["Healthy", "Degraded"], "syncStatus": ["Synced"]}).
    filter_visibility str
    Visibility of the filter. Valid values are "EveryOne" and "OnlyCreator". Default is "EveryOne".
    identifier str
    Unique identifier of the GitOps filter.
    name str
    Name of the GitOps filter.
    org_id str
    Organization identifier for the GitOps filter.
    project_id str
    Project identifier for the GitOps filter.
    type str
    Type of GitOps filter. Currently, only "APPLICATION" is supported.
    filterProperties String
    Properties of the filter entity defined in Harness as a JSON string. All values should be arrays of strings. Example: jsonencode({"healthStatus": ["Healthy", "Degraded"], "syncStatus": ["Synced"]}).
    filterVisibility String
    Visibility of the filter. Valid values are "EveryOne" and "OnlyCreator". Default is "EveryOne".
    identifier String
    Unique identifier of the GitOps filter.
    name String
    Name of the GitOps filter.
    orgId String
    Organization identifier for the GitOps filter.
    projectId String
    Project identifier for the GitOps filter.
    type String
    Type of GitOps filter. Currently, only "APPLICATION" is supported.

    Import

    GitOps filters can be imported using a composite ID formed of organization ID, project ID, filter ID, and filter type.

    bash

    Format: <org_id>/<project_id>/<filter_id>/<filter_type>

    $ pulumi import harness:platform/gitopsFilters:GitopsFilters example org_id/project_id/filter_id/APPLICATION
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    harness pulumi/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Harness v0.7.3 published on Friday, Apr 18, 2025 by Pulumi