Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi
linode.getDatabases
Explore with Pulumi AI
Provides information about Linode Managed Databases that match a set of filters. For more information, see the Linode APIv4 docs.
Example Usage
Get information about all Linode Managed Databases:
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const all = linode.getDatabases({});
export const databaseIds = all.then(all => all.databases.map(__item => __item.id));
import pulumi
import pulumi_linode as linode
all = linode.get_databases()
pulumi.export("databaseIds", [__item.id for __item in all.databases])
package main
import (
"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
all, err := linode.GetDatabases(ctx, &linode.GetDatabasesArgs{
}, nil);
if err != nil {
return err
}
ctx.Export("databaseIds", pulumi.IntArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:3,11-30)))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;
return await Deployment.RunAsync(() =>
{
var all = Linode.GetDatabases.Invoke();
return new Dictionary<string, object?>
{
["databaseIds"] = all.Apply(getDatabasesResult => getDatabasesResult.Databases).Select(__item => __item.Id).ToList(),
};
});
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.GetDatabasesArgs;
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.getDatabases();
ctx.export("databaseIds", all.applyValue(getDatabasesResult -> getDatabasesResult.databases()).stream().map(element -> element.id()).collect(toList()));
}
}
Coming soon!
Get information about all Linode MySQL Databases:
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const mysql = linode.getDatabases({
filters: [{
name: "engine",
values: ["mysql"],
}],
});
export const databaseIds = mysql.then(mysql => mysql.databases.map(__item => __item.id));
import pulumi
import pulumi_linode as linode
mysql = linode.get_databases(filters=[{
"name": "engine",
"values": ["mysql"],
}])
pulumi.export("databaseIds", [__item.id for __item in mysql.databases])
package main
import (
"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
mysql, err := linode.GetDatabases(ctx, &linode.GetDatabasesArgs{
Filters: []linode.GetDatabasesFilter{
{
Name: "engine",
Values: []string{
"mysql",
},
},
},
}, nil);
if err != nil {
return err
}
ctx.Export("databaseIds", pulumi.IntArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:8,11-32)))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;
return await Deployment.RunAsync(() =>
{
var mysql = Linode.GetDatabases.Invoke(new()
{
Filters = new[]
{
new Linode.Inputs.GetDatabasesFilterInputArgs
{
Name = "engine",
Values = new[]
{
"mysql",
},
},
},
});
return new Dictionary<string, object?>
{
["databaseIds"] = mysql.Apply(getDatabasesResult => getDatabasesResult.Databases).Select(__item => __item.Id).ToList(),
};
});
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.GetDatabasesArgs;
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.getDatabases(GetDatabasesArgs.builder()
.filters(GetDatabasesFilterArgs.builder()
.name("engine")
.values("mysql")
.build())
.build());
ctx.export("databaseIds", mysql.applyValue(getDatabasesResult -> getDatabasesResult.databases()).stream().map(element -> element.id()).collect(toList()));
}
}
Coming soon!
Using getDatabases
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 getDatabases(args: GetDatabasesArgs, opts?: InvokeOptions): Promise<GetDatabasesResult>
function getDatabasesOutput(args: GetDatabasesOutputArgs, opts?: InvokeOptions): Output<GetDatabasesResult>
def get_databases(databases: Optional[Sequence[GetDatabasesDatabase]] = None,
filters: Optional[Sequence[GetDatabasesFilter]] = None,
order: Optional[str] = None,
order_by: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDatabasesResult
def get_databases_output(databases: Optional[pulumi.Input[Sequence[pulumi.Input[GetDatabasesDatabaseArgs]]]] = None,
filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetDatabasesFilterArgs]]]] = None,
order: Optional[pulumi.Input[str]] = None,
order_by: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDatabasesResult]
func GetDatabases(ctx *Context, args *GetDatabasesArgs, opts ...InvokeOption) (*GetDatabasesResult, error)
func GetDatabasesOutput(ctx *Context, args *GetDatabasesOutputArgs, opts ...InvokeOption) GetDatabasesResultOutput
> Note: This function is named GetDatabases
in the Go SDK.
public static class GetDatabases
{
public static Task<GetDatabasesResult> InvokeAsync(GetDatabasesArgs args, InvokeOptions? opts = null)
public static Output<GetDatabasesResult> Invoke(GetDatabasesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDatabasesResult> getDatabases(GetDatabasesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: linode:index/getDatabases:getDatabases
arguments:
# arguments dictionary
The following arguments are supported:
- Databases
List<Get
Databases Database> - Filters
List<Get
Databases Filter> - Order string
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - Order
By string - The attribute to order the results by. (
version
)
- Databases
[]Get
Databases Database - Filters
[]Get
Databases Filter - Order string
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - Order
By string - The attribute to order the results by. (
version
)
- databases
List<Get
Databases Database> - filters
List<Get
Databases Filter> - order String
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - order
By String - The attribute to order the results by. (
version
)
- databases
Get
Databases Database[] - filters
Get
Databases Filter[] - order string
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - order
By string - The attribute to order the results by. (
version
)
- databases
Sequence[Get
Databases Database] - filters
Sequence[Get
Databases Filter] - order str
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - order_
by str - The attribute to order the results by. (
version
)
- databases List<Property Map>
- filters List<Property Map>
- order String
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - order
By String - The attribute to order the results by. (
version
)
getDatabases Result
The following output properties are available:
- Id string
- The ID of the Managed Database.
- Databases
List<Get
Databases Database> - Filters
List<Get
Databases Filter> - Order string
- Order
By string
- Id string
- The ID of the Managed Database.
- Databases
[]Get
Databases Database - Filters
[]Get
Databases Filter - Order string
- Order
By string
- id String
- The ID of the Managed Database.
- databases
List<Get
Databases Database> - filters
List<Get
Databases Filter> - order String
- order
By String
- id string
- The ID of the Managed Database.
- databases
Get
Databases Database[] - filters
Get
Databases Filter[] - order string
- order
By string
- id str
- The ID of the Managed Database.
- databases
Sequence[Get
Databases Database] - filters
Sequence[Get
Databases Filter] - order str
- order_
by str
- id String
- The ID of the Managed Database.
- databases List<Property Map>
- filters List<Property Map>
- order String
- order
By String
Supporting Types
GetDatabasesDatabase
- Allow
Lists List<string> - A list of IP addresses that can access the Managed Database.
- Cluster
Size int - The number of Linode Instance nodes deployed to the Managed Database.
- Created string
- When this Managed Database was created.
- Encrypted bool
- Whether the Managed Databases is encrypted.
- Engine string
- The Managed Database engine.
- Host
Primary string - The primary host for the Managed Database.
- Host
Secondary string - The secondary/private network host for the Managed Database.
- Id int
- The ID of the Managed Database.
- Instance
Uri string - he API route for the database instance.
- Label string
- A unique, user-defined string referring to the Managed Database.
- Region string
- The region to use for the Managed Database.
- Replication
Type string - The replication method used for the Managed Database.
- Ssl
Connection bool - Whether to require SSL credentials to establish a connection to the Managed Database.
- Status string
- The operating status of the Managed Database.
- Type string
- The Linode Instance type used for the nodes of the Managed Database instance.
- Updated string
- When this Managed Database was last updated.
- Version string
- The Managed Database engine version.
- Allow
Lists []string - A list of IP addresses that can access the Managed Database.
- Cluster
Size int - The number of Linode Instance nodes deployed to the Managed Database.
- Created string
- When this Managed Database was created.
- Encrypted bool
- Whether the Managed Databases is encrypted.
- Engine string
- The Managed Database engine.
- Host
Primary string - The primary host for the Managed Database.
- Host
Secondary string - The secondary/private network host for the Managed Database.
- Id int
- The ID of the Managed Database.
- Instance
Uri string - he API route for the database instance.
- Label string
- A unique, user-defined string referring to the Managed Database.
- Region string
- The region to use for the Managed Database.
- Replication
Type string - The replication method used for the Managed Database.
- Ssl
Connection bool - Whether to require SSL credentials to establish a connection to the Managed Database.
- Status string
- The operating status of the Managed Database.
- Type string
- The Linode Instance type used for the nodes of the Managed Database instance.
- Updated string
- When this Managed Database was last updated.
- Version string
- The Managed Database engine version.
- allow
Lists List<String> - A list of IP addresses that can access the Managed Database.
- cluster
Size Integer - The number of Linode Instance nodes deployed to the Managed Database.
- created String
- When this Managed Database was created.
- encrypted Boolean
- Whether the Managed Databases is encrypted.
- engine String
- The Managed Database engine.
- host
Primary String - The primary host for the Managed Database.
- host
Secondary String - The secondary/private network host for the Managed Database.
- id Integer
- The ID of the Managed Database.
- instance
Uri String - he API route for the database instance.
- label String
- A unique, user-defined string referring to the Managed Database.
- region String
- The region to use for the Managed Database.
- replication
Type String - The replication method used for the Managed Database.
- ssl
Connection Boolean - Whether to require SSL credentials to establish a connection to the Managed Database.
- status String
- The operating status of the Managed Database.
- type String
- The Linode Instance type used for the nodes of the Managed Database instance.
- updated String
- When this Managed Database was last updated.
- version String
- The Managed Database engine version.
- allow
Lists string[] - A list of IP addresses that can access the Managed Database.
- cluster
Size number - The number of Linode Instance nodes deployed to the Managed Database.
- created string
- When this Managed Database was created.
- encrypted boolean
- Whether the Managed Databases is encrypted.
- engine string
- The Managed Database engine.
- host
Primary string - The primary host for the Managed Database.
- host
Secondary string - The secondary/private network host for the Managed Database.
- id number
- The ID of the Managed Database.
- instance
Uri string - he API route for the database instance.
- label string
- A unique, user-defined string referring to the Managed Database.
- region string
- The region to use for the Managed Database.
- replication
Type string - The replication method used for the Managed Database.
- ssl
Connection boolean - Whether to require SSL credentials to establish a connection to the Managed Database.
- status string
- The operating status of the Managed Database.
- type string
- The Linode Instance type used for the nodes of the Managed Database instance.
- updated string
- When this Managed Database was last updated.
- version string
- The Managed Database engine version.
- allow_
lists Sequence[str] - A list of IP addresses that can access the Managed Database.
- cluster_
size int - The number of Linode Instance nodes deployed to the Managed Database.
- created str
- When this Managed Database was created.
- encrypted bool
- Whether the Managed Databases is encrypted.
- engine str
- The Managed Database engine.
- host_
primary str - The primary host for the Managed Database.
- host_
secondary str - The secondary/private network host for the Managed Database.
- id int
- The ID of the Managed Database.
- instance_
uri str - he API route for the database instance.
- label str
- A unique, user-defined string referring to the Managed Database.
- region str
- The region to use for the Managed Database.
- replication_
type str - The replication method used for the Managed Database.
- ssl_
connection bool - Whether to require SSL credentials to establish a connection to the Managed Database.
- status str
- The operating status of the Managed Database.
- type str
- The Linode Instance type used for the nodes of the Managed Database instance.
- updated str
- When this Managed Database was last updated.
- version str
- The Managed Database engine version.
- allow
Lists List<String> - A list of IP addresses that can access the Managed Database.
- cluster
Size Number - The number of Linode Instance nodes deployed to the Managed Database.
- created String
- When this Managed Database was created.
- encrypted Boolean
- Whether the Managed Databases is encrypted.
- engine String
- The Managed Database engine.
- host
Primary String - The primary host for the Managed Database.
- host
Secondary String - The secondary/private network host for the Managed Database.
- id Number
- The ID of the Managed Database.
- instance
Uri String - he API route for the database instance.
- label String
- A unique, user-defined string referring to the Managed Database.
- region String
- The region to use for the Managed Database.
- replication
Type String - The replication method used for the Managed Database.
- ssl
Connection Boolean - Whether to require SSL credentials to establish a connection to the Managed Database.
- status String
- The operating status of the Managed Database.
- type String
- The Linode Instance type used for the nodes of the Managed Database instance.
- updated String
- When this Managed Database was last updated.
- version String
- The Managed Database engine version.
GetDatabasesFilter
Package Details
- Repository
- Linode pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
linode
Terraform Provider.