1. Packages
  2. Ns1 Provider
  3. API Docs
  4. DataSource
NS1 v3.4.6 published on Friday, Oct 18, 2024 by Pulumi

ns1.DataSource

Explore with Pulumi AI

ns1 logo
NS1 v3.4.6 published on Friday, Oct 18, 2024 by Pulumi

    Provides a NS1 Data Source resource. This can be used to create, modify, and delete data sources.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ns1 from "@pulumi/ns1";
    
    const example = new ns1.DataSource("example", {
        name: "example",
        sourcetype: "nsone_v1",
    });
    
    import pulumi
    import pulumi_ns1 as ns1
    
    example = ns1.DataSource("example",
        name="example",
        sourcetype="nsone_v1")
    
    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.NewDataSource(ctx, "example", &ns1.DataSourceArgs{
    			Name:       pulumi.String("example"),
    			Sourcetype: pulumi.String("nsone_v1"),
    		})
    		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.DataSource("example", new()
        {
            Name = "example",
            Sourcetype = "nsone_v1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ns1.DataSource;
    import com.pulumi.ns1.DataSourceArgs;
    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 DataSource("example", DataSourceArgs.builder()
                .name("example")
                .sourcetype("nsone_v1")
                .build());
    
        }
    }
    
    resources:
      example:
        type: ns1:DataSource
        properties:
          name: example
          sourcetype: nsone_v1
    

    NS1 Documentation

    Datasource Api Doc

    Create DataSource Resource

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

    Constructor syntax

    new DataSource(name: string, args: DataSourceArgs, opts?: CustomResourceOptions);
    @overload
    def DataSource(resource_name: str,
                   args: DataSourceArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def DataSource(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   sourcetype: Optional[str] = None,
                   config: Optional[Mapping[str, str]] = None,
                   name: Optional[str] = None)
    func NewDataSource(ctx *Context, name string, args DataSourceArgs, opts ...ResourceOption) (*DataSource, error)
    public DataSource(string name, DataSourceArgs args, CustomResourceOptions? opts = null)
    public DataSource(String name, DataSourceArgs args)
    public DataSource(String name, DataSourceArgs args, CustomResourceOptions options)
    
    type: ns1:DataSource
    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 DataSourceArgs
    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 DataSourceArgs
    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 DataSourceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DataSourceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DataSourceArgs
    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 dataSourceResource = new Ns1.DataSource("dataSourceResource", new()
    {
        Sourcetype = "string",
        Config = 
        {
            { "string", "string" },
        },
        Name = "string",
    });
    
    example, err := ns1.NewDataSource(ctx, "dataSourceResource", &ns1.DataSourceArgs{
    	Sourcetype: pulumi.String("string"),
    	Config: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    })
    
    var dataSourceResource = new DataSource("dataSourceResource", DataSourceArgs.builder()
        .sourcetype("string")
        .config(Map.of("string", "string"))
        .name("string")
        .build());
    
    data_source_resource = ns1.DataSource("dataSourceResource",
        sourcetype="string",
        config={
            "string": "string",
        },
        name="string")
    
    const dataSourceResource = new ns1.DataSource("dataSourceResource", {
        sourcetype: "string",
        config: {
            string: "string",
        },
        name: "string",
    });
    
    type: ns1:DataSource
    properties:
        config:
            string: string
        name: string
        sourcetype: string
    

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

    Sourcetype string
    The data sources type, listed in API endpoint https://api.nsone.net/v1/data/sourcetypes.
    Config Dictionary<string, string>
    The data source configuration, determined by its type, matching the specification in config from /data/sourcetypes.
    Name string
    The free form name of the data source.
    Sourcetype string
    The data sources type, listed in API endpoint https://api.nsone.net/v1/data/sourcetypes.
    Config map[string]string
    The data source configuration, determined by its type, matching the specification in config from /data/sourcetypes.
    Name string
    The free form name of the data source.
    sourcetype String
    The data sources type, listed in API endpoint https://api.nsone.net/v1/data/sourcetypes.
    config Map<String,String>
    The data source configuration, determined by its type, matching the specification in config from /data/sourcetypes.
    name String
    The free form name of the data source.
    sourcetype string
    The data sources type, listed in API endpoint https://api.nsone.net/v1/data/sourcetypes.
    config {[key: string]: string}
    The data source configuration, determined by its type, matching the specification in config from /data/sourcetypes.
    name string
    The free form name of the data source.
    sourcetype str
    The data sources type, listed in API endpoint https://api.nsone.net/v1/data/sourcetypes.
    config Mapping[str, str]
    The data source configuration, determined by its type, matching the specification in config from /data/sourcetypes.
    name str
    The free form name of the data source.
    sourcetype String
    The data sources type, listed in API endpoint https://api.nsone.net/v1/data/sourcetypes.
    config Map<String>
    The data source configuration, determined by its type, matching the specification in config from /data/sourcetypes.
    name String
    The free form name of the data source.

    Outputs

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

    Get an existing DataSource 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?: DataSourceState, opts?: CustomResourceOptions): DataSource
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            config: Optional[Mapping[str, str]] = None,
            name: Optional[str] = None,
            sourcetype: Optional[str] = None) -> DataSource
    func GetDataSource(ctx *Context, name string, id IDInput, state *DataSourceState, opts ...ResourceOption) (*DataSource, error)
    public static DataSource Get(string name, Input<string> id, DataSourceState? state, CustomResourceOptions? opts = null)
    public static DataSource get(String name, Output<String> id, DataSourceState 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:
    Config Dictionary<string, string>
    The data source configuration, determined by its type, matching the specification in config from /data/sourcetypes.
    Name string
    The free form name of the data source.
    Sourcetype string
    The data sources type, listed in API endpoint https://api.nsone.net/v1/data/sourcetypes.
    Config map[string]string
    The data source configuration, determined by its type, matching the specification in config from /data/sourcetypes.
    Name string
    The free form name of the data source.
    Sourcetype string
    The data sources type, listed in API endpoint https://api.nsone.net/v1/data/sourcetypes.
    config Map<String,String>
    The data source configuration, determined by its type, matching the specification in config from /data/sourcetypes.
    name String
    The free form name of the data source.
    sourcetype String
    The data sources type, listed in API endpoint https://api.nsone.net/v1/data/sourcetypes.
    config {[key: string]: string}
    The data source configuration, determined by its type, matching the specification in config from /data/sourcetypes.
    name string
    The free form name of the data source.
    sourcetype string
    The data sources type, listed in API endpoint https://api.nsone.net/v1/data/sourcetypes.
    config Mapping[str, str]
    The data source configuration, determined by its type, matching the specification in config from /data/sourcetypes.
    name str
    The free form name of the data source.
    sourcetype str
    The data sources type, listed in API endpoint https://api.nsone.net/v1/data/sourcetypes.
    config Map<String>
    The data source configuration, determined by its type, matching the specification in config from /data/sourcetypes.
    name String
    The free form name of the data source.
    sourcetype String
    The data sources type, listed in API endpoint https://api.nsone.net/v1/data/sourcetypes.

    Import

    $ pulumi import ns1:index/dataSource:DataSource <name> <datasource_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.4.6 published on Friday, Oct 18, 2024 by Pulumi