scaleway.DatabaseAcl
Explore with Pulumi AI
Creates and manages Scaleway Database instance authorized IPs. For more information refer to the API documentation.
Example Usage
Basic
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";
const mainDatabaseInstance = new scaleway.DatabaseInstance("mainDatabaseInstance", {
nodeType: "DB-DEV-S",
engine: "PostgreSQL-15",
isHaCluster: true,
disableBackup: true,
userName: "my_initial_user",
password: "thiZ_is_v&ry_s3cret",
});
const mainDatabaseAcl = new scaleway.DatabaseAcl("mainDatabaseAcl", {
instanceId: mainDatabaseInstance.id,
aclRules: [{
ip: "1.2.3.4/32",
description: "foo",
}],
});
import pulumi
import pulumiverse_scaleway as scaleway
main_database_instance = scaleway.DatabaseInstance("mainDatabaseInstance",
node_type="DB-DEV-S",
engine="PostgreSQL-15",
is_ha_cluster=True,
disable_backup=True,
user_name="my_initial_user",
password="thiZ_is_v&ry_s3cret")
main_database_acl = scaleway.DatabaseAcl("mainDatabaseAcl",
instance_id=main_database_instance.id,
acl_rules=[scaleway.DatabaseAclAclRuleArgs(
ip="1.2.3.4/32",
description="foo",
)])
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
mainDatabaseInstance, err := scaleway.NewDatabaseInstance(ctx, "mainDatabaseInstance", &scaleway.DatabaseInstanceArgs{
NodeType: pulumi.String("DB-DEV-S"),
Engine: pulumi.String("PostgreSQL-15"),
IsHaCluster: pulumi.Bool(true),
DisableBackup: pulumi.Bool(true),
UserName: pulumi.String("my_initial_user"),
Password: pulumi.String("thiZ_is_v&ry_s3cret"),
})
if err != nil {
return err
}
_, err = scaleway.NewDatabaseAcl(ctx, "mainDatabaseAcl", &scaleway.DatabaseAclArgs{
InstanceId: mainDatabaseInstance.ID(),
AclRules: scaleway.DatabaseAclAclRuleArray{
&scaleway.DatabaseAclAclRuleArgs{
Ip: pulumi.String("1.2.3.4/32"),
Description: pulumi.String("foo"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;
return await Deployment.RunAsync(() =>
{
var mainDatabaseInstance = new Scaleway.DatabaseInstance("mainDatabaseInstance", new()
{
NodeType = "DB-DEV-S",
Engine = "PostgreSQL-15",
IsHaCluster = true,
DisableBackup = true,
UserName = "my_initial_user",
Password = "thiZ_is_v&ry_s3cret",
});
var mainDatabaseAcl = new Scaleway.DatabaseAcl("mainDatabaseAcl", new()
{
InstanceId = mainDatabaseInstance.Id,
AclRules = new[]
{
new Scaleway.Inputs.DatabaseAclAclRuleArgs
{
Ip = "1.2.3.4/32",
Description = "foo",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.DatabaseInstance;
import com.pulumi.scaleway.DatabaseInstanceArgs;
import com.pulumi.scaleway.DatabaseAcl;
import com.pulumi.scaleway.DatabaseAclArgs;
import com.pulumi.scaleway.inputs.DatabaseAclAclRuleArgs;
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) {
var mainDatabaseInstance = new DatabaseInstance("mainDatabaseInstance", DatabaseInstanceArgs.builder()
.nodeType("DB-DEV-S")
.engine("PostgreSQL-15")
.isHaCluster(true)
.disableBackup(true)
.userName("my_initial_user")
.password("thiZ_is_v&ry_s3cret")
.build());
var mainDatabaseAcl = new DatabaseAcl("mainDatabaseAcl", DatabaseAclArgs.builder()
.instanceId(mainDatabaseInstance.id())
.aclRules(DatabaseAclAclRuleArgs.builder()
.ip("1.2.3.4/32")
.description("foo")
.build())
.build());
}
}
resources:
mainDatabaseInstance:
type: scaleway:DatabaseInstance
properties:
nodeType: DB-DEV-S
engine: PostgreSQL-15
isHaCluster: true
disableBackup: true
userName: my_initial_user
password: thiZ_is_v&ry_s3cret
mainDatabaseAcl:
type: scaleway:DatabaseAcl
properties:
instanceId: ${mainDatabaseInstance.id}
aclRules:
- ip: 1.2.3.4/32
description: foo
Create DatabaseAcl Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DatabaseAcl(name: string, args: DatabaseAclArgs, opts?: CustomResourceOptions);
@overload
def DatabaseAcl(resource_name: str,
args: DatabaseAclArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DatabaseAcl(resource_name: str,
opts: Optional[ResourceOptions] = None,
acl_rules: Optional[Sequence[DatabaseAclAclRuleArgs]] = None,
instance_id: Optional[str] = None,
region: Optional[str] = None)
func NewDatabaseAcl(ctx *Context, name string, args DatabaseAclArgs, opts ...ResourceOption) (*DatabaseAcl, error)
public DatabaseAcl(string name, DatabaseAclArgs args, CustomResourceOptions? opts = null)
public DatabaseAcl(String name, DatabaseAclArgs args)
public DatabaseAcl(String name, DatabaseAclArgs args, CustomResourceOptions options)
type: scaleway:DatabaseAcl
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 DatabaseAclArgs
- 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 DatabaseAclArgs
- 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 DatabaseAclArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseAclArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DatabaseAclArgs
- 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 databaseAclResource = new Scaleway.DatabaseAcl("databaseAclResource", new()
{
AclRules = new[]
{
new Scaleway.Inputs.DatabaseAclAclRuleArgs
{
Ip = "string",
Description = "string",
},
},
InstanceId = "string",
Region = "string",
});
example, err := scaleway.NewDatabaseAcl(ctx, "databaseAclResource", &scaleway.DatabaseAclArgs{
AclRules: scaleway.DatabaseAclAclRuleArray{
&scaleway.DatabaseAclAclRuleArgs{
Ip: pulumi.String("string"),
Description: pulumi.String("string"),
},
},
InstanceId: pulumi.String("string"),
Region: pulumi.String("string"),
})
var databaseAclResource = new DatabaseAcl("databaseAclResource", DatabaseAclArgs.builder()
.aclRules(DatabaseAclAclRuleArgs.builder()
.ip("string")
.description("string")
.build())
.instanceId("string")
.region("string")
.build());
database_acl_resource = scaleway.DatabaseAcl("databaseAclResource",
acl_rules=[scaleway.DatabaseAclAclRuleArgs(
ip="string",
description="string",
)],
instance_id="string",
region="string")
const databaseAclResource = new scaleway.DatabaseAcl("databaseAclResource", {
aclRules: [{
ip: "string",
description: "string",
}],
instanceId: "string",
region: "string",
});
type: scaleway:DatabaseAcl
properties:
aclRules:
- description: string
ip: string
instanceId: string
region: string
DatabaseAcl 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 DatabaseAcl resource accepts the following input properties:
- Acl
Rules List<Pulumiverse.Scaleway. Inputs. Database Acl Acl Rule> - A list of ACLs (structure is described below)
- Instance
Id string UUID of the Database Instance.
Important: Updates to
instance_id
will recreate the Database ACL.- Region string
region
) The region in which the Database Instance should be created.
- Acl
Rules []DatabaseAcl Acl Rule Args - A list of ACLs (structure is described below)
- Instance
Id string UUID of the Database Instance.
Important: Updates to
instance_id
will recreate the Database ACL.- Region string
region
) The region in which the Database Instance should be created.
- acl
Rules List<DatabaseAcl Acl Rule> - A list of ACLs (structure is described below)
- instance
Id String UUID of the Database Instance.
Important: Updates to
instance_id
will recreate the Database ACL.- region String
region
) The region in which the Database Instance should be created.
- acl
Rules DatabaseAcl Acl Rule[] - A list of ACLs (structure is described below)
- instance
Id string UUID of the Database Instance.
Important: Updates to
instance_id
will recreate the Database ACL.- region string
region
) The region in which the Database Instance should be created.
- acl_
rules Sequence[DatabaseAcl Acl Rule Args] - A list of ACLs (structure is described below)
- instance_
id str UUID of the Database Instance.
Important: Updates to
instance_id
will recreate the Database ACL.- region str
region
) The region in which the Database Instance should be created.
- acl
Rules List<Property Map> - A list of ACLs (structure is described below)
- instance
Id String UUID of the Database Instance.
Important: Updates to
instance_id
will recreate the Database ACL.- region String
region
) The region in which the Database Instance should be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the DatabaseAcl 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 DatabaseAcl Resource
Get an existing DatabaseAcl 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?: DatabaseAclState, opts?: CustomResourceOptions): DatabaseAcl
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
acl_rules: Optional[Sequence[DatabaseAclAclRuleArgs]] = None,
instance_id: Optional[str] = None,
region: Optional[str] = None) -> DatabaseAcl
func GetDatabaseAcl(ctx *Context, name string, id IDInput, state *DatabaseAclState, opts ...ResourceOption) (*DatabaseAcl, error)
public static DatabaseAcl Get(string name, Input<string> id, DatabaseAclState? state, CustomResourceOptions? opts = null)
public static DatabaseAcl get(String name, Output<String> id, DatabaseAclState 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.
- Acl
Rules List<Pulumiverse.Scaleway. Inputs. Database Acl Acl Rule> - A list of ACLs (structure is described below)
- Instance
Id string UUID of the Database Instance.
Important: Updates to
instance_id
will recreate the Database ACL.- Region string
region
) The region in which the Database Instance should be created.
- Acl
Rules []DatabaseAcl Acl Rule Args - A list of ACLs (structure is described below)
- Instance
Id string UUID of the Database Instance.
Important: Updates to
instance_id
will recreate the Database ACL.- Region string
region
) The region in which the Database Instance should be created.
- acl
Rules List<DatabaseAcl Acl Rule> - A list of ACLs (structure is described below)
- instance
Id String UUID of the Database Instance.
Important: Updates to
instance_id
will recreate the Database ACL.- region String
region
) The region in which the Database Instance should be created.
- acl
Rules DatabaseAcl Acl Rule[] - A list of ACLs (structure is described below)
- instance
Id string UUID of the Database Instance.
Important: Updates to
instance_id
will recreate the Database ACL.- region string
region
) The region in which the Database Instance should be created.
- acl_
rules Sequence[DatabaseAcl Acl Rule Args] - A list of ACLs (structure is described below)
- instance_
id str UUID of the Database Instance.
Important: Updates to
instance_id
will recreate the Database ACL.- region str
region
) The region in which the Database Instance should be created.
- acl
Rules List<Property Map> - A list of ACLs (structure is described below)
- instance
Id String UUID of the Database Instance.
Important: Updates to
instance_id
will recreate the Database ACL.- region String
region
) The region in which the Database Instance should be created.
Supporting Types
DatabaseAclAclRule, DatabaseAclAclRuleArgs
- Ip string
- The IP range to whitelist in CIDR notation
- Description string
- A text describing this rule. Default description:
IP allowed
- Ip string
- The IP range to whitelist in CIDR notation
- Description string
- A text describing this rule. Default description:
IP allowed
- ip String
- The IP range to whitelist in CIDR notation
- description String
- A text describing this rule. Default description:
IP allowed
- ip string
- The IP range to whitelist in CIDR notation
- description string
- A text describing this rule. Default description:
IP allowed
- ip str
- The IP range to whitelist in CIDR notation
- description str
- A text describing this rule. Default description:
IP allowed
- ip String
- The IP range to whitelist in CIDR notation
- description String
- A text describing this rule. Default description:
IP allowed
Import
Database Instance can be imported using the {region}/{id}
, e.g.
bash
$ pulumi import scaleway:index/databaseAcl:DatabaseAcl acl01 fr-par/11111111-1111-1111-1111-111111111111
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- scaleway pulumiverse/pulumi-scaleway
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scaleway
Terraform Provider.