1. Packages
  2. Spectrocloud Provider
  3. API Docs
  4. Filter
spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud

spectrocloud.Filter

Explore with Pulumi AI

spectrocloud logo
spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud

    A resource for creating and managing filters.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as spectrocloud from "@pulumi/spectrocloud";
    
    const example = new spectrocloud.Filter("example", {
        metadata: {
            name: "resourcefilter2",
        },
        spec: {
            filterGroup: {
                conjunction: "and",
                filters: [
                    {
                        key: "testtag1",
                        negation: false,
                        operator: "eq",
                        values: ["spectro__tag"],
                    },
                    {
                        key: "testtag2",
                        negation: true,
                        operator: "eq",
                        values: ["spectro__tag"],
                    },
                ],
            },
        },
    });
    
    import pulumi
    import pulumi_spectrocloud as spectrocloud
    
    example = spectrocloud.Filter("example",
        metadata={
            "name": "resourcefilter2",
        },
        spec={
            "filter_group": {
                "conjunction": "and",
                "filters": [
                    {
                        "key": "testtag1",
                        "negation": False,
                        "operator": "eq",
                        "values": ["spectro__tag"],
                    },
                    {
                        "key": "testtag2",
                        "negation": True,
                        "operator": "eq",
                        "values": ["spectro__tag"],
                    },
                ],
            },
        })
    
    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 {
    		_, err := spectrocloud.NewFilter(ctx, "example", &spectrocloud.FilterArgs{
    			Metadata: &spectrocloud.FilterMetadataArgs{
    				Name: pulumi.String("resourcefilter2"),
    			},
    			Spec: &spectrocloud.FilterSpecArgs{
    				FilterGroup: &spectrocloud.FilterSpecFilterGroupArgs{
    					Conjunction: pulumi.String("and"),
    					Filters: spectrocloud.FilterSpecFilterGroupFilterArray{
    						&spectrocloud.FilterSpecFilterGroupFilterArgs{
    							Key:      pulumi.String("testtag1"),
    							Negation: pulumi.Bool(false),
    							Operator: pulumi.String("eq"),
    							Values: pulumi.StringArray{
    								pulumi.String("spectro__tag"),
    							},
    						},
    						&spectrocloud.FilterSpecFilterGroupFilterArgs{
    							Key:      pulumi.String("testtag2"),
    							Negation: pulumi.Bool(true),
    							Operator: pulumi.String("eq"),
    							Values: pulumi.StringArray{
    								pulumi.String("spectro__tag"),
    							},
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Spectrocloud = Pulumi.Spectrocloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Spectrocloud.Filter("example", new()
        {
            Metadata = new Spectrocloud.Inputs.FilterMetadataArgs
            {
                Name = "resourcefilter2",
            },
            Spec = new Spectrocloud.Inputs.FilterSpecArgs
            {
                FilterGroup = new Spectrocloud.Inputs.FilterSpecFilterGroupArgs
                {
                    Conjunction = "and",
                    Filters = new[]
                    {
                        new Spectrocloud.Inputs.FilterSpecFilterGroupFilterArgs
                        {
                            Key = "testtag1",
                            Negation = false,
                            Operator = "eq",
                            Values = new[]
                            {
                                "spectro__tag",
                            },
                        },
                        new Spectrocloud.Inputs.FilterSpecFilterGroupFilterArgs
                        {
                            Key = "testtag2",
                            Negation = true,
                            Operator = "eq",
                            Values = new[]
                            {
                                "spectro__tag",
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.spectrocloud.Filter;
    import com.pulumi.spectrocloud.FilterArgs;
    import com.pulumi.spectrocloud.inputs.FilterMetadataArgs;
    import com.pulumi.spectrocloud.inputs.FilterSpecArgs;
    import com.pulumi.spectrocloud.inputs.FilterSpecFilterGroupArgs;
    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 Filter("example", FilterArgs.builder()
                .metadata(FilterMetadataArgs.builder()
                    .name("resourcefilter2")
                    .build())
                .spec(FilterSpecArgs.builder()
                    .filterGroup(FilterSpecFilterGroupArgs.builder()
                        .conjunction("and")
                        .filters(                    
                            FilterSpecFilterGroupFilterArgs.builder()
                                .key("testtag1")
                                .negation(false)
                                .operator("eq")
                                .values("spectro__tag")
                                .build(),
                            FilterSpecFilterGroupFilterArgs.builder()
                                .key("testtag2")
                                .negation(true)
                                .operator("eq")
                                .values("spectro__tag")
                                .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: spectrocloud:Filter
        properties:
          metadata:
            name: resourcefilter2
          spec:
            filterGroup:
              conjunction: and
              filters:
                - key: testtag1
                  negation: false
                  operator: eq
                  values:
                    - spectro__tag
                - key: testtag2
                  negation: true
                  operator: eq
                  values:
                    - spectro__tag
    

    Create Filter Resource

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

    Constructor syntax

    new Filter(name: string, args: FilterArgs, opts?: CustomResourceOptions);
    @overload
    def Filter(resource_name: str,
               args: FilterArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Filter(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               metadata: Optional[FilterMetadataArgs] = None,
               spec: Optional[FilterSpecArgs] = None,
               filter_id: Optional[str] = None,
               timeouts: Optional[FilterTimeoutsArgs] = None)
    func NewFilter(ctx *Context, name string, args FilterArgs, opts ...ResourceOption) (*Filter, error)
    public Filter(string name, FilterArgs args, CustomResourceOptions? opts = null)
    public Filter(String name, FilterArgs args)
    public Filter(String name, FilterArgs args, CustomResourceOptions options)
    
    type: spectrocloud:Filter
    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 FilterArgs
    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 FilterArgs
    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 FilterArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FilterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FilterArgs
    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 filterResource = new Spectrocloud.Filter("filterResource", new()
    {
        Metadata = new Spectrocloud.Inputs.FilterMetadataArgs
        {
            Name = "string",
        },
        Spec = new Spectrocloud.Inputs.FilterSpecArgs
        {
            FilterGroup = new Spectrocloud.Inputs.FilterSpecFilterGroupArgs
            {
                Conjunction = "string",
                Filters = new[]
                {
                    new Spectrocloud.Inputs.FilterSpecFilterGroupFilterArgs
                    {
                        Key = "string",
                        Operator = "string",
                        Values = new[]
                        {
                            "string",
                        },
                        Negation = false,
                    },
                },
            },
        },
        FilterId = "string",
        Timeouts = new Spectrocloud.Inputs.FilterTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := spectrocloud.NewFilter(ctx, "filterResource", &spectrocloud.FilterArgs{
    	Metadata: &spectrocloud.FilterMetadataArgs{
    		Name: pulumi.String("string"),
    	},
    	Spec: &spectrocloud.FilterSpecArgs{
    		FilterGroup: &spectrocloud.FilterSpecFilterGroupArgs{
    			Conjunction: pulumi.String("string"),
    			Filters: spectrocloud.FilterSpecFilterGroupFilterArray{
    				&spectrocloud.FilterSpecFilterGroupFilterArgs{
    					Key:      pulumi.String("string"),
    					Operator: pulumi.String("string"),
    					Values: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    					Negation: pulumi.Bool(false),
    				},
    			},
    		},
    	},
    	FilterId: pulumi.String("string"),
    	Timeouts: &spectrocloud.FilterTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    })
    
    var filterResource = new Filter("filterResource", FilterArgs.builder()
        .metadata(FilterMetadataArgs.builder()
            .name("string")
            .build())
        .spec(FilterSpecArgs.builder()
            .filterGroup(FilterSpecFilterGroupArgs.builder()
                .conjunction("string")
                .filters(FilterSpecFilterGroupFilterArgs.builder()
                    .key("string")
                    .operator("string")
                    .values("string")
                    .negation(false)
                    .build())
                .build())
            .build())
        .filterId("string")
        .timeouts(FilterTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    filter_resource = spectrocloud.Filter("filterResource",
        metadata={
            "name": "string",
        },
        spec={
            "filter_group": {
                "conjunction": "string",
                "filters": [{
                    "key": "string",
                    "operator": "string",
                    "values": ["string"],
                    "negation": False,
                }],
            },
        },
        filter_id="string",
        timeouts={
            "create": "string",
            "delete": "string",
            "update": "string",
        })
    
    const filterResource = new spectrocloud.Filter("filterResource", {
        metadata: {
            name: "string",
        },
        spec: {
            filterGroup: {
                conjunction: "string",
                filters: [{
                    key: "string",
                    operator: "string",
                    values: ["string"],
                    negation: false,
                }],
            },
        },
        filterId: "string",
        timeouts: {
            create: "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: spectrocloud:Filter
    properties:
        filterId: string
        metadata:
            name: string
        spec:
            filterGroup:
                conjunction: string
                filters:
                    - key: string
                      negation: false
                      operator: string
                      values:
                        - string
        timeouts:
            create: string
            delete: string
            update: string
    

    Filter 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 Filter resource accepts the following input properties:

    Metadata FilterMetadata
    Metadata of the filter.
    Spec FilterSpec
    Specification of the filter.
    FilterId string
    The ID of this resource.
    Timeouts FilterTimeouts
    Metadata FilterMetadataArgs
    Metadata of the filter.
    Spec FilterSpecArgs
    Specification of the filter.
    FilterId string
    The ID of this resource.
    Timeouts FilterTimeoutsArgs
    metadata FilterMetadata
    Metadata of the filter.
    spec FilterSpec
    Specification of the filter.
    filterId String
    The ID of this resource.
    timeouts FilterTimeouts
    metadata FilterMetadata
    Metadata of the filter.
    spec FilterSpec
    Specification of the filter.
    filterId string
    The ID of this resource.
    timeouts FilterTimeouts
    metadata FilterMetadataArgs
    Metadata of the filter.
    spec FilterSpecArgs
    Specification of the filter.
    filter_id str
    The ID of this resource.
    timeouts FilterTimeoutsArgs
    metadata Property Map
    Metadata of the filter.
    spec Property Map
    Specification of the filter.
    filterId String
    The ID of this resource.
    timeouts Property Map

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Filter 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 Filter Resource

    Get an existing Filter 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?: FilterState, opts?: CustomResourceOptions): Filter
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            filter_id: Optional[str] = None,
            metadata: Optional[FilterMetadataArgs] = None,
            spec: Optional[FilterSpecArgs] = None,
            timeouts: Optional[FilterTimeoutsArgs] = None) -> Filter
    func GetFilter(ctx *Context, name string, id IDInput, state *FilterState, opts ...ResourceOption) (*Filter, error)
    public static Filter Get(string name, Input<string> id, FilterState? state, CustomResourceOptions? opts = null)
    public static Filter get(String name, Output<String> id, FilterState state, CustomResourceOptions options)
    resources:  _:    type: spectrocloud:Filter    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:
    FilterId string
    The ID of this resource.
    Metadata FilterMetadata
    Metadata of the filter.
    Spec FilterSpec
    Specification of the filter.
    Timeouts FilterTimeouts
    FilterId string
    The ID of this resource.
    Metadata FilterMetadataArgs
    Metadata of the filter.
    Spec FilterSpecArgs
    Specification of the filter.
    Timeouts FilterTimeoutsArgs
    filterId String
    The ID of this resource.
    metadata FilterMetadata
    Metadata of the filter.
    spec FilterSpec
    Specification of the filter.
    timeouts FilterTimeouts
    filterId string
    The ID of this resource.
    metadata FilterMetadata
    Metadata of the filter.
    spec FilterSpec
    Specification of the filter.
    timeouts FilterTimeouts
    filter_id str
    The ID of this resource.
    metadata FilterMetadataArgs
    Metadata of the filter.
    spec FilterSpecArgs
    Specification of the filter.
    timeouts FilterTimeoutsArgs
    filterId String
    The ID of this resource.
    metadata Property Map
    Metadata of the filter.
    spec Property Map
    Specification of the filter.
    timeouts Property Map

    Supporting Types

    FilterMetadata, FilterMetadataArgs

    Name string
    The name of the filter.
    Name string
    The name of the filter.
    name String
    The name of the filter.
    name string
    The name of the filter.
    name str
    The name of the filter.
    name String
    The name of the filter.

    FilterSpec, FilterSpecArgs

    FilterGroup FilterSpecFilterGroup
    Filter group of the filter.
    FilterGroup FilterSpecFilterGroup
    Filter group of the filter.
    filterGroup FilterSpecFilterGroup
    Filter group of the filter.
    filterGroup FilterSpecFilterGroup
    Filter group of the filter.
    filter_group FilterSpecFilterGroup
    Filter group of the filter.
    filterGroup Property Map
    Filter group of the filter.

    FilterSpecFilterGroup, FilterSpecFilterGroupArgs

    Conjunction string
    Conjunction operation of the filter group. Valid values are 'and' and 'or'.
    Filters List<FilterSpecFilterGroupFilter>
    List of filters in the filter group.
    Conjunction string
    Conjunction operation of the filter group. Valid values are 'and' and 'or'.
    Filters []FilterSpecFilterGroupFilter
    List of filters in the filter group.
    conjunction String
    Conjunction operation of the filter group. Valid values are 'and' and 'or'.
    filters List<FilterSpecFilterGroupFilter>
    List of filters in the filter group.
    conjunction string
    Conjunction operation of the filter group. Valid values are 'and' and 'or'.
    filters FilterSpecFilterGroupFilter[]
    List of filters in the filter group.
    conjunction str
    Conjunction operation of the filter group. Valid values are 'and' and 'or'.
    filters Sequence[FilterSpecFilterGroupFilter]
    List of filters in the filter group.
    conjunction String
    Conjunction operation of the filter group. Valid values are 'and' and 'or'.
    filters List<Property Map>
    List of filters in the filter group.

    FilterSpecFilterGroupFilter, FilterSpecFilterGroupFilterArgs

    Key string
    Key of the filter.
    Operator string
    Operator of the filter. Valid values are 'eq'.
    Values List<string>
    Values of the filter.
    Negation bool
    Negation flag of the filter condition.
    Key string
    Key of the filter.
    Operator string
    Operator of the filter. Valid values are 'eq'.
    Values []string
    Values of the filter.
    Negation bool
    Negation flag of the filter condition.
    key String
    Key of the filter.
    operator String
    Operator of the filter. Valid values are 'eq'.
    values List<String>
    Values of the filter.
    negation Boolean
    Negation flag of the filter condition.
    key string
    Key of the filter.
    operator string
    Operator of the filter. Valid values are 'eq'.
    values string[]
    Values of the filter.
    negation boolean
    Negation flag of the filter condition.
    key str
    Key of the filter.
    operator str
    Operator of the filter. Valid values are 'eq'.
    values Sequence[str]
    Values of the filter.
    negation bool
    Negation flag of the filter condition.
    key String
    Key of the filter.
    operator String
    Operator of the filter. Valid values are 'eq'.
    values List<String>
    Values of the filter.
    negation Boolean
    Negation flag of the filter condition.

    FilterTimeouts, FilterTimeoutsArgs

    Create string
    Delete string
    Update string
    Create string
    Delete string
    Update string
    create String
    delete String
    update String
    create string
    delete string
    update string
    create str
    delete str
    update str
    create String
    delete String
    update 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.23.5 published on Sunday, Apr 20, 2025 by spectrocloud