netbox.Contact
Explore with Pulumi AI
From the official documentation:
A contact should represent an individual or permanent point of contact. Each contact must define a name, and may optionally include a title, phone number, email address, and related details.
Contacts are reused for assignments, so each unique contact must be created only once and can be assigned to any number of NetBox objects, and there is no limit to the number of assigned contacts an object may have. Most core objects in NetBox can have contacts assigned to them.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const test = new netbox.Contact("test", {
email: "test@example.com",
phone: "123-123123",
});
import pulumi
import pulumi_netbox as netbox
test = netbox.Contact("test",
email="test@example.com",
phone="123-123123")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v3/netbox"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := netbox.NewContact(ctx, "test", &netbox.ContactArgs{
Email: pulumi.String("test@example.com"),
Phone: pulumi.String("123-123123"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;
return await Deployment.RunAsync(() =>
{
var test = new Netbox.Contact("test", new()
{
Email = "test@example.com",
Phone = "123-123123",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.Contact;
import com.pulumi.netbox.ContactArgs;
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 Contact("test", ContactArgs.builder()
.email("test@example.com")
.phone("123-123123")
.build());
}
}
resources:
test:
type: netbox:Contact
properties:
email: test@example.com
phone: 123-123123
Create Contact Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Contact(name: string, args?: ContactArgs, opts?: CustomResourceOptions);
@overload
def Contact(resource_name: str,
args: Optional[ContactArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Contact(resource_name: str,
opts: Optional[ResourceOptions] = None,
contact_id: Optional[str] = None,
email: Optional[str] = None,
group_id: Optional[float] = None,
name: Optional[str] = None,
phone: Optional[str] = None,
tags: Optional[Sequence[str]] = None)
func NewContact(ctx *Context, name string, args *ContactArgs, opts ...ResourceOption) (*Contact, error)
public Contact(string name, ContactArgs? args = null, CustomResourceOptions? opts = null)
public Contact(String name, ContactArgs args)
public Contact(String name, ContactArgs args, CustomResourceOptions options)
type: netbox:Contact
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 ContactArgs
- 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 ContactArgs
- 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 ContactArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ContactArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ContactArgs
- 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 contactResource = new Netbox.Contact("contactResource", new()
{
ContactId = "string",
Email = "string",
GroupId = 0,
Name = "string",
Phone = "string",
Tags = new[]
{
"string",
},
});
example, err := netbox.NewContact(ctx, "contactResource", &netbox.ContactArgs{
ContactId: pulumi.String("string"),
Email: pulumi.String("string"),
GroupId: pulumi.Float64(0),
Name: pulumi.String("string"),
Phone: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
})
var contactResource = new Contact("contactResource", ContactArgs.builder()
.contactId("string")
.email("string")
.groupId(0)
.name("string")
.phone("string")
.tags("string")
.build());
contact_resource = netbox.Contact("contactResource",
contact_id="string",
email="string",
group_id=0,
name="string",
phone="string",
tags=["string"])
const contactResource = new netbox.Contact("contactResource", {
contactId: "string",
email: "string",
groupId: 0,
name: "string",
phone: "string",
tags: ["string"],
});
type: netbox:Contact
properties:
contactId: string
email: string
groupId: 0
name: string
phone: string
tags:
- string
Contact 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 Contact resource accepts the following input properties:
- contact_
id str - The ID of this resource.
- email str
- group_
id float - name str
- phone str
- Sequence[str]
Outputs
All input properties are implicitly available as output properties. Additionally, the Contact 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 Contact Resource
Get an existing Contact 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?: ContactState, opts?: CustomResourceOptions): Contact
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
contact_id: Optional[str] = None,
email: Optional[str] = None,
group_id: Optional[float] = None,
name: Optional[str] = None,
phone: Optional[str] = None,
tags: Optional[Sequence[str]] = None) -> Contact
func GetContact(ctx *Context, name string, id IDInput, state *ContactState, opts ...ResourceOption) (*Contact, error)
public static Contact Get(string name, Input<string> id, ContactState? state, CustomResourceOptions? opts = null)
public static Contact get(String name, Output<String> id, ContactState state, CustomResourceOptions options)
resources: _: type: netbox:Contact get: id: ${id}
- 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.
- contact_
id str - The ID of this resource.
- email str
- group_
id float - name str
- phone str
- Sequence[str]
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netbox
Terraform Provider.