1. Packages
  2. Scaleway
  3. API Docs
  4. DatabaseAcl
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

scaleway.DatabaseAcl

Explore with Pulumi AI

scaleway logo
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

    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.DatabaseInstance("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 mainDatabaseAcl = new scaleway.DatabaseAcl("main", {
        instanceId: main.id,
        aclRules: [{
            ip: "1.2.3.4/32",
            description: "foo",
        }],
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    main = scaleway.DatabaseInstance("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_database_acl = scaleway.DatabaseAcl("main",
        instance_id=main.id,
        acl_rules=[{
            "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 {
    		main, err := scaleway.NewDatabaseInstance(ctx, "main", &scaleway.DatabaseInstanceArgs{
    			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 = scaleway.NewDatabaseAcl(ctx, "main", &scaleway.DatabaseAclArgs{
    			InstanceId: main.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 main = new Scaleway.DatabaseInstance("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 mainDatabaseAcl = new Scaleway.DatabaseAcl("main", new()
        {
            InstanceId = main.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 main = new DatabaseInstance("main", DatabaseInstanceArgs.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 mainDatabaseAcl = new DatabaseAcl("mainDatabaseAcl", DatabaseAclArgs.builder()
                .instanceId(main.id())
                .aclRules(DatabaseAclAclRuleArgs.builder()
                    .ip("1.2.3.4/32")
                    .description("foo")
                    .build())
                .build());
    
        }
    }
    
    resources:
      main:
        type: scaleway:DatabaseInstance
        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
      mainDatabaseAcl:
        type: scaleway:DatabaseAcl
        name: main
        properties:
          instanceId: ${main.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=[{
            "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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The DatabaseAcl resource accepts the following input properties:

    AclRules List<Pulumiverse.Scaleway.Inputs.DatabaseAclAclRule>
    A list of ACLs (structure is described below)
    InstanceId 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.
    AclRules []DatabaseAclAclRuleArgs
    A list of ACLs (structure is described below)
    InstanceId 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.
    aclRules List<DatabaseAclAclRule>
    A list of ACLs (structure is described below)
    instanceId 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.
    aclRules DatabaseAclAclRule[]
    A list of ACLs (structure is described below)
    instanceId 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[DatabaseAclAclRuleArgs]
    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.
    aclRules List<Property Map>
    A list of ACLs (structure is described below)
    instanceId 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.
    The following state arguments are supported:
    AclRules List<Pulumiverse.Scaleway.Inputs.DatabaseAclAclRule>
    A list of ACLs (structure is described below)
    InstanceId 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.
    AclRules []DatabaseAclAclRuleArgs
    A list of ACLs (structure is described below)
    InstanceId 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.
    aclRules List<DatabaseAclAclRule>
    A list of ACLs (structure is described below)
    instanceId 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.
    aclRules DatabaseAclAclRule[]
    A list of ACLs (structure is described below)
    instanceId 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[DatabaseAclAclRuleArgs]
    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.
    aclRules List<Property Map>
    A list of ACLs (structure is described below)
    instanceId 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.
    scaleway logo
    Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse