1. Packages
  2. Scaleway
  3. API Docs
  4. databases
  5. Acl
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

scaleway.databases.Acl

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 main = new scaleway.databases.Instance("main", {
    name: "test-rdb",
    nodeType: "DB-DEV-S",
    engine: "PostgreSQL-15",
    isHaCluster: true,
    disableBackup: true,
    userName: "my_initial_user",
    password: "thiZ_is_v&ry_s3cret",
});
const mainAcl = new scaleway.databases.Acl("main", {
    instanceId: main.id,
    aclRules: [{
        ip: "1.2.3.4/32",
        description: "foo",
    }],
});
Copy
import pulumi
import pulumiverse_scaleway as scaleway

main = scaleway.databases.Instance("main",
    name="test-rdb",
    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_acl = scaleway.databases.Acl("main",
    instance_id=main.id,
    acl_rules=[{
        "ip": "1.2.3.4/32",
        "description": "foo",
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/databases"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		main, err := databases.NewInstance(ctx, "main", &databases.InstanceArgs{
			Name:          pulumi.String("test-rdb"),
			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 = databases.NewAcl(ctx, "main", &databases.AclArgs{
			InstanceId: main.ID(),
			AclRules: databases.AclAclRuleArray{
				&databases.AclAclRuleArgs{
					Ip:          pulumi.String("1.2.3.4/32"),
					Description: pulumi.String("foo"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;

return await Deployment.RunAsync(() => 
{
    var main = new Scaleway.Databases.Instance("main", new()
    {
        Name = "test-rdb",
        NodeType = "DB-DEV-S",
        Engine = "PostgreSQL-15",
        IsHaCluster = true,
        DisableBackup = true,
        UserName = "my_initial_user",
        Password = "thiZ_is_v&ry_s3cret",
    });

    var mainAcl = new Scaleway.Databases.Acl("main", new()
    {
        InstanceId = main.Id,
        AclRules = new[]
        {
            new Scaleway.Databases.Inputs.AclAclRuleArgs
            {
                Ip = "1.2.3.4/32",
                Description = "foo",
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.databases.Instance;
import com.pulumi.scaleway.databases.InstanceArgs;
import com.pulumi.scaleway.databases.Acl;
import com.pulumi.scaleway.databases.AclArgs;
import com.pulumi.scaleway.databases.inputs.AclAclRuleArgs;
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 main = new Instance("main", InstanceArgs.builder()
            .name("test-rdb")
            .nodeType("DB-DEV-S")
            .engine("PostgreSQL-15")
            .isHaCluster(true)
            .disableBackup(true)
            .userName("my_initial_user")
            .password("thiZ_is_v&ry_s3cret")
            .build());

        var mainAcl = new Acl("mainAcl", AclArgs.builder()
            .instanceId(main.id())
            .aclRules(AclAclRuleArgs.builder()
                .ip("1.2.3.4/32")
                .description("foo")
                .build())
            .build());

    }
}
Copy
resources:
  main:
    type: scaleway:databases:Instance
    properties:
      name: test-rdb
      nodeType: DB-DEV-S
      engine: PostgreSQL-15
      isHaCluster: true
      disableBackup: true
      userName: my_initial_user
      password: thiZ_is_v&ry_s3cret
  mainAcl:
    type: scaleway:databases:Acl
    name: main
    properties:
      instanceId: ${main.id}
      aclRules:
        - ip: 1.2.3.4/32
          description: foo
Copy

Create Acl Resource

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

Constructor syntax

new Acl(name: string, args: AclArgs, opts?: CustomResourceOptions);
@overload
def Acl(resource_name: str,
        args: AclArgs,
        opts: Optional[ResourceOptions] = None)

@overload
def Acl(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        acl_rules: Optional[Sequence[AclAclRuleArgs]] = None,
        instance_id: Optional[str] = None,
        region: Optional[str] = None)
func NewAcl(ctx *Context, name string, args AclArgs, opts ...ResourceOption) (*Acl, error)
public Acl(string name, AclArgs args, CustomResourceOptions? opts = null)
public Acl(String name, AclArgs args)
public Acl(String name, AclArgs args, CustomResourceOptions options)
type: scaleway:databases:Acl
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. AclArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. AclArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. AclArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AclArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AclArgs
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 aclResource = new Scaleway.Databases.Acl("aclResource", new()
{
    AclRules = new[]
    {
        new Scaleway.Databases.Inputs.AclAclRuleArgs
        {
            Ip = "string",
            Description = "string",
        },
    },
    InstanceId = "string",
    Region = "string",
});
Copy
example, err := databases.NewAcl(ctx, "aclResource", &databases.AclArgs{
	AclRules: databases.AclAclRuleArray{
		&databases.AclAclRuleArgs{
			Ip:          pulumi.String("string"),
			Description: pulumi.String("string"),
		},
	},
	InstanceId: pulumi.String("string"),
	Region:     pulumi.String("string"),
})
Copy
var aclResource = new Acl("aclResource", AclArgs.builder()
    .aclRules(AclAclRuleArgs.builder()
        .ip("string")
        .description("string")
        .build())
    .instanceId("string")
    .region("string")
    .build());
Copy
acl_resource = scaleway.databases.Acl("aclResource",
    acl_rules=[{
        "ip": "string",
        "description": "string",
    }],
    instance_id="string",
    region="string")
Copy
const aclResource = new scaleway.databases.Acl("aclResource", {
    aclRules: [{
        ip: "string",
        description: "string",
    }],
    instanceId: "string",
    region: "string",
});
Copy
type: scaleway:databases:Acl
properties:
    aclRules:
        - description: string
          ip: string
    instanceId: string
    region: string
Copy

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

AclRules This property is required. List<Pulumiverse.Scaleway.Databases.Inputs.AclAclRule>
A list of ACLs (structure is described below)
InstanceId
This property is required.
Changes to this property will trigger replacement.
string

UUID of the Database Instance.

Important: Updates to instance_id will recreate the Database ACL.

Region Changes to this property will trigger replacement. string
region) The region in which the Database Instance should be created.
AclRules This property is required. []AclAclRuleArgs
A list of ACLs (structure is described below)
InstanceId
This property is required.
Changes to this property will trigger replacement.
string

UUID of the Database Instance.

Important: Updates to instance_id will recreate the Database ACL.

Region Changes to this property will trigger replacement. string
region) The region in which the Database Instance should be created.
aclRules This property is required. List<AclAclRule>
A list of ACLs (structure is described below)
instanceId
This property is required.
Changes to this property will trigger replacement.
String

UUID of the Database Instance.

Important: Updates to instance_id will recreate the Database ACL.

region Changes to this property will trigger replacement. String
region) The region in which the Database Instance should be created.
aclRules This property is required. AclAclRule[]
A list of ACLs (structure is described below)
instanceId
This property is required.
Changes to this property will trigger replacement.
string

UUID of the Database Instance.

Important: Updates to instance_id will recreate the Database ACL.

region Changes to this property will trigger replacement. string
region) The region in which the Database Instance should be created.
acl_rules This property is required. Sequence[AclAclRuleArgs]
A list of ACLs (structure is described below)
instance_id
This property is required.
Changes to this property will trigger replacement.
str

UUID of the Database Instance.

Important: Updates to instance_id will recreate the Database ACL.

region Changes to this property will trigger replacement. str
region) The region in which the Database Instance should be created.
aclRules This property is required. List<Property Map>
A list of ACLs (structure is described below)
instanceId
This property is required.
Changes to this property will trigger replacement.
String

UUID of the Database Instance.

Important: Updates to instance_id will recreate the Database ACL.

region Changes to this property will trigger replacement. String
region) The region in which the Database Instance should be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the Acl 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 Acl Resource

Get an existing Acl 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?: AclState, opts?: CustomResourceOptions): Acl
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        acl_rules: Optional[Sequence[AclAclRuleArgs]] = None,
        instance_id: Optional[str] = None,
        region: Optional[str] = None) -> Acl
func GetAcl(ctx *Context, name string, id IDInput, state *AclState, opts ...ResourceOption) (*Acl, error)
public static Acl Get(string name, Input<string> id, AclState? state, CustomResourceOptions? opts = null)
public static Acl get(String name, Output<String> id, AclState state, CustomResourceOptions options)
resources:  _:    type: scaleway:databases:Acl    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
AclRules List<Pulumiverse.Scaleway.Databases.Inputs.AclAclRule>
A list of ACLs (structure is described below)
InstanceId Changes to this property will trigger replacement. string

UUID of the Database Instance.

Important: Updates to instance_id will recreate the Database ACL.

Region Changes to this property will trigger replacement. string
region) The region in which the Database Instance should be created.
AclRules []AclAclRuleArgs
A list of ACLs (structure is described below)
InstanceId Changes to this property will trigger replacement. string

UUID of the Database Instance.

Important: Updates to instance_id will recreate the Database ACL.

Region Changes to this property will trigger replacement. string
region) The region in which the Database Instance should be created.
aclRules List<AclAclRule>
A list of ACLs (structure is described below)
instanceId Changes to this property will trigger replacement. String

UUID of the Database Instance.

Important: Updates to instance_id will recreate the Database ACL.

region Changes to this property will trigger replacement. String
region) The region in which the Database Instance should be created.
aclRules AclAclRule[]
A list of ACLs (structure is described below)
instanceId Changes to this property will trigger replacement. string

UUID of the Database Instance.

Important: Updates to instance_id will recreate the Database ACL.

region Changes to this property will trigger replacement. string
region) The region in which the Database Instance should be created.
acl_rules Sequence[AclAclRuleArgs]
A list of ACLs (structure is described below)
instance_id Changes to this property will trigger replacement. str

UUID of the Database Instance.

Important: Updates to instance_id will recreate the Database ACL.

region Changes to this property will trigger replacement. str
region) The region in which the Database Instance should be created.
aclRules List<Property Map>
A list of ACLs (structure is described below)
instanceId Changes to this property will trigger replacement. String

UUID of the Database Instance.

Important: Updates to instance_id will recreate the Database ACL.

region Changes to this property will trigger replacement. String
region) The region in which the Database Instance should be created.

Supporting Types

AclAclRule
, AclAclRuleArgs

Ip This property is required. string
The IP range to whitelist in CIDR notation
Description string
A text describing this rule. Default description: IP allowed
Ip This property is required. string
The IP range to whitelist in CIDR notation
Description string
A text describing this rule. Default description: IP allowed
ip This property is required. String
The IP range to whitelist in CIDR notation
description String
A text describing this rule. Default description: IP allowed
ip This property is required. string
The IP range to whitelist in CIDR notation
description string
A text describing this rule. Default description: IP allowed
ip This property is required. str
The IP range to whitelist in CIDR notation
description str
A text describing this rule. Default description: IP allowed
ip This property is required. 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:databases/acl:Acl acl01 fr-par/11111111-1111-1111-1111-111111111111
Copy

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.