1. Packages
  2. Scaleway
  3. API Docs
  4. DatabaseAcl
Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse

scaleway.DatabaseAcl

Explore with Pulumi AI

scaleway logo
Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse

    Creates and manages Scaleway Database instance authorized IPs. For more information, see the documentation.

    Example Usage

    Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const main = new scaleway.DatabaseAcl("main", {
        instanceId: scaleway_rdb_instance.main.id,
        aclRules: [{
            ip: "1.2.3.4/32",
            description: "foo",
        }],
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    main = scaleway.DatabaseAcl("main",
        instance_id=scaleway_rdb_instance["main"]["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 {
    		_, err := scaleway.NewDatabaseAcl(ctx, "main", &scaleway.DatabaseAclArgs{
    			InstanceId: pulumi.Any(scaleway_rdb_instance.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.DatabaseAcl("main", new()
        {
            InstanceId = scaleway_rdb_instance.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.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 DatabaseAcl("main", DatabaseAclArgs.builder()        
                .instanceId(scaleway_rdb_instance.main().id())
                .aclRules(DatabaseAclAclRuleArgs.builder()
                    .ip("1.2.3.4/32")
                    .description("foo")
                    .build())
                .build());
    
        }
    }
    
    resources:
      main:
        type: scaleway:DatabaseAcl
        properties:
          instanceId: ${scaleway_rdb_instance.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.

    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:

    AclRules List<Pulumiverse.Scaleway.Inputs.DatabaseAclAclRule>
    A list of ACLs (structure is described below)
    InstanceId string

    UUID of the rdb 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 rdb 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 rdb 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 rdb 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 rdb 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 rdb 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 rdb 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 rdb 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 rdb 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 rdb 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 rdb 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 rdb 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.14.0 published on Thursday, Jun 6, 2024 by pulumiverse