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/v2/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.ovhcloud.pulumi.ovh.CloudProjectDatabase.OpensearchPattern;
import com.ovhcloud.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.serviceName())
.clusterId(opensearch.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
This property is required. string - The unique name of the resource.
- args
This property is required. OpensearchPatternArgs - The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name
This property is required. str - The unique name of the resource.
- args
This property is required. 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
This property is required. string - The unique name of the resource.
- args
This property is required. OpensearchPatternArgs - The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name
This property is required. string - The unique name of the resource.
- args
This property is required. OpensearchPatternArgs - The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name
This property is required. String - The unique name of the resource.
- args
This property is required. 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 This property is required. Changes to this property will trigger replacement.
- Cluster ID.
- Pattern
This property is required. Changes to this property will trigger replacement.
- Pattern format.
- Service
Name This property is required. Changes to this property will trigger replacement.
- The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - Max
Index Count Changes to this property will trigger replacement.
- Maximum number of index for this pattern.
- Cluster
Id This property is required. Changes to this property will trigger replacement.
- Cluster ID.
- Pattern
This property is required. Changes to this property will trigger replacement.
- Pattern format.
- Service
Name This property is required. Changes to this property will trigger replacement.
- The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - Max
Index Count Changes to this property will trigger replacement.
- Maximum number of index for this pattern.
- cluster
Id This property is required. Changes to this property will trigger replacement.
- Cluster ID.
- pattern
This property is required. Changes to this property will trigger replacement.
- Pattern format.
- service
Name This property is required. Changes to this property will trigger replacement.
- The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - max
Index Count Changes to this property will trigger replacement.
- Maximum number of index for this pattern.
- cluster
Id This property is required. Changes to this property will trigger replacement.
- Cluster ID.
- pattern
This property is required. Changes to this property will trigger replacement.
- Pattern format.
- service
Name This property is required. Changes to this property will trigger replacement.
- The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - max
Index Count Changes to this property will trigger replacement.
- Maximum number of index for this pattern.
- cluster_
id This property is required. Changes to this property will trigger replacement.
- Cluster ID.
- pattern
This property is required. Changes to this property will trigger replacement.
- Pattern format.
- service_
name This property is required. Changes to this property will trigger replacement.
- The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - max_
index_ count Changes to this property will trigger replacement.
- Maximum number of index for this pattern.
- cluster
Id This property is required. Changes to this property will trigger replacement.
- Cluster ID.
- pattern
This property is required. Changes to this property will trigger replacement.
- Pattern format.
- service
Name This property is required. Changes to this property will trigger replacement.
- The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - max
Index Count Changes to this property will trigger replacement.
- 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)
resources: _: type: ovh:CloudProjectDatabase:OpensearchPattern get: id: ${id}
- name
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - The unique provider ID of the resource to lookup.
- name
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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 Changes to this property will trigger replacement.
- Cluster ID.
- Max
Index Count Changes to this property will trigger replacement.
- Maximum number of index for this pattern.
- Pattern
Changes to this property will trigger replacement.
- Pattern format.
- Service
Name Changes to this property will trigger replacement.
- The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- Cluster
Id Changes to this property will trigger replacement.
- Cluster ID.
- Max
Index Count Changes to this property will trigger replacement.
- Maximum number of index for this pattern.
- Pattern
Changes to this property will trigger replacement.
- Pattern format.
- Service
Name Changes to this property will trigger replacement.
- The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- cluster
Id Changes to this property will trigger replacement.
- Cluster ID.
- max
Index Count Changes to this property will trigger replacement.
- Maximum number of index for this pattern.
- pattern
Changes to this property will trigger replacement.
- Pattern format.
- service
Name Changes to this property will trigger replacement.
- The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- cluster
Id Changes to this property will trigger replacement.
- Cluster ID.
- max
Index Count Changes to this property will trigger replacement.
- Maximum number of index for this pattern.
- pattern
Changes to this property will trigger replacement.
- Pattern format.
- service
Name Changes to this property will trigger replacement.
- The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- cluster_
id Changes to this property will trigger replacement.
- Cluster ID.
- max_
index_ count Changes to this property will trigger replacement.
- Maximum number of index for this pattern.
- pattern
Changes to this property will trigger replacement.
- Pattern format.
- service_
name Changes to this property will trigger replacement.
- The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- cluster
Id Changes to this property will trigger replacement.
- Cluster ID.
- max
Index Count Changes to this property will trigger replacement.
- Maximum number of index for this pattern.
- pattern
Changes to this property will trigger replacement.
- Pattern format.
- service
Name Changes to this property will trigger replacement.
- 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.