1. Packages
  2. Dbtcloud Provider
  3. API Docs
  4. IpRestrictionsRule
dbt Cloud v0.1.25 published on Friday, Nov 8, 2024 by Pulumi

dbtcloud.IpRestrictionsRule

Explore with Pulumi AI

dbtcloud logo
dbt Cloud v0.1.25 published on Friday, Nov 8, 2024 by Pulumi

    Manages IP restriction rules in dbt Cloud. IP restriction rules allow you to control access to your dbt Cloud instance based on IP address ranges.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dbtcloud from "@pulumi/dbtcloud";
    
    const test = new dbtcloud.IpRestrictionsRule("test", {
        name: "My restriction rule",
        description: "Important description",
        cidrs: [
            {
                cidr: "::ffff:106:708",
            },
            {
                cidr: "1.6.7.10/24",
            },
        ],
        type: "deny",
        ruleSetEnabled: false,
    });
    
    import pulumi
    import pulumi_dbtcloud as dbtcloud
    
    test = dbtcloud.IpRestrictionsRule("test",
        name="My restriction rule",
        description="Important description",
        cidrs=[
            {
                "cidr": "::ffff:106:708",
            },
            {
                "cidr": "1.6.7.10/24",
            },
        ],
        type="deny",
        rule_set_enabled=False)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-dbtcloud/sdk/go/dbtcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dbtcloud.NewIpRestrictionsRule(ctx, "test", &dbtcloud.IpRestrictionsRuleArgs{
    			Name:        pulumi.String("My restriction rule"),
    			Description: pulumi.String("Important description"),
    			Cidrs: dbtcloud.IpRestrictionsRuleCidrArray{
    				&dbtcloud.IpRestrictionsRuleCidrArgs{
    					Cidr: pulumi.String("::ffff:106:708"),
    				},
    				&dbtcloud.IpRestrictionsRuleCidrArgs{
    					Cidr: pulumi.String("1.6.7.10/24"),
    				},
    			},
    			Type:           pulumi.String("deny"),
    			RuleSetEnabled: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DbtCloud = Pulumi.DbtCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new DbtCloud.IpRestrictionsRule("test", new()
        {
            Name = "My restriction rule",
            Description = "Important description",
            Cidrs = new[]
            {
                new DbtCloud.Inputs.IpRestrictionsRuleCidrArgs
                {
                    Cidr = "::ffff:106:708",
                },
                new DbtCloud.Inputs.IpRestrictionsRuleCidrArgs
                {
                    Cidr = "1.6.7.10/24",
                },
            },
            Type = "deny",
            RuleSetEnabled = false,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dbtcloud.IpRestrictionsRule;
    import com.pulumi.dbtcloud.IpRestrictionsRuleArgs;
    import com.pulumi.dbtcloud.inputs.IpRestrictionsRuleCidrArgs;
    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 test = new IpRestrictionsRule("test", IpRestrictionsRuleArgs.builder()
                .name("My restriction rule")
                .description("Important description")
                .cidrs(            
                    IpRestrictionsRuleCidrArgs.builder()
                        .cidr("::ffff:106:708")
                        .build(),
                    IpRestrictionsRuleCidrArgs.builder()
                        .cidr("1.6.7.10/24")
                        .build())
                .type("deny")
                .ruleSetEnabled(false)
                .build());
    
        }
    }
    
    resources:
      test:
        type: dbtcloud:IpRestrictionsRule
        properties:
          name: My restriction rule
          description: Important description
          cidrs:
            - cidr: ::ffff:106:708
            - cidr: 1.6.7.10/24
          type: deny
          ruleSetEnabled: false
    

    Create IpRestrictionsRule Resource

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

    Constructor syntax

    new IpRestrictionsRule(name: string, args: IpRestrictionsRuleArgs, opts?: CustomResourceOptions);
    @overload
    def IpRestrictionsRule(resource_name: str,
                           args: IpRestrictionsRuleArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def IpRestrictionsRule(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           cidrs: Optional[Sequence[IpRestrictionsRuleCidrArgs]] = None,
                           rule_set_enabled: Optional[bool] = None,
                           type: Optional[str] = None,
                           description: Optional[str] = None,
                           name: Optional[str] = None)
    func NewIpRestrictionsRule(ctx *Context, name string, args IpRestrictionsRuleArgs, opts ...ResourceOption) (*IpRestrictionsRule, error)
    public IpRestrictionsRule(string name, IpRestrictionsRuleArgs args, CustomResourceOptions? opts = null)
    public IpRestrictionsRule(String name, IpRestrictionsRuleArgs args)
    public IpRestrictionsRule(String name, IpRestrictionsRuleArgs args, CustomResourceOptions options)
    
    type: dbtcloud:IpRestrictionsRule
    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 IpRestrictionsRuleArgs
    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 IpRestrictionsRuleArgs
    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 IpRestrictionsRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IpRestrictionsRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IpRestrictionsRuleArgs
    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 ipRestrictionsRuleResource = new DbtCloud.IpRestrictionsRule("ipRestrictionsRuleResource", new()
    {
        Cidrs = new[]
        {
            new DbtCloud.Inputs.IpRestrictionsRuleCidrArgs
            {
                Cidr = "string",
                CidrIpv6 = "string",
                Id = 0,
                IpRestrictionRuleId = 0,
            },
        },
        RuleSetEnabled = false,
        Type = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := dbtcloud.NewIpRestrictionsRule(ctx, "ipRestrictionsRuleResource", &dbtcloud.IpRestrictionsRuleArgs{
    	Cidrs: dbtcloud.IpRestrictionsRuleCidrArray{
    		&dbtcloud.IpRestrictionsRuleCidrArgs{
    			Cidr:                pulumi.String("string"),
    			CidrIpv6:            pulumi.String("string"),
    			Id:                  pulumi.Int(0),
    			IpRestrictionRuleId: pulumi.Int(0),
    		},
    	},
    	RuleSetEnabled: pulumi.Bool(false),
    	Type:           pulumi.String("string"),
    	Description:    pulumi.String("string"),
    	Name:           pulumi.String("string"),
    })
    
    var ipRestrictionsRuleResource = new IpRestrictionsRule("ipRestrictionsRuleResource", IpRestrictionsRuleArgs.builder()
        .cidrs(IpRestrictionsRuleCidrArgs.builder()
            .cidr("string")
            .cidrIpv6("string")
            .id(0)
            .ipRestrictionRuleId(0)
            .build())
        .ruleSetEnabled(false)
        .type("string")
        .description("string")
        .name("string")
        .build());
    
    ip_restrictions_rule_resource = dbtcloud.IpRestrictionsRule("ipRestrictionsRuleResource",
        cidrs=[{
            "cidr": "string",
            "cidr_ipv6": "string",
            "id": 0,
            "ip_restriction_rule_id": 0,
        }],
        rule_set_enabled=False,
        type="string",
        description="string",
        name="string")
    
    const ipRestrictionsRuleResource = new dbtcloud.IpRestrictionsRule("ipRestrictionsRuleResource", {
        cidrs: [{
            cidr: "string",
            cidrIpv6: "string",
            id: 0,
            ipRestrictionRuleId: 0,
        }],
        ruleSetEnabled: false,
        type: "string",
        description: "string",
        name: "string",
    });
    
    type: dbtcloud:IpRestrictionsRule
    properties:
        cidrs:
            - cidr: string
              cidrIpv6: string
              id: 0
              ipRestrictionRuleId: 0
        description: string
        name: string
        ruleSetEnabled: false
        type: string
    

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

    Cidrs List<Pulumi.DbtCloud.Inputs.IpRestrictionsRuleCidr>
    Set of CIDR ranges for this rule
    RuleSetEnabled bool
    Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time.
    Type string
    The type of the IP restriction rule (allow or deny)
    Description string
    A description of the IP restriction rule
    Name string
    The name of the IP restriction rule
    Cidrs []IpRestrictionsRuleCidrArgs
    Set of CIDR ranges for this rule
    RuleSetEnabled bool
    Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time.
    Type string
    The type of the IP restriction rule (allow or deny)
    Description string
    A description of the IP restriction rule
    Name string
    The name of the IP restriction rule
    cidrs List<IpRestrictionsRuleCidr>
    Set of CIDR ranges for this rule
    ruleSetEnabled Boolean
    Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time.
    type String
    The type of the IP restriction rule (allow or deny)
    description String
    A description of the IP restriction rule
    name String
    The name of the IP restriction rule
    cidrs IpRestrictionsRuleCidr[]
    Set of CIDR ranges for this rule
    ruleSetEnabled boolean
    Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time.
    type string
    The type of the IP restriction rule (allow or deny)
    description string
    A description of the IP restriction rule
    name string
    The name of the IP restriction rule
    cidrs Sequence[IpRestrictionsRuleCidrArgs]
    Set of CIDR ranges for this rule
    rule_set_enabled bool
    Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time.
    type str
    The type of the IP restriction rule (allow or deny)
    description str
    A description of the IP restriction rule
    name str
    The name of the IP restriction rule
    cidrs List<Property Map>
    Set of CIDR ranges for this rule
    ruleSetEnabled Boolean
    Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time.
    type String
    The type of the IP restriction rule (allow or deny)
    description String
    A description of the IP restriction rule
    name String
    The name of the IP restriction rule

    Outputs

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

    Get an existing IpRestrictionsRule 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?: IpRestrictionsRuleState, opts?: CustomResourceOptions): IpRestrictionsRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cidrs: Optional[Sequence[IpRestrictionsRuleCidrArgs]] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            rule_set_enabled: Optional[bool] = None,
            type: Optional[str] = None) -> IpRestrictionsRule
    func GetIpRestrictionsRule(ctx *Context, name string, id IDInput, state *IpRestrictionsRuleState, opts ...ResourceOption) (*IpRestrictionsRule, error)
    public static IpRestrictionsRule Get(string name, Input<string> id, IpRestrictionsRuleState? state, CustomResourceOptions? opts = null)
    public static IpRestrictionsRule get(String name, Output<String> id, IpRestrictionsRuleState 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:
    Cidrs List<Pulumi.DbtCloud.Inputs.IpRestrictionsRuleCidr>
    Set of CIDR ranges for this rule
    Description string
    A description of the IP restriction rule
    Name string
    The name of the IP restriction rule
    RuleSetEnabled bool
    Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time.
    Type string
    The type of the IP restriction rule (allow or deny)
    Cidrs []IpRestrictionsRuleCidrArgs
    Set of CIDR ranges for this rule
    Description string
    A description of the IP restriction rule
    Name string
    The name of the IP restriction rule
    RuleSetEnabled bool
    Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time.
    Type string
    The type of the IP restriction rule (allow or deny)
    cidrs List<IpRestrictionsRuleCidr>
    Set of CIDR ranges for this rule
    description String
    A description of the IP restriction rule
    name String
    The name of the IP restriction rule
    ruleSetEnabled Boolean
    Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time.
    type String
    The type of the IP restriction rule (allow or deny)
    cidrs IpRestrictionsRuleCidr[]
    Set of CIDR ranges for this rule
    description string
    A description of the IP restriction rule
    name string
    The name of the IP restriction rule
    ruleSetEnabled boolean
    Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time.
    type string
    The type of the IP restriction rule (allow or deny)
    cidrs Sequence[IpRestrictionsRuleCidrArgs]
    Set of CIDR ranges for this rule
    description str
    A description of the IP restriction rule
    name str
    The name of the IP restriction rule
    rule_set_enabled bool
    Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time.
    type str
    The type of the IP restriction rule (allow or deny)
    cidrs List<Property Map>
    Set of CIDR ranges for this rule
    description String
    A description of the IP restriction rule
    name String
    The name of the IP restriction rule
    ruleSetEnabled Boolean
    Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time.
    type String
    The type of the IP restriction rule (allow or deny)

    Supporting Types

    IpRestrictionsRuleCidr, IpRestrictionsRuleCidrArgs

    Cidr string
    IP CIDR range (can be IPv4 or IPv6)
    CidrIpv6 string
    IPv6 CIDR range (read-only)
    Id int
    ID of the CIDR range
    IpRestrictionRuleId int
    ID of the IP restriction rule
    Cidr string
    IP CIDR range (can be IPv4 or IPv6)
    CidrIpv6 string
    IPv6 CIDR range (read-only)
    Id int
    ID of the CIDR range
    IpRestrictionRuleId int
    ID of the IP restriction rule
    cidr String
    IP CIDR range (can be IPv4 or IPv6)
    cidrIpv6 String
    IPv6 CIDR range (read-only)
    id Integer
    ID of the CIDR range
    ipRestrictionRuleId Integer
    ID of the IP restriction rule
    cidr string
    IP CIDR range (can be IPv4 or IPv6)
    cidrIpv6 string
    IPv6 CIDR range (read-only)
    id number
    ID of the CIDR range
    ipRestrictionRuleId number
    ID of the IP restriction rule
    cidr str
    IP CIDR range (can be IPv4 or IPv6)
    cidr_ipv6 str
    IPv6 CIDR range (read-only)
    id int
    ID of the CIDR range
    ip_restriction_rule_id int
    ID of the IP restriction rule
    cidr String
    IP CIDR range (can be IPv4 or IPv6)
    cidrIpv6 String
    IPv6 CIDR range (read-only)
    id Number
    ID of the CIDR range
    ipRestrictionRuleId Number
    ID of the IP restriction rule

    Import

    using import blocks (requires Terraform >= 1.5)

    import {

    to = dbtcloud_ip_restrictions_rule.my_rule

    id = “ip_restriction_rule_id”

    }

    import {

    to = dbtcloud_ip_restrictions_rule.my_rule

    id = “12345”

    }

    using the older import command

    $ pulumi import dbtcloud:index/ipRestrictionsRule:IpRestrictionsRule my_rule "ip_restriction_rule_id"
    
    $ pulumi import dbtcloud:index/ipRestrictionsRule:IpRestrictionsRule my_rule 12345
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    dbtcloud pulumi/pulumi-dbtcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dbtcloud Terraform Provider.
    dbtcloud logo
    dbt Cloud v0.1.25 published on Friday, Nov 8, 2024 by Pulumi