1. Packages
  2. NS1
  3. API Docs
  4. AccountWhitelist
NS1 v3.2.1 published on Thursday, Apr 4, 2024 by Pulumi

ns1.AccountWhitelist

Explore with Pulumi AI

ns1 logo
NS1 v3.2.1 published on Thursday, Apr 4, 2024 by Pulumi

    Provides a NS1 Global IP Whitelist resource.

    This can be used to create, modify, and delete Global IP Whitelists.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ns1 from "@pulumi/ns1";
    
    const example = new ns1.AccountWhitelist("example", {values: [
        "1.1.1.1",
        "2.2.2.2",
    ]});
    
    import pulumi
    import pulumi_ns1 as ns1
    
    example = ns1.AccountWhitelist("example", values=[
        "1.1.1.1",
        "2.2.2.2",
    ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-ns1/sdk/v3/go/ns1"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ns1.NewAccountWhitelist(ctx, "example", &ns1.AccountWhitelistArgs{
    			Values: pulumi.StringArray{
    				pulumi.String("1.1.1.1"),
    				pulumi.String("2.2.2.2"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ns1 = Pulumi.Ns1;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Ns1.AccountWhitelist("example", new()
        {
            Values = new[]
            {
                "1.1.1.1",
                "2.2.2.2",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ns1.AccountWhitelist;
    import com.pulumi.ns1.AccountWhitelistArgs;
    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 example = new AccountWhitelist("example", AccountWhitelistArgs.builder()        
                .values(            
                    "1.1.1.1",
                    "2.2.2.2")
                .build());
    
        }
    }
    
    resources:
      example:
        type: ns1:AccountWhitelist
        properties:
          values:
            - 1.1.1.1
            - 2.2.2.2
    

    You current source IP must be present in one of the whitelists to prevent locking yourself out.

    NS1 Documentation

    Global IP Whitelist Doc

    Create AccountWhitelist Resource

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

    Constructor syntax

    new AccountWhitelist(name: string, args: AccountWhitelistArgs, opts?: CustomResourceOptions);
    @overload
    def AccountWhitelist(resource_name: str,
                         args: AccountWhitelistArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def AccountWhitelist(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         values: Optional[Sequence[str]] = None,
                         name: Optional[str] = None)
    func NewAccountWhitelist(ctx *Context, name string, args AccountWhitelistArgs, opts ...ResourceOption) (*AccountWhitelist, error)
    public AccountWhitelist(string name, AccountWhitelistArgs args, CustomResourceOptions? opts = null)
    public AccountWhitelist(String name, AccountWhitelistArgs args)
    public AccountWhitelist(String name, AccountWhitelistArgs args, CustomResourceOptions options)
    
    type: ns1:AccountWhitelist
    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 AccountWhitelistArgs
    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 AccountWhitelistArgs
    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 AccountWhitelistArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AccountWhitelistArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AccountWhitelistArgs
    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 accountWhitelistResource = new Ns1.AccountWhitelist("accountWhitelistResource", new()
    {
        Values = new[]
        {
            "string",
        },
        Name = "string",
    });
    
    example, err := ns1.NewAccountWhitelist(ctx, "accountWhitelistResource", &ns1.AccountWhitelistArgs{
    	Values: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    })
    
    var accountWhitelistResource = new AccountWhitelist("accountWhitelistResource", AccountWhitelistArgs.builder()        
        .values("string")
        .name("string")
        .build());
    
    account_whitelist_resource = ns1.AccountWhitelist("accountWhitelistResource",
        values=["string"],
        name="string")
    
    const accountWhitelistResource = new ns1.AccountWhitelist("accountWhitelistResource", {
        values: ["string"],
        name: "string",
    });
    
    type: ns1:AccountWhitelist
    properties:
        name: string
        values:
            - string
    

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

    Values List<string>
    Array of IP addresses/networks from which to allow access.
    Name string
    The free form name of the whitelist.
    Values []string
    Array of IP addresses/networks from which to allow access.
    Name string
    The free form name of the whitelist.
    values List<String>
    Array of IP addresses/networks from which to allow access.
    name String
    The free form name of the whitelist.
    values string[]
    Array of IP addresses/networks from which to allow access.
    name string
    The free form name of the whitelist.
    values Sequence[str]
    Array of IP addresses/networks from which to allow access.
    name str
    The free form name of the whitelist.
    values List<String>
    Array of IP addresses/networks from which to allow access.
    name String
    The free form name of the whitelist.

    Outputs

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

    Get an existing AccountWhitelist 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?: AccountWhitelistState, opts?: CustomResourceOptions): AccountWhitelist
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            values: Optional[Sequence[str]] = None) -> AccountWhitelist
    func GetAccountWhitelist(ctx *Context, name string, id IDInput, state *AccountWhitelistState, opts ...ResourceOption) (*AccountWhitelist, error)
    public static AccountWhitelist Get(string name, Input<string> id, AccountWhitelistState? state, CustomResourceOptions? opts = null)
    public static AccountWhitelist get(String name, Output<String> id, AccountWhitelistState 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:
    Name string
    The free form name of the whitelist.
    Values List<string>
    Array of IP addresses/networks from which to allow access.
    Name string
    The free form name of the whitelist.
    Values []string
    Array of IP addresses/networks from which to allow access.
    name String
    The free form name of the whitelist.
    values List<String>
    Array of IP addresses/networks from which to allow access.
    name string
    The free form name of the whitelist.
    values string[]
    Array of IP addresses/networks from which to allow access.
    name str
    The free form name of the whitelist.
    values Sequence[str]
    Array of IP addresses/networks from which to allow access.
    name String
    The free form name of the whitelist.
    values List<String>
    Array of IP addresses/networks from which to allow access.

    Import

    $ pulumi import ns1:index/accountWhitelist:AccountWhitelist example <ID>`
    

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

    Package Details

    Repository
    NS1 pulumi/pulumi-ns1
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ns1 Terraform Provider.
    ns1 logo
    NS1 v3.2.1 published on Thursday, Apr 4, 2024 by Pulumi