ovh.CloudProjectDatabase.OpensearchPattern
Explore with Pulumi AI
Creates a pattern for a opensearch cluster associated with a public cloud project.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/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_*",
});
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_*")
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
})
}
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 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());
}
}
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
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new OpensearchPattern(name: string, args: OpensearchPatternArgs, opts?: CustomResourceOptions);
@overload
def OpensearchPattern(resource_name: str,
args: OpensearchPatternArgs,
opts: Optional[ResourceOptions] = None)
@overload
def OpensearchPattern(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
pattern: Optional[str] = None,
service_name: Optional[str] = None,
max_index_count: Optional[int] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var opensearchPatternResource = new Ovh.CloudProjectDatabase.OpensearchPattern("opensearchPatternResource", new()
{
ClusterId = "string",
Pattern = "string",
ServiceName = "string",
MaxIndexCount = 0,
});
example, err := CloudProjectDatabase.NewOpensearchPattern(ctx, "opensearchPatternResource", &CloudProjectDatabase.OpensearchPatternArgs{
ClusterId: pulumi.String("string"),
Pattern: pulumi.String("string"),
ServiceName: pulumi.String("string"),
MaxIndexCount: pulumi.Int(0),
})
var opensearchPatternResource = new OpensearchPattern("opensearchPatternResource", OpensearchPatternArgs.builder()
.clusterId("string")
.pattern("string")
.serviceName("string")
.maxIndexCount(0)
.build());
opensearch_pattern_resource = ovh.cloud_project_database.OpensearchPattern("opensearchPatternResource",
cluster_id="string",
pattern="string",
service_name="string",
max_index_count=0)
const opensearchPatternResource = new ovh.cloudprojectdatabase.OpensearchPattern("opensearchPatternResource", {
clusterId: "string",
pattern: "string",
serviceName: "string",
maxIndexCount: 0,
});
type: ovh:CloudProjectDatabase:OpensearchPattern
properties:
clusterId: string
maxIndexCount: 0
pattern: string
serviceName: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The OpensearchPattern resource accepts the following input properties:
- Cluster
Id string - Cluster ID.
- Pattern string
- Pattern format.
- Service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - Max
Index intCount - Maximum number of index for this pattern.
- Cluster
Id string - Cluster ID.
- Pattern string
- Pattern format.
- Service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - Max
Index intCount - Maximum number of index for this pattern.
- cluster
Id String - Cluster ID.
- pattern String
- Pattern format.
- service
Name String - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - max
Index IntegerCount - Maximum number of index for this pattern.
- cluster
Id string - Cluster ID.
- pattern string
- Pattern format.
- service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - max
Index numberCount - 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_ intcount - Maximum number of index for this pattern.
- cluster
Id String - Cluster ID.
- pattern String
- Pattern format.
- service
Name String - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - max
Index NumberCount - 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.
- Cluster
Id string - Cluster ID.
- Max
Index intCount - Maximum number of index for this pattern.
- Pattern string
- Pattern format.
- Service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- Cluster
Id string - Cluster ID.
- Max
Index intCount - Maximum number of index for this pattern.
- Pattern string
- Pattern format.
- Service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- cluster
Id String - Cluster ID.
- max
Index IntegerCount - Maximum number of index for this pattern.
- pattern String
- Pattern format.
- service
Name String - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- cluster
Id string - Cluster ID.
- max
Index numberCount - Maximum number of index for this pattern.
- pattern string
- Pattern format.
- service
Name 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_ intcount - 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.
- cluster
Id String - Cluster ID.
- max
Index NumberCount - Maximum number of index for this pattern.
- pattern String
- Pattern format.
- service
Name 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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ovh
Terraform Provider.