1. Packages
  2. OVH
  3. API Docs
  4. CloudProjectDatabase
  5. OpensearchPattern
OVHCloud v0.37.0 published on Wednesday, Feb 21, 2024 by OVHcloud

ovh.CloudProjectDatabase.OpensearchPattern

Explore with Pulumi AI

ovh logo
OVHCloud v0.37.0 published on Wednesday, Feb 21, 2024 by OVHcloud

    Creates a pattern for a opensearch cluster associated with a public cloud project.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var opensearch = Ovh.CloudProjectDatabase.GetDatabase.Invoke(new()
        {
            ServiceName = "XXX",
            Engine = "opensearch",
            Id = "ZZZ",
        });
    
        var pattern = new Ovh.CloudProjectDatabase.OpensearchPattern("pattern", new()
        {
            ServiceName = opensearch.Apply(getDatabaseResult => getDatabaseResult.ServiceName),
            ClusterId = opensearch.Apply(getDatabaseResult => getDatabaseResult.Id),
            MaxIndexCount = 2,
            Pattern = "logs_*",
        });
    
    });
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/CloudProjectDatabase"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		opensearch, err := CloudProjectDatabase.GetDatabase(ctx, &cloudprojectdatabase.GetDatabaseArgs{
    			ServiceName: "XXX",
    			Engine:      "opensearch",
    			Id:          "ZZZ",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = CloudProjectDatabase.NewOpensearchPattern(ctx, "pattern", &CloudProjectDatabase.OpensearchPatternArgs{
    			ServiceName:   *pulumi.String(opensearch.ServiceName),
    			ClusterId:     *pulumi.String(opensearch.Id),
    			MaxIndexCount: pulumi.Int(2),
    			Pattern:       pulumi.String("logs_*"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.CloudProjectDatabase.CloudProjectDatabaseFunctions;
    import com.pulumi.ovh.CloudProjectDatabase.inputs.GetDatabaseArgs;
    import com.pulumi.ovh.CloudProjectDatabase.OpensearchPattern;
    import com.pulumi.ovh.CloudProjectDatabase.OpensearchPatternArgs;
    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 opensearch = CloudProjectDatabaseFunctions.getDatabase(GetDatabaseArgs.builder()
                .serviceName("XXX")
                .engine("opensearch")
                .id("ZZZ")
                .build());
    
            var pattern = new OpensearchPattern("pattern", OpensearchPatternArgs.builder()        
                .serviceName(opensearch.applyValue(getDatabaseResult -> getDatabaseResult.serviceName()))
                .clusterId(opensearch.applyValue(getDatabaseResult -> getDatabaseResult.id()))
                .maxIndexCount(2)
                .pattern("logs_*")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_ovh as ovh
    
    opensearch = ovh.CloudProjectDatabase.get_database(service_name="XXX",
        engine="opensearch",
        id="ZZZ")
    pattern = ovh.cloud_project_database.OpensearchPattern("pattern",
        service_name=opensearch.service_name,
        cluster_id=opensearch.id,
        max_index_count=2,
        pattern="logs_*")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovh-devrelteam/pulumi-ovh";
    import * as ovh from "@pulumi/ovh";
    
    const opensearch = ovh.CloudProjectDatabase.getDatabase({
        serviceName: "XXX",
        engine: "opensearch",
        id: "ZZZ",
    });
    const pattern = new ovh.cloudprojectdatabase.OpensearchPattern("pattern", {
        serviceName: opensearch.then(opensearch => opensearch.serviceName),
        clusterId: opensearch.then(opensearch => opensearch.id),
        maxIndexCount: 2,
        pattern: "logs_*",
    });
    
    resources:
      pattern:
        type: ovh:CloudProjectDatabase:OpensearchPattern
        properties:
          serviceName: ${opensearch.serviceName}
          clusterId: ${opensearch.id}
          maxIndexCount: 2
          pattern: logs_*
    variables:
      opensearch:
        fn::invoke:
          Function: ovh:CloudProjectDatabase:getDatabase
          Arguments:
            serviceName: XXX
            engine: opensearch
            id: ZZZ
    

    Create OpensearchPattern Resource

    new OpensearchPattern(name: string, args: OpensearchPatternArgs, opts?: CustomResourceOptions);
    @overload
    def OpensearchPattern(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          cluster_id: Optional[str] = None,
                          max_index_count: Optional[int] = None,
                          pattern: Optional[str] = None,
                          service_name: Optional[str] = None)
    @overload
    def OpensearchPattern(resource_name: str,
                          args: OpensearchPatternArgs,
                          opts: Optional[ResourceOptions] = None)
    func NewOpensearchPattern(ctx *Context, name string, args OpensearchPatternArgs, opts ...ResourceOption) (*OpensearchPattern, error)
    public OpensearchPattern(string name, OpensearchPatternArgs args, CustomResourceOptions? opts = null)
    public OpensearchPattern(String name, OpensearchPatternArgs args)
    public OpensearchPattern(String name, OpensearchPatternArgs args, CustomResourceOptions options)
    
    type: ovh:CloudProjectDatabase:OpensearchPattern
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args OpensearchPatternArgs
    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 OpensearchPatternArgs
    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 OpensearchPatternArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OpensearchPatternArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OpensearchPatternArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    OpensearchPattern Resource Properties

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

    Inputs

    The OpensearchPattern resource accepts the following input properties:

    ClusterId string
    Cluster ID.
    Pattern string
    Pattern format.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    MaxIndexCount int
    Maximum number of index for this pattern.
    ClusterId string
    Cluster ID.
    Pattern string
    Pattern format.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    MaxIndexCount int
    Maximum number of index for this pattern.
    clusterId String
    Cluster ID.
    pattern String
    Pattern format.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    maxIndexCount Integer
    Maximum number of index for this pattern.
    clusterId string
    Cluster ID.
    pattern string
    Pattern format.
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    maxIndexCount number
    Maximum number of index for this pattern.
    cluster_id str
    Cluster ID.
    pattern str
    Pattern format.
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    max_index_count int
    Maximum number of index for this pattern.
    clusterId String
    Cluster ID.
    pattern String
    Pattern format.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    maxIndexCount Number
    Maximum number of index for this pattern.

    Outputs

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

    Get an existing OpensearchPattern 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?: OpensearchPatternState, opts?: CustomResourceOptions): OpensearchPattern
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_id: Optional[str] = None,
            max_index_count: Optional[int] = None,
            pattern: Optional[str] = None,
            service_name: Optional[str] = None) -> OpensearchPattern
    func GetOpensearchPattern(ctx *Context, name string, id IDInput, state *OpensearchPatternState, opts ...ResourceOption) (*OpensearchPattern, error)
    public static OpensearchPattern Get(string name, Input<string> id, OpensearchPatternState? state, CustomResourceOptions? opts = null)
    public static OpensearchPattern get(String name, Output<String> id, OpensearchPatternState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    ClusterId string
    Cluster ID.
    MaxIndexCount int
    Maximum number of index for this pattern.
    Pattern string
    Pattern format.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    ClusterId string
    Cluster ID.
    MaxIndexCount int
    Maximum number of index for this pattern.
    Pattern string
    Pattern format.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    clusterId String
    Cluster ID.
    maxIndexCount Integer
    Maximum number of index for this pattern.
    pattern String
    Pattern format.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    clusterId string
    Cluster ID.
    maxIndexCount number
    Maximum number of index for this pattern.
    pattern string
    Pattern format.
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    cluster_id str
    Cluster ID.
    max_index_count int
    Maximum number of index for this pattern.
    pattern str
    Pattern format.
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    clusterId String
    Cluster ID.
    maxIndexCount Number
    Maximum number of index for this pattern.
    pattern String
    Pattern format.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

    Import

    OVHcloud Managed opensearch clusters patterns can be imported using the service_name, cluster_id and id of the pattern, separated by “/” E.g.,

    bash

    $ pulumi import ovh:CloudProjectDatabase/opensearchPattern:OpensearchPattern my_pattern service_name/cluster_id/id
    

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v0.37.0 published on Wednesday, Feb 21, 2024 by OVHcloud