Linode

v3.10.1 published on Tuesday, Aug 30, 2022 by Pulumi

getDatabaseEngines

Provides information about Linode Managed Database engines that match a set of filters.

Example Usage

Get information about all Linode Managed Database engines

using System.Collections.Generic;
using Pulumi;
using Linode = Pulumi.Linode;

return await Deployment.RunAsync(() => 
{
    var all = Linode.GetDatabaseEngines.Invoke();

});
package main

import (
	"github.com/pulumi/pulumi-linode/sdk/v3/go/linode"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := linode.GetDatabaseEngines(ctx, nil, nil)
		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.linode.LinodeFunctions;
import com.pulumi.linode.inputs.GetDatabaseEnginesArgs;
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 all = LinodeFunctions.getDatabaseEngines();

    }
}
import pulumi
import pulumi_linode as linode

all = linode.get_database_engines()
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";

const all = pulumi.output(linode.getDatabaseEngines());
variables:
  all:
    Fn::Invoke:
      Function: linode:getDatabaseEngines
      Arguments: {}

Get information about all Linode MySQL Database engines

using System.Collections.Generic;
using Pulumi;
using Linode = Pulumi.Linode;

return await Deployment.RunAsync(() => 
{
    var mysql = Linode.GetDatabaseEngines.Invoke(new()
    {
        Filters = new[]
        {
            new Linode.Inputs.GetDatabaseEnginesFilterInputArgs
            {
                Name = "engine",
                Values = new[]
                {
                    "mysql",
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-linode/sdk/v3/go/linode"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := linode.GetDatabaseEngines(ctx, &GetDatabaseEnginesArgs{
			Filters: []GetDatabaseEnginesFilter{
				GetDatabaseEnginesFilter{
					Name: "engine",
					Values: []string{
						"mysql",
					},
				},
			},
		}, nil)
		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.linode.LinodeFunctions;
import com.pulumi.linode.inputs.GetDatabaseEnginesArgs;
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 mysql = LinodeFunctions.getDatabaseEngines(GetDatabaseEnginesArgs.builder()
            .filters(GetDatabaseEnginesFilterArgs.builder()
                .name("engine")
                .values("mysql")
                .build())
            .build());

    }
}
import pulumi
import pulumi_linode as linode

mysql = linode.get_database_engines(filters=[linode.GetDatabaseEnginesFilterArgs(
    name="engine",
    values=["mysql"],
)])
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";

const mysql = pulumi.output(linode.getDatabaseEngines({
    filters: [{
        name: "engine",
        values: ["mysql"],
    }],
}));
variables:
  mysql:
    Fn::Invoke:
      Function: linode:getDatabaseEngines
      Arguments:
        filters:
          - name: engine
            values:
              - mysql

Create a Linode MySQL Database using the latest support MySQL version

using System.Collections.Generic;
using Pulumi;
using Linode = Pulumi.Linode;

return await Deployment.RunAsync(() => 
{
    var mysql = Linode.GetDatabaseEngines.Invoke(new()
    {
        Latest = true,
        Filters = new[]
        {
            new Linode.Inputs.GetDatabaseEnginesFilterInputArgs
            {
                Name = "engine",
                Values = new[]
                {
                    "mysql",
                },
            },
        },
    });

    var myDb = new Linode.DatabaseMysql("myDb", new()
    {
        Label = "mydb",
        EngineId = mysql.Apply(getDatabaseEnginesResult => getDatabaseEnginesResult.Engines[0]?.Id),
        Region = "us-southeast",
        Type = "g6-nanode-1",
    });

});
package main

import (
	"github.com/pulumi/pulumi-linode/sdk/v3/go/linode"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		mysql, err := linode.GetDatabaseEngines(ctx, &GetDatabaseEnginesArgs{
			Latest: pulumi.BoolRef(true),
			Filters: []GetDatabaseEnginesFilter{
				GetDatabaseEnginesFilter{
					Name: "engine",
					Values: []string{
						"mysql",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = linode.NewDatabaseMysql(ctx, "myDb", &linode.DatabaseMysqlArgs{
			Label:    pulumi.String("mydb"),
			EngineId: pulumi.String(mysql.Engines[0].Id),
			Region:   pulumi.String("us-southeast"),
			Type:     pulumi.String("g6-nanode-1"),
		})
		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.linode.LinodeFunctions;
import com.pulumi.linode.inputs.GetDatabaseEnginesArgs;
import com.pulumi.linode.DatabaseMysql;
import com.pulumi.linode.DatabaseMysqlArgs;
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 mysql = LinodeFunctions.getDatabaseEngines(GetDatabaseEnginesArgs.builder()
            .latest(true)
            .filters(GetDatabaseEnginesFilterArgs.builder()
                .name("engine")
                .values("mysql")
                .build())
            .build());

        var myDb = new DatabaseMysql("myDb", DatabaseMysqlArgs.builder()        
            .label("mydb")
            .engineId(mysql.applyValue(getDatabaseEnginesResult -> getDatabaseEnginesResult.engines()[0].id()))
            .region("us-southeast")
            .type("g6-nanode-1")
            .build());

    }
}
import pulumi
import pulumi_linode as linode

mysql = linode.get_database_engines(latest=True,
    filters=[linode.GetDatabaseEnginesFilterArgs(
        name="engine",
        values=["mysql"],
    )])
my_db = linode.DatabaseMysql("myDb",
    label="mydb",
    engine_id=mysql.engines[0].id,
    region="us-southeast",
    type="g6-nanode-1")
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";

const mysql = linode.getDatabaseEngines({
    latest: true,
    filters: [{
        name: "engine",
        values: ["mysql"],
    }],
});
const myDb = new linode.DatabaseMysql("myDb", {
    label: "mydb",
    engineId: mysql.then(mysql => mysql.engines?[0]?.id),
    region: "us-southeast",
    type: "g6-nanode-1",
});
resources:
  myDb:
    type: linode:DatabaseMysql
    properties:
      label: mydb
      engineId: ${mysql.engines[0].id}
      region: us-southeast
      type: g6-nanode-1
variables:
  mysql:
    Fn::Invoke:
      Function: linode:getDatabaseEngines
      Arguments:
        latest: true
        filters:
          - name: engine
            values:
              - mysql

Using getDatabaseEngines

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getDatabaseEngines(args: GetDatabaseEnginesArgs, opts?: InvokeOptions): Promise<GetDatabaseEnginesResult>
function getDatabaseEnginesOutput(args: GetDatabaseEnginesOutputArgs, opts?: InvokeOptions): Output<GetDatabaseEnginesResult>
def get_database_engines(filters: Optional[Sequence[GetDatabaseEnginesFilter]] = None,
                         latest: Optional[bool] = None,
                         order: Optional[str] = None,
                         order_by: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetDatabaseEnginesResult
def get_database_engines_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetDatabaseEnginesFilterArgs]]]] = None,
                         latest: Optional[pulumi.Input[bool]] = None,
                         order: Optional[pulumi.Input[str]] = None,
                         order_by: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseEnginesResult]
func GetDatabaseEngines(ctx *Context, args *GetDatabaseEnginesArgs, opts ...InvokeOption) (*GetDatabaseEnginesResult, error)
func GetDatabaseEnginesOutput(ctx *Context, args *GetDatabaseEnginesOutputArgs, opts ...InvokeOption) GetDatabaseEnginesResultOutput

> Note: This function is named GetDatabaseEngines in the Go SDK.

public static class GetDatabaseEngines 
{
    public static Task<GetDatabaseEnginesResult> InvokeAsync(GetDatabaseEnginesArgs args, InvokeOptions? opts = null)
    public static Output<GetDatabaseEnginesResult> Invoke(GetDatabaseEnginesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDatabaseEnginesResult> getDatabaseEngines(GetDatabaseEnginesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: linode:index/getDatabaseEngines:getDatabaseEngines
  arguments:
    # arguments dictionary

The following arguments are supported:

Filters List<GetDatabaseEnginesFilter>
Latest bool

If true, only the latest engine version will be returned.

Order string

The order in which results should be returned. (asc, desc; default asc)

OrderBy string

The attribute to order the results by. (version)

Filters []GetDatabaseEnginesFilter
Latest bool

If true, only the latest engine version will be returned.

Order string

The order in which results should be returned. (asc, desc; default asc)

OrderBy string

The attribute to order the results by. (version)

filters List<GetDatabaseEnginesFilter>
latest Boolean

If true, only the latest engine version will be returned.

order String

The order in which results should be returned. (asc, desc; default asc)

orderBy String

The attribute to order the results by. (version)

filters GetDatabaseEnginesFilter[]
latest boolean

If true, only the latest engine version will be returned.

order string

The order in which results should be returned. (asc, desc; default asc)

orderBy string

The attribute to order the results by. (version)

filters Sequence[GetDatabaseEnginesFilter]
latest bool

If true, only the latest engine version will be returned.

order str

The order in which results should be returned. (asc, desc; default asc)

order_by str

The attribute to order the results by. (version)

filters List<Property Map>
latest Boolean

If true, only the latest engine version will be returned.

order String

The order in which results should be returned. (asc, desc; default asc)

orderBy String

The attribute to order the results by. (version)

getDatabaseEngines Result

The following output properties are available:

Engines List<GetDatabaseEnginesEngine>
Id string

The provider-assigned unique ID for this managed resource.

Filters List<GetDatabaseEnginesFilter>
Latest bool
Order string
OrderBy string
Engines []GetDatabaseEnginesEngine
Id string

The provider-assigned unique ID for this managed resource.

Filters []GetDatabaseEnginesFilter
Latest bool
Order string
OrderBy string
engines List<GetDatabaseEnginesEngine>
id String

The provider-assigned unique ID for this managed resource.

filters List<GetDatabaseEnginesFilter>
latest Boolean
order String
orderBy String
engines GetDatabaseEnginesEngine[]
id string

The provider-assigned unique ID for this managed resource.

filters GetDatabaseEnginesFilter[]
latest boolean
order string
orderBy string
engines Sequence[GetDatabaseEnginesEngine]
id str

The provider-assigned unique ID for this managed resource.

filters Sequence[GetDatabaseEnginesFilter]
latest bool
order str
order_by str
engines List<Property Map>
id String

The provider-assigned unique ID for this managed resource.

filters List<Property Map>
latest Boolean
order String
orderBy String

Supporting Types

GetDatabaseEnginesEngine

Engine string

The Managed Database engine type.

Id string

The Managed Database engine ID in engine/version format.

Version string

The Managed Database engine version.

Engine string

The Managed Database engine type.

Id string

The Managed Database engine ID in engine/version format.

Version string

The Managed Database engine version.

engine String

The Managed Database engine type.

id String

The Managed Database engine ID in engine/version format.

version String

The Managed Database engine version.

engine string

The Managed Database engine type.

id string

The Managed Database engine ID in engine/version format.

version string

The Managed Database engine version.

engine str

The Managed Database engine type.

id str

The Managed Database engine ID in engine/version format.

version str

The Managed Database engine version.

engine String

The Managed Database engine type.

id String

The Managed Database engine ID in engine/version format.

version String

The Managed Database engine version.

GetDatabaseEnginesFilter

Name string

The name of the field to filter by.

Values List<string>

A list of values for the filter to allow. These values should all be in string form.

MatchBy string

The method to match the field by. (exact, regex, substring; default exact)

Name string

The name of the field to filter by.

Values []string

A list of values for the filter to allow. These values should all be in string form.

MatchBy string

The method to match the field by. (exact, regex, substring; default exact)

name String

The name of the field to filter by.

values List<String>

A list of values for the filter to allow. These values should all be in string form.

matchBy String

The method to match the field by. (exact, regex, substring; default exact)

name string

The name of the field to filter by.

values string[]

A list of values for the filter to allow. These values should all be in string form.

matchBy string

The method to match the field by. (exact, regex, substring; default exact)

name str

The name of the field to filter by.

values Sequence[str]

A list of values for the filter to allow. These values should all be in string form.

match_by str

The method to match the field by. (exact, regex, substring; default exact)

name String

The name of the field to filter by.

values List<String>

A list of values for the filter to allow. These values should all be in string form.

matchBy String

The method to match the field by. (exact, regex, substring; default exact)

Package Details

Repository
https://github.com/pulumi/pulumi-linode
License
Apache-2.0
Notes

This Pulumi package is based on the linode Terraform Provider.