ns1.DataFeed
Explore with Pulumi AI
Provides a NS1 Data Feed resource. This can be used to create, modify, and delete data feeds.
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",
});
const exampleMonitoring = new ns1.DataSource("example_monitoring", {
name: "example_monitoring",
sourcetype: "nsone_monitoring",
});
const uswestFeed = new ns1.DataFeed("uswest_feed", {
name: "uswest_feed",
sourceId: example.id,
config: {
label: "uswest",
},
});
const useastFeed = new ns1.DataFeed("useast_feed", {
name: "useast_feed",
sourceId: example.id,
config: {
label: "useast",
},
});
const useastMonitorFeed = new ns1.DataFeed("useast_monitor_feed", {
name: "useast_monitor_feed",
sourceId: exampleMonitoring.id,
config: {
jobid: exampleJob.id,
},
});
import pulumi
import pulumi_ns1 as ns1
example = ns1.DataSource("example",
name="example",
sourcetype="nsone_v1")
example_monitoring = ns1.DataSource("example_monitoring",
name="example_monitoring",
sourcetype="nsone_monitoring")
uswest_feed = ns1.DataFeed("uswest_feed",
name="uswest_feed",
source_id=example.id,
config={
"label": "uswest",
})
useast_feed = ns1.DataFeed("useast_feed",
name="useast_feed",
source_id=example.id,
config={
"label": "useast",
})
useast_monitor_feed = ns1.DataFeed("useast_monitor_feed",
name="useast_monitor_feed",
source_id=example_monitoring.id,
config={
"jobid": example_job["id"],
})
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 {
example, err := ns1.NewDataSource(ctx, "example", &ns1.DataSourceArgs{
Name: pulumi.String("example"),
Sourcetype: pulumi.String("nsone_v1"),
})
if err != nil {
return err
}
exampleMonitoring, err := ns1.NewDataSource(ctx, "example_monitoring", &ns1.DataSourceArgs{
Name: pulumi.String("example_monitoring"),
Sourcetype: pulumi.String("nsone_monitoring"),
})
if err != nil {
return err
}
_, err = ns1.NewDataFeed(ctx, "uswest_feed", &ns1.DataFeedArgs{
Name: pulumi.String("uswest_feed"),
SourceId: example.ID(),
Config: pulumi.StringMap{
"label": pulumi.String("uswest"),
},
})
if err != nil {
return err
}
_, err = ns1.NewDataFeed(ctx, "useast_feed", &ns1.DataFeedArgs{
Name: pulumi.String("useast_feed"),
SourceId: example.ID(),
Config: pulumi.StringMap{
"label": pulumi.String("useast"),
},
})
if err != nil {
return err
}
_, err = ns1.NewDataFeed(ctx, "useast_monitor_feed", &ns1.DataFeedArgs{
Name: pulumi.String("useast_monitor_feed"),
SourceId: exampleMonitoring.ID(),
Config: pulumi.StringMap{
"jobid": pulumi.Any(exampleJob.Id),
},
})
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",
});
var exampleMonitoring = new Ns1.DataSource("example_monitoring", new()
{
Name = "example_monitoring",
Sourcetype = "nsone_monitoring",
});
var uswestFeed = new Ns1.DataFeed("uswest_feed", new()
{
Name = "uswest_feed",
SourceId = example.Id,
Config =
{
{ "label", "uswest" },
},
});
var useastFeed = new Ns1.DataFeed("useast_feed", new()
{
Name = "useast_feed",
SourceId = example.Id,
Config =
{
{ "label", "useast" },
},
});
var useastMonitorFeed = new Ns1.DataFeed("useast_monitor_feed", new()
{
Name = "useast_monitor_feed",
SourceId = exampleMonitoring.Id,
Config =
{
{ "jobid", exampleJob.Id },
},
});
});
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 com.pulumi.ns1.DataFeed;
import com.pulumi.ns1.DataFeedArgs;
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());
var exampleMonitoring = new DataSource("exampleMonitoring", DataSourceArgs.builder()
.name("example_monitoring")
.sourcetype("nsone_monitoring")
.build());
var uswestFeed = new DataFeed("uswestFeed", DataFeedArgs.builder()
.name("uswest_feed")
.sourceId(example.id())
.config(Map.of("label", "uswest"))
.build());
var useastFeed = new DataFeed("useastFeed", DataFeedArgs.builder()
.name("useast_feed")
.sourceId(example.id())
.config(Map.of("label", "useast"))
.build());
var useastMonitorFeed = new DataFeed("useastMonitorFeed", DataFeedArgs.builder()
.name("useast_monitor_feed")
.sourceId(exampleMonitoring.id())
.config(Map.of("jobid", exampleJob.id()))
.build());
}
}
resources:
example:
type: ns1:DataSource
properties:
name: example
sourcetype: nsone_v1
exampleMonitoring:
type: ns1:DataSource
name: example_monitoring
properties:
name: example_monitoring
sourcetype: nsone_monitoring
uswestFeed:
type: ns1:DataFeed
name: uswest_feed
properties:
name: uswest_feed
sourceId: ${example.id}
config:
label: uswest
useastFeed:
type: ns1:DataFeed
name: useast_feed
properties:
name: useast_feed
sourceId: ${example.id}
config:
label: useast
useastMonitorFeed:
type: ns1:DataFeed
name: useast_monitor_feed
properties:
name: useast_monitor_feed
sourceId: ${exampleMonitoring.id}
config:
jobid: ${exampleJob.id}
NS1 Documentation
Create DataFeed Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DataFeed(name: string, args: DataFeedArgs, opts?: CustomResourceOptions);
@overload
def DataFeed(resource_name: str,
args: DataFeedArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DataFeed(resource_name: str,
opts: Optional[ResourceOptions] = None,
source_id: Optional[str] = None,
config: Optional[Mapping[str, str]] = None,
name: Optional[str] = None)
func NewDataFeed(ctx *Context, name string, args DataFeedArgs, opts ...ResourceOption) (*DataFeed, error)
public DataFeed(string name, DataFeedArgs args, CustomResourceOptions? opts = null)
public DataFeed(String name, DataFeedArgs args)
public DataFeed(String name, DataFeedArgs args, CustomResourceOptions options)
type: ns1:DataFeed
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 DataFeedArgs
- 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 DataFeedArgs
- 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 DataFeedArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DataFeedArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DataFeedArgs
- 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 dataFeedResource = new Ns1.DataFeed("dataFeedResource", new()
{
SourceId = "string",
Config =
{
{ "string", "string" },
},
Name = "string",
});
example, err := ns1.NewDataFeed(ctx, "dataFeedResource", &ns1.DataFeedArgs{
SourceId: pulumi.String("string"),
Config: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
})
var dataFeedResource = new DataFeed("dataFeedResource", DataFeedArgs.builder()
.sourceId("string")
.config(Map.of("string", "string"))
.name("string")
.build());
data_feed_resource = ns1.DataFeed("dataFeedResource",
source_id="string",
config={
"string": "string",
},
name="string")
const dataFeedResource = new ns1.DataFeed("dataFeedResource", {
sourceId: "string",
config: {
string: "string",
},
name: "string",
});
type: ns1:DataFeed
properties:
config:
string: string
name: string
sourceId: string
DataFeed 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 DataFeed resource accepts the following input properties:
- Source
Id string - The data source id that this feed is connected to.
- Config Dictionary<string, string>
- The feeds configuration matching the specification in
feed_config
from /data/sourcetypes.jobid
is required in theconfig
for datafeeds connected to NS1 monitoring. - Name string
- The free form name of the data feed.
- Source
Id string - The data source id that this feed is connected to.
- Config map[string]string
- The feeds configuration matching the specification in
feed_config
from /data/sourcetypes.jobid
is required in theconfig
for datafeeds connected to NS1 monitoring. - Name string
- The free form name of the data feed.
- source
Id String - The data source id that this feed is connected to.
- config Map<String,String>
- The feeds configuration matching the specification in
feed_config
from /data/sourcetypes.jobid
is required in theconfig
for datafeeds connected to NS1 monitoring. - name String
- The free form name of the data feed.
- source
Id string - The data source id that this feed is connected to.
- config {[key: string]: string}
- The feeds configuration matching the specification in
feed_config
from /data/sourcetypes.jobid
is required in theconfig
for datafeeds connected to NS1 monitoring. - name string
- The free form name of the data feed.
Outputs
All input properties are implicitly available as output properties. Additionally, the DataFeed 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 DataFeed Resource
Get an existing DataFeed 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?: DataFeedState, opts?: CustomResourceOptions): DataFeed
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
config: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
source_id: Optional[str] = None) -> DataFeed
func GetDataFeed(ctx *Context, name string, id IDInput, state *DataFeedState, opts ...ResourceOption) (*DataFeed, error)
public static DataFeed Get(string name, Input<string> id, DataFeedState? state, CustomResourceOptions? opts = null)
public static DataFeed get(String name, Output<String> id, DataFeedState 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.
- Config Dictionary<string, string>
- The feeds configuration matching the specification in
feed_config
from /data/sourcetypes.jobid
is required in theconfig
for datafeeds connected to NS1 monitoring. - Name string
- The free form name of the data feed.
- Source
Id string - The data source id that this feed is connected to.
- Config map[string]string
- The feeds configuration matching the specification in
feed_config
from /data/sourcetypes.jobid
is required in theconfig
for datafeeds connected to NS1 monitoring. - Name string
- The free form name of the data feed.
- Source
Id string - The data source id that this feed is connected to.
- config Map<String,String>
- The feeds configuration matching the specification in
feed_config
from /data/sourcetypes.jobid
is required in theconfig
for datafeeds connected to NS1 monitoring. - name String
- The free form name of the data feed.
- source
Id String - The data source id that this feed is connected to.
- config {[key: string]: string}
- The feeds configuration matching the specification in
feed_config
from /data/sourcetypes.jobid
is required in theconfig
for datafeeds connected to NS1 monitoring. - name string
- The free form name of the data feed.
- source
Id string - The data source id that this feed is connected to.
Import
$ pulumi import ns1:index/dataFeed:DataFeed <name> <datasource_id>/<datafeed_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.