1. Packages
  2. OVH
  3. API Docs
  4. CloudProjectDatabase
  5. Integration
OVHCloud v0.45.0 published on Tuesday, Jun 4, 2024 by OVHcloud

ovh.CloudProjectDatabase.Integration

Explore with Pulumi AI

ovh logo
OVHCloud v0.45.0 published on Tuesday, Jun 4, 2024 by OVHcloud

    Creates an integration for a database cluster associated with a public cloud project.

    With this resource you can create an integration for all engine exept mongodb.

    Please take a look at the list of available types in the Argument references section in order to know the list of avaulable integrations. For example, thanks to the integration feature you can have your PostgreSQL logs in your OpenSearch Database.

    Example Usage

    Push PostgreSQL logs in an OpenSearch DB:

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    import * as ovh from "@pulumi/ovh";
    
    const dbpostgresql = ovh.CloudProjectDatabase.getDatabase({
        serviceName: "XXXX",
        engine: "postgresql",
        id: "ZZZZ",
    });
    const dbopensearch = ovh.CloudProjectDatabase.getDatabase({
        serviceName: "XXXX",
        engine: "opensearch",
        id: "ZZZZ",
    });
    const integration = new ovh.cloudprojectdatabase.Integration("integration", {
        serviceName: dbpostgresql.then(dbpostgresql => dbpostgresql.serviceName),
        engine: dbpostgresql.then(dbpostgresql => dbpostgresql.engine),
        clusterId: dbpostgresql.then(dbpostgresql => dbpostgresql.id),
        sourceServiceId: dbpostgresql.then(dbpostgresql => dbpostgresql.id),
        destinationServiceId: dbopensearch.then(dbopensearch => dbopensearch.id),
        type: "opensearchLogs",
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    dbpostgresql = ovh.CloudProjectDatabase.get_database(service_name="XXXX",
        engine="postgresql",
        id="ZZZZ")
    dbopensearch = ovh.CloudProjectDatabase.get_database(service_name="XXXX",
        engine="opensearch",
        id="ZZZZ")
    integration = ovh.cloud_project_database.Integration("integration",
        service_name=dbpostgresql.service_name,
        engine=dbpostgresql.engine,
        cluster_id=dbpostgresql.id,
        source_service_id=dbpostgresql.id,
        destination_service_id=dbopensearch.id,
        type="opensearchLogs")
    
    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 {
    		dbpostgresql, err := CloudProjectDatabase.GetDatabase(ctx, &cloudprojectdatabase.GetDatabaseArgs{
    			ServiceName: "XXXX",
    			Engine:      "postgresql",
    			Id:          "ZZZZ",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		dbopensearch, err := CloudProjectDatabase.GetDatabase(ctx, &cloudprojectdatabase.GetDatabaseArgs{
    			ServiceName: "XXXX",
    			Engine:      "opensearch",
    			Id:          "ZZZZ",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = CloudProjectDatabase.NewIntegration(ctx, "integration", &CloudProjectDatabase.IntegrationArgs{
    			ServiceName:          pulumi.String(dbpostgresql.ServiceName),
    			Engine:               pulumi.String(dbpostgresql.Engine),
    			ClusterId:            pulumi.String(dbpostgresql.Id),
    			SourceServiceId:      pulumi.String(dbpostgresql.Id),
    			DestinationServiceId: pulumi.String(dbopensearch.Id),
    			Type:                 pulumi.String("opensearchLogs"),
    		})
    		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 dbpostgresql = Ovh.CloudProjectDatabase.GetDatabase.Invoke(new()
        {
            ServiceName = "XXXX",
            Engine = "postgresql",
            Id = "ZZZZ",
        });
    
        var dbopensearch = Ovh.CloudProjectDatabase.GetDatabase.Invoke(new()
        {
            ServiceName = "XXXX",
            Engine = "opensearch",
            Id = "ZZZZ",
        });
    
        var integration = new Ovh.CloudProjectDatabase.Integration("integration", new()
        {
            ServiceName = dbpostgresql.Apply(getDatabaseResult => getDatabaseResult.ServiceName),
            Engine = dbpostgresql.Apply(getDatabaseResult => getDatabaseResult.Engine),
            ClusterId = dbpostgresql.Apply(getDatabaseResult => getDatabaseResult.Id),
            SourceServiceId = dbpostgresql.Apply(getDatabaseResult => getDatabaseResult.Id),
            DestinationServiceId = dbopensearch.Apply(getDatabaseResult => getDatabaseResult.Id),
            Type = "opensearchLogs",
        });
    
    });
    
    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.Integration;
    import com.pulumi.ovh.CloudProjectDatabase.IntegrationArgs;
    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 dbpostgresql = CloudProjectDatabaseFunctions.getDatabase(GetDatabaseArgs.builder()
                .serviceName("XXXX")
                .engine("postgresql")
                .id("ZZZZ")
                .build());
    
            final var dbopensearch = CloudProjectDatabaseFunctions.getDatabase(GetDatabaseArgs.builder()
                .serviceName("XXXX")
                .engine("opensearch")
                .id("ZZZZ")
                .build());
    
            var integration = new Integration("integration", IntegrationArgs.builder()
                .serviceName(dbpostgresql.applyValue(getDatabaseResult -> getDatabaseResult.serviceName()))
                .engine(dbpostgresql.applyValue(getDatabaseResult -> getDatabaseResult.engine()))
                .clusterId(dbpostgresql.applyValue(getDatabaseResult -> getDatabaseResult.id()))
                .sourceServiceId(dbpostgresql.applyValue(getDatabaseResult -> getDatabaseResult.id()))
                .destinationServiceId(dbopensearch.applyValue(getDatabaseResult -> getDatabaseResult.id()))
                .type("opensearchLogs")
                .build());
    
        }
    }
    
    resources:
      integration:
        type: ovh:CloudProjectDatabase:Integration
        properties:
          serviceName: ${dbpostgresql.serviceName}
          engine: ${dbpostgresql.engine}
          clusterId: ${dbpostgresql.id}
          sourceServiceId: ${dbpostgresql.id}
          destinationServiceId: ${dbopensearch.id}
          type: opensearchLogs
    variables:
      dbpostgresql:
        fn::invoke:
          Function: ovh:CloudProjectDatabase:getDatabase
          Arguments:
            serviceName: XXXX
            engine: postgresql
            id: ZZZZ
      dbopensearch:
        fn::invoke:
          Function: ovh:CloudProjectDatabase:getDatabase
          Arguments:
            serviceName: XXXX
            engine: opensearch
            id: ZZZZ
    

    Create Integration Resource

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

    Constructor syntax

    new Integration(name: string, args: IntegrationArgs, opts?: CustomResourceOptions);
    @overload
    def Integration(resource_name: str,
                    args: IntegrationArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def Integration(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    cluster_id: Optional[str] = None,
                    destination_service_id: Optional[str] = None,
                    engine: Optional[str] = None,
                    service_name: Optional[str] = None,
                    source_service_id: Optional[str] = None,
                    parameters: Optional[Mapping[str, str]] = None,
                    type: Optional[str] = None)
    func NewIntegration(ctx *Context, name string, args IntegrationArgs, opts ...ResourceOption) (*Integration, error)
    public Integration(string name, IntegrationArgs args, CustomResourceOptions? opts = null)
    public Integration(String name, IntegrationArgs args)
    public Integration(String name, IntegrationArgs args, CustomResourceOptions options)
    
    type: ovh:CloudProjectDatabase:Integration
    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 IntegrationArgs
    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 IntegrationArgs
    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 IntegrationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IntegrationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IntegrationArgs
    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 integrationResource = new Ovh.CloudProjectDatabase.Integration("integrationResource", new()
    {
        ClusterId = "string",
        DestinationServiceId = "string",
        Engine = "string",
        ServiceName = "string",
        SourceServiceId = "string",
        Parameters = 
        {
            { "string", "string" },
        },
        Type = "string",
    });
    
    example, err := CloudProjectDatabase.NewIntegration(ctx, "integrationResource", &CloudProjectDatabase.IntegrationArgs{
    	ClusterId:            pulumi.String("string"),
    	DestinationServiceId: pulumi.String("string"),
    	Engine:               pulumi.String("string"),
    	ServiceName:          pulumi.String("string"),
    	SourceServiceId:      pulumi.String("string"),
    	Parameters: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Type: pulumi.String("string"),
    })
    
    var integrationResource = new Integration("integrationResource", IntegrationArgs.builder()
        .clusterId("string")
        .destinationServiceId("string")
        .engine("string")
        .serviceName("string")
        .sourceServiceId("string")
        .parameters(Map.of("string", "string"))
        .type("string")
        .build());
    
    integration_resource = ovh.cloud_project_database.Integration("integrationResource",
        cluster_id="string",
        destination_service_id="string",
        engine="string",
        service_name="string",
        source_service_id="string",
        parameters={
            "string": "string",
        },
        type="string")
    
    const integrationResource = new ovh.cloudprojectdatabase.Integration("integrationResource", {
        clusterId: "string",
        destinationServiceId: "string",
        engine: "string",
        serviceName: "string",
        sourceServiceId: "string",
        parameters: {
            string: "string",
        },
        type: "string",
    });
    
    type: ovh:CloudProjectDatabase:Integration
    properties:
        clusterId: string
        destinationServiceId: string
        engine: string
        parameters:
            string: string
        serviceName: string
        sourceServiceId: string
        type: string
    

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

    ClusterId string
    Cluster ID.
    DestinationServiceId string
    ID of the destination service.
    Engine string
    The engine of the database cluster you want to add. You can find the complete list of available engine in the public documentation. All engines available exept mongodb.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    SourceServiceId string
    ID of the source service.
    Parameters Dictionary<string, string>
    Parameters for the integration.
    Type string
    Type of the integration. Available types:

    • grafanaDashboard
    • grafanaDatasource
    • kafkaConnect
    • kafkaLogs
    • kafkaMirrorMaker
    ClusterId string
    Cluster ID.
    DestinationServiceId string
    ID of the destination service.
    Engine string
    The engine of the database cluster you want to add. You can find the complete list of available engine in the public documentation. All engines available exept mongodb.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    SourceServiceId string
    ID of the source service.
    Parameters map[string]string
    Parameters for the integration.
    Type string
    Type of the integration. Available types:

    • grafanaDashboard
    • grafanaDatasource
    • kafkaConnect
    • kafkaLogs
    • kafkaMirrorMaker
    clusterId String
    Cluster ID.
    destinationServiceId String
    ID of the destination service.
    engine String
    The engine of the database cluster you want to add. You can find the complete list of available engine in the public documentation. All engines available exept mongodb.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    sourceServiceId String
    ID of the source service.
    parameters Map<String,String>
    Parameters for the integration.
    type String
    Type of the integration. Available types:

    • grafanaDashboard
    • grafanaDatasource
    • kafkaConnect
    • kafkaLogs
    • kafkaMirrorMaker
    clusterId string
    Cluster ID.
    destinationServiceId string
    ID of the destination service.
    engine string
    The engine of the database cluster you want to add. You can find the complete list of available engine in the public documentation. All engines available exept mongodb.
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    sourceServiceId string
    ID of the source service.
    parameters {[key: string]: string}
    Parameters for the integration.
    type string
    Type of the integration. Available types:

    • grafanaDashboard
    • grafanaDatasource
    • kafkaConnect
    • kafkaLogs
    • kafkaMirrorMaker
    cluster_id str
    Cluster ID.
    destination_service_id str
    ID of the destination service.
    engine str
    The engine of the database cluster you want to add. You can find the complete list of available engine in the public documentation. All engines available exept mongodb.
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    source_service_id str
    ID of the source service.
    parameters Mapping[str, str]
    Parameters for the integration.
    type str
    Type of the integration. Available types:

    • grafanaDashboard
    • grafanaDatasource
    • kafkaConnect
    • kafkaLogs
    • kafkaMirrorMaker
    clusterId String
    Cluster ID.
    destinationServiceId String
    ID of the destination service.
    engine String
    The engine of the database cluster you want to add. You can find the complete list of available engine in the public documentation. All engines available exept mongodb.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    sourceServiceId String
    ID of the source service.
    parameters Map<String>
    Parameters for the integration.
    type String
    Type of the integration. Available types:

    • grafanaDashboard
    • grafanaDatasource
    • kafkaConnect
    • kafkaLogs
    • kafkaMirrorMaker

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Integration resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Current status of the integration.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Current status of the integration.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Current status of the integration.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    Current status of the integration.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    Current status of the integration.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Current status of the integration.

    Look up Existing Integration Resource

    Get an existing Integration 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?: IntegrationState, opts?: CustomResourceOptions): Integration
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_id: Optional[str] = None,
            destination_service_id: Optional[str] = None,
            engine: Optional[str] = None,
            parameters: Optional[Mapping[str, str]] = None,
            service_name: Optional[str] = None,
            source_service_id: Optional[str] = None,
            status: Optional[str] = None,
            type: Optional[str] = None) -> Integration
    func GetIntegration(ctx *Context, name string, id IDInput, state *IntegrationState, opts ...ResourceOption) (*Integration, error)
    public static Integration Get(string name, Input<string> id, IntegrationState? state, CustomResourceOptions? opts = null)
    public static Integration get(String name, Output<String> id, IntegrationState 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.
    DestinationServiceId string
    ID of the destination service.
    Engine string
    The engine of the database cluster you want to add. You can find the complete list of available engine in the public documentation. All engines available exept mongodb.
    Parameters Dictionary<string, string>
    Parameters for the integration.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    SourceServiceId string
    ID of the source service.
    Status string
    Current status of the integration.
    Type string
    Type of the integration. Available types:

    • grafanaDashboard
    • grafanaDatasource
    • kafkaConnect
    • kafkaLogs
    • kafkaMirrorMaker
    ClusterId string
    Cluster ID.
    DestinationServiceId string
    ID of the destination service.
    Engine string
    The engine of the database cluster you want to add. You can find the complete list of available engine in the public documentation. All engines available exept mongodb.
    Parameters map[string]string
    Parameters for the integration.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    SourceServiceId string
    ID of the source service.
    Status string
    Current status of the integration.
    Type string
    Type of the integration. Available types:

    • grafanaDashboard
    • grafanaDatasource
    • kafkaConnect
    • kafkaLogs
    • kafkaMirrorMaker
    clusterId String
    Cluster ID.
    destinationServiceId String
    ID of the destination service.
    engine String
    The engine of the database cluster you want to add. You can find the complete list of available engine in the public documentation. All engines available exept mongodb.
    parameters Map<String,String>
    Parameters for the integration.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    sourceServiceId String
    ID of the source service.
    status String
    Current status of the integration.
    type String
    Type of the integration. Available types:

    • grafanaDashboard
    • grafanaDatasource
    • kafkaConnect
    • kafkaLogs
    • kafkaMirrorMaker
    clusterId string
    Cluster ID.
    destinationServiceId string
    ID of the destination service.
    engine string
    The engine of the database cluster you want to add. You can find the complete list of available engine in the public documentation. All engines available exept mongodb.
    parameters {[key: string]: string}
    Parameters for the integration.
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    sourceServiceId string
    ID of the source service.
    status string
    Current status of the integration.
    type string
    Type of the integration. Available types:

    • grafanaDashboard
    • grafanaDatasource
    • kafkaConnect
    • kafkaLogs
    • kafkaMirrorMaker
    cluster_id str
    Cluster ID.
    destination_service_id str
    ID of the destination service.
    engine str
    The engine of the database cluster you want to add. You can find the complete list of available engine in the public documentation. All engines available exept mongodb.
    parameters Mapping[str, str]
    Parameters for the integration.
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    source_service_id str
    ID of the source service.
    status str
    Current status of the integration.
    type str
    Type of the integration. Available types:

    • grafanaDashboard
    • grafanaDatasource
    • kafkaConnect
    • kafkaLogs
    • kafkaMirrorMaker
    clusterId String
    Cluster ID.
    destinationServiceId String
    ID of the destination service.
    engine String
    The engine of the database cluster you want to add. You can find the complete list of available engine in the public documentation. All engines available exept mongodb.
    parameters Map<String>
    Parameters for the integration.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    sourceServiceId String
    ID of the source service.
    status String
    Current status of the integration.
    type String
    Type of the integration. Available types:

    • grafanaDashboard
    • grafanaDatasource
    • kafkaConnect
    • kafkaLogs
    • kafkaMirrorMaker

    Import

    OVHcloud Managed database clusters users can be imported using the service_name, engine, cluster_id and id of the user, separated by “/” E.g.,

    bash

    $ pulumi import ovh:CloudProjectDatabase/integration:Integration my_user 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.
    ovh logo
    OVHCloud v0.45.0 published on Tuesday, Jun 4, 2024 by OVHcloud