ovh.CloudProjectDatabase.LogSubscription
Explore with Pulumi AI
Creates a log subscription for a cluster associated with a public cloud project.
Example Usage
Create a log subscription for a database.
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";
import * as ovh from "@pulumi/ovh";
const stream = ovh.Dbaas.getLogsOutputGraylogStream({
serviceName: "ldp-xx-xxxxx",
title: "my stream",
});
const db = ovh.CloudProjectDatabase.getDatabase({
serviceName: "XXX",
engine: "YYY",
id: "ZZZ",
});
const subscription = new ovh.cloudprojectdatabase.LogSubscription("subscription", {
serviceName: db.then(db => db.serviceName),
engine: db.then(db => db.engine),
clusterId: db.then(db => db.id),
streamId: stream.then(stream => stream.id),
});
import pulumi
import pulumi_ovh as ovh
stream = ovh.Dbaas.get_logs_output_graylog_stream(service_name="ldp-xx-xxxxx",
title="my stream")
db = ovh.CloudProjectDatabase.get_database(service_name="XXX",
engine="YYY",
id="ZZZ")
subscription = ovh.cloud_project_database.LogSubscription("subscription",
service_name=db.service_name,
engine=db.engine,
cluster_id=db.id,
stream_id=stream.id)
package main
import (
"github.com/ovh/pulumi-ovh/sdk/go/ovh/CloudProjectDatabase"
"github.com/ovh/pulumi-ovh/sdk/go/ovh/Dbaas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
stream, err := Dbaas.GetLogsOutputGraylogStream(ctx, &dbaas.GetLogsOutputGraylogStreamArgs{
ServiceName: "ldp-xx-xxxxx",
Title: "my stream",
}, nil)
if err != nil {
return err
}
db, err := CloudProjectDatabase.GetDatabase(ctx, &cloudprojectdatabase.GetDatabaseArgs{
ServiceName: "XXX",
Engine: "YYY",
Id: "ZZZ",
}, nil)
if err != nil {
return err
}
_, err = CloudProjectDatabase.NewLogSubscription(ctx, "subscription", &CloudProjectDatabase.LogSubscriptionArgs{
ServiceName: pulumi.String(db.ServiceName),
Engine: pulumi.String(db.Engine),
ClusterId: pulumi.String(db.Id),
StreamId: pulumi.String(stream.Id),
})
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 stream = Ovh.Dbaas.GetLogsOutputGraylogStream.Invoke(new()
{
ServiceName = "ldp-xx-xxxxx",
Title = "my stream",
});
var db = Ovh.CloudProjectDatabase.GetDatabase.Invoke(new()
{
ServiceName = "XXX",
Engine = "YYY",
Id = "ZZZ",
});
var subscription = new Ovh.CloudProjectDatabase.LogSubscription("subscription", new()
{
ServiceName = db.Apply(getDatabaseResult => getDatabaseResult.ServiceName),
Engine = db.Apply(getDatabaseResult => getDatabaseResult.Engine),
ClusterId = db.Apply(getDatabaseResult => getDatabaseResult.Id),
StreamId = stream.Apply(getLogsOutputGraylogStreamResult => getLogsOutputGraylogStreamResult.Id),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.Dbaas.DbaasFunctions;
import com.pulumi.ovh.Dbaas.inputs.GetLogsOutputGraylogStreamArgs;
import com.pulumi.ovh.CloudProjectDatabase.CloudProjectDatabaseFunctions;
import com.pulumi.ovh.CloudProjectDatabase.inputs.GetDatabaseArgs;
import com.pulumi.ovh.CloudProjectDatabase.LogSubscription;
import com.pulumi.ovh.CloudProjectDatabase.LogSubscriptionArgs;
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 stream = DbaasFunctions.getLogsOutputGraylogStream(GetLogsOutputGraylogStreamArgs.builder()
.serviceName("ldp-xx-xxxxx")
.title("my stream")
.build());
final var db = CloudProjectDatabaseFunctions.getDatabase(GetDatabaseArgs.builder()
.serviceName("XXX")
.engine("YYY")
.id("ZZZ")
.build());
var subscription = new LogSubscription("subscription", LogSubscriptionArgs.builder()
.serviceName(db.applyValue(getDatabaseResult -> getDatabaseResult.serviceName()))
.engine(db.applyValue(getDatabaseResult -> getDatabaseResult.engine()))
.clusterId(db.applyValue(getDatabaseResult -> getDatabaseResult.id()))
.streamId(stream.applyValue(getLogsOutputGraylogStreamResult -> getLogsOutputGraylogStreamResult.id()))
.build());
}
}
resources:
subscription:
type: ovh:CloudProjectDatabase:LogSubscription
properties:
serviceName: ${db.serviceName}
engine: ${db.engine}
clusterId: ${db.id}
streamId: ${stream.id}
variables:
stream:
fn::invoke:
Function: ovh:Dbaas:getLogsOutputGraylogStream
Arguments:
serviceName: ldp-xx-xxxxx
title: my stream
db:
fn::invoke:
Function: ovh:CloudProjectDatabase:getDatabase
Arguments:
serviceName: XXX
engine: YYY
id: ZZZ
Create LogSubscription Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new LogSubscription(name: string, args: LogSubscriptionArgs, opts?: CustomResourceOptions);
@overload
def LogSubscription(resource_name: str,
args: LogSubscriptionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def LogSubscription(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
engine: Optional[str] = None,
service_name: Optional[str] = None,
stream_id: Optional[str] = None)
func NewLogSubscription(ctx *Context, name string, args LogSubscriptionArgs, opts ...ResourceOption) (*LogSubscription, error)
public LogSubscription(string name, LogSubscriptionArgs args, CustomResourceOptions? opts = null)
public LogSubscription(String name, LogSubscriptionArgs args)
public LogSubscription(String name, LogSubscriptionArgs args, CustomResourceOptions options)
type: ovh:CloudProjectDatabase:LogSubscription
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 LogSubscriptionArgs
- 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 LogSubscriptionArgs
- 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 LogSubscriptionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LogSubscriptionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LogSubscriptionArgs
- 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 logSubscriptionResource = new Ovh.CloudProjectDatabase.LogSubscription("logSubscriptionResource", new()
{
ClusterId = "string",
Engine = "string",
ServiceName = "string",
StreamId = "string",
});
example, err := CloudProjectDatabase.NewLogSubscription(ctx, "logSubscriptionResource", &CloudProjectDatabase.LogSubscriptionArgs{
ClusterId: pulumi.String("string"),
Engine: pulumi.String("string"),
ServiceName: pulumi.String("string"),
StreamId: pulumi.String("string"),
})
var logSubscriptionResource = new LogSubscription("logSubscriptionResource", LogSubscriptionArgs.builder()
.clusterId("string")
.engine("string")
.serviceName("string")
.streamId("string")
.build());
log_subscription_resource = ovh.cloud_project_database.LogSubscription("logSubscriptionResource",
cluster_id="string",
engine="string",
service_name="string",
stream_id="string")
const logSubscriptionResource = new ovh.cloudprojectdatabase.LogSubscription("logSubscriptionResource", {
clusterId: "string",
engine: "string",
serviceName: "string",
streamId: "string",
});
type: ovh:CloudProjectDatabase:LogSubscription
properties:
clusterId: string
engine: string
serviceName: string
streamId: string
LogSubscription 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 LogSubscription resource accepts the following input properties:
- Cluster
Id string - Cluster ID.
- Engine string
- The database engine for which you want to manage a subscription. To get a full list of available engine visit. public documentation.
- Service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - Stream
Id string - Id of the target Log data platform stream.
- Cluster
Id string - Cluster ID.
- Engine string
- The database engine for which you want to manage a subscription. To get a full list of available engine visit. public documentation.
- Service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - Stream
Id string - Id of the target Log data platform stream.
- cluster
Id String - Cluster ID.
- engine String
- The database engine for which you want to manage a subscription. To get a full list of available engine visit. public documentation.
- service
Name String - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - stream
Id String - Id of the target Log data platform stream.
- cluster
Id string - Cluster ID.
- engine string
- The database engine for which you want to manage a subscription. To get a full list of available engine visit. public documentation.
- service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - stream
Id string - Id of the target Log data platform stream.
- cluster_
id str - Cluster ID.
- engine str
- The database engine for which you want to manage a subscription. To get a full list of available engine visit. public documentation.
- service_
name str - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - stream_
id str - Id of the target Log data platform stream.
- cluster
Id String - Cluster ID.
- engine String
- The database engine for which you want to manage a subscription. To get a full list of available engine visit. public documentation.
- service
Name String - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - stream
Id String - Id of the target Log data platform stream.
Outputs
All input properties are implicitly available as output properties. Additionally, the LogSubscription resource produces the following output properties:
- Created
At string - Creation date of the subscription.
- Id string
- The provider-assigned unique ID for this managed resource.
- Kind string
- Log kind name of this subscription.
- Ldp
Service stringName - Name of the destination log service.
- Operation
Id string - Identifier of the operation.
- Resource
Name string - Name of subscribed resource, where the logs come from.
- Resource
Type string - Type of subscribed resource, where the logs come from.
- Updated
At string - Last update date of the subscription.
- Created
At string - Creation date of the subscription.
- Id string
- The provider-assigned unique ID for this managed resource.
- Kind string
- Log kind name of this subscription.
- Ldp
Service stringName - Name of the destination log service.
- Operation
Id string - Identifier of the operation.
- Resource
Name string - Name of subscribed resource, where the logs come from.
- Resource
Type string - Type of subscribed resource, where the logs come from.
- Updated
At string - Last update date of the subscription.
- created
At String - Creation date of the subscription.
- id String
- The provider-assigned unique ID for this managed resource.
- kind String
- Log kind name of this subscription.
- ldp
Service StringName - Name of the destination log service.
- operation
Id String - Identifier of the operation.
- resource
Name String - Name of subscribed resource, where the logs come from.
- resource
Type String - Type of subscribed resource, where the logs come from.
- updated
At String - Last update date of the subscription.
- created
At string - Creation date of the subscription.
- id string
- The provider-assigned unique ID for this managed resource.
- kind string
- Log kind name of this subscription.
- ldp
Service stringName - Name of the destination log service.
- operation
Id string - Identifier of the operation.
- resource
Name string - Name of subscribed resource, where the logs come from.
- resource
Type string - Type of subscribed resource, where the logs come from.
- updated
At string - Last update date of the subscription.
- created_
at str - Creation date of the subscription.
- id str
- The provider-assigned unique ID for this managed resource.
- kind str
- Log kind name of this subscription.
- ldp_
service_ strname - Name of the destination log service.
- operation_
id str - Identifier of the operation.
- resource_
name str - Name of subscribed resource, where the logs come from.
- resource_
type str - Type of subscribed resource, where the logs come from.
- updated_
at str - Last update date of the subscription.
- created
At String - Creation date of the subscription.
- id String
- The provider-assigned unique ID for this managed resource.
- kind String
- Log kind name of this subscription.
- ldp
Service StringName - Name of the destination log service.
- operation
Id String - Identifier of the operation.
- resource
Name String - Name of subscribed resource, where the logs come from.
- resource
Type String - Type of subscribed resource, where the logs come from.
- updated
At String - Last update date of the subscription.
Look up Existing LogSubscription Resource
Get an existing LogSubscription 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?: LogSubscriptionState, opts?: CustomResourceOptions): LogSubscription
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
created_at: Optional[str] = None,
engine: Optional[str] = None,
kind: Optional[str] = None,
ldp_service_name: Optional[str] = None,
operation_id: Optional[str] = None,
resource_name: Optional[str] = None,
resource_type: Optional[str] = None,
service_name: Optional[str] = None,
stream_id: Optional[str] = None,
updated_at: Optional[str] = None) -> LogSubscription
func GetLogSubscription(ctx *Context, name string, id IDInput, state *LogSubscriptionState, opts ...ResourceOption) (*LogSubscription, error)
public static LogSubscription Get(string name, Input<string> id, LogSubscriptionState? state, CustomResourceOptions? opts = null)
public static LogSubscription get(String name, Output<String> id, LogSubscriptionState 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.
- Created
At string - Creation date of the subscription.
- Engine string
- The database engine for which you want to manage a subscription. To get a full list of available engine visit. public documentation.
- Kind string
- Log kind name of this subscription.
- Ldp
Service stringName - Name of the destination log service.
- Operation
Id string - Identifier of the operation.
- Resource
Name string - Name of subscribed resource, where the logs come from.
- Resource
Type string - Type of subscribed resource, where the logs come from.
- Service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - Stream
Id string - Id of the target Log data platform stream.
- Updated
At string - Last update date of the subscription.
- Cluster
Id string - Cluster ID.
- Created
At string - Creation date of the subscription.
- Engine string
- The database engine for which you want to manage a subscription. To get a full list of available engine visit. public documentation.
- Kind string
- Log kind name of this subscription.
- Ldp
Service stringName - Name of the destination log service.
- Operation
Id string - Identifier of the operation.
- Resource
Name string - Name of subscribed resource, where the logs come from.
- Resource
Type string - Type of subscribed resource, where the logs come from.
- Service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - Stream
Id string - Id of the target Log data platform stream.
- Updated
At string - Last update date of the subscription.
- cluster
Id String - Cluster ID.
- created
At String - Creation date of the subscription.
- engine String
- The database engine for which you want to manage a subscription. To get a full list of available engine visit. public documentation.
- kind String
- Log kind name of this subscription.
- ldp
Service StringName - Name of the destination log service.
- operation
Id String - Identifier of the operation.
- resource
Name String - Name of subscribed resource, where the logs come from.
- resource
Type String - Type of subscribed resource, where the logs come from.
- service
Name String - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - stream
Id String - Id of the target Log data platform stream.
- updated
At String - Last update date of the subscription.
- cluster
Id string - Cluster ID.
- created
At string - Creation date of the subscription.
- engine string
- The database engine for which you want to manage a subscription. To get a full list of available engine visit. public documentation.
- kind string
- Log kind name of this subscription.
- ldp
Service stringName - Name of the destination log service.
- operation
Id string - Identifier of the operation.
- resource
Name string - Name of subscribed resource, where the logs come from.
- resource
Type string - Type of subscribed resource, where the logs come from.
- service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - stream
Id string - Id of the target Log data platform stream.
- updated
At string - Last update date of the subscription.
- cluster_
id str - Cluster ID.
- created_
at str - Creation date of the subscription.
- engine str
- The database engine for which you want to manage a subscription. To get a full list of available engine visit. public documentation.
- kind str
- Log kind name of this subscription.
- ldp_
service_ strname - Name of the destination log service.
- operation_
id str - Identifier of the operation.
- resource_
name str - Name of subscribed resource, where the logs come from.
- resource_
type str - Type of subscribed resource, where the logs come from.
- service_
name str - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - stream_
id str - Id of the target Log data platform stream.
- updated_
at str - Last update date of the subscription.
- cluster
Id String - Cluster ID.
- created
At String - Creation date of the subscription.
- engine String
- The database engine for which you want to manage a subscription. To get a full list of available engine visit. public documentation.
- kind String
- Log kind name of this subscription.
- ldp
Service StringName - Name of the destination log service.
- operation
Id String - Identifier of the operation.
- resource
Name String - Name of subscribed resource, where the logs come from.
- resource
Type String - Type of subscribed resource, where the logs come from.
- service
Name String - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used. - stream
Id String - Id of the target Log data platform stream.
- updated
At String - Last update date of the subscription.
Import
OVHcloud Managed clusters logs subscription can be imported using the service_name
, engine
, cluster_id
and id
of the subscription, separated by “/” E.g.,
bash
$ pulumi import ovh:CloudProjectDatabase/logSubscription:LogSubscription sub service_name/engine/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.