1. Packages
  2. Dnsimple Provider
  3. API Docs
  4. Contact
DNSimple v4.2.0 published on Friday, Oct 18, 2024 by Pulumi

dnsimple.Contact

Explore with Pulumi AI

dnsimple logo
DNSimple v4.2.0 published on Friday, Oct 18, 2024 by Pulumi

    Provides a DNSimple contact resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dnsimple from "@pulumi/dnsimple";
    
    // Create a contact
    const me = new dnsimple.Contact("me", {
        label: "Apple Appleseed",
        firstName: "Apple",
        lastName: "Appleseed",
        organizationName: "Contoso",
        jobTitle: "Manager",
        address1: "Level 1, 2 Main St",
        address2: "Marsfield",
        city: "San Francisco",
        stateProvince: "California",
        postalCode: "90210",
        country: "US",
        phone: "+1401239523",
        fax: "+1849491024",
        email: "apple@contoso.com",
    });
    
    import pulumi
    import pulumi_dnsimple as dnsimple
    
    # Create a contact
    me = dnsimple.Contact("me",
        label="Apple Appleseed",
        first_name="Apple",
        last_name="Appleseed",
        organization_name="Contoso",
        job_title="Manager",
        address1="Level 1, 2 Main St",
        address2="Marsfield",
        city="San Francisco",
        state_province="California",
        postal_code="90210",
        country="US",
        phone="+1401239523",
        fax="+1849491024",
        email="apple@contoso.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-dnsimple/sdk/v4/go/dnsimple"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a contact
    		_, err := dnsimple.NewContact(ctx, "me", &dnsimple.ContactArgs{
    			Label:            pulumi.String("Apple Appleseed"),
    			FirstName:        pulumi.String("Apple"),
    			LastName:         pulumi.String("Appleseed"),
    			OrganizationName: pulumi.String("Contoso"),
    			JobTitle:         pulumi.String("Manager"),
    			Address1:         pulumi.String("Level 1, 2 Main St"),
    			Address2:         pulumi.String("Marsfield"),
    			City:             pulumi.String("San Francisco"),
    			StateProvince:    pulumi.String("California"),
    			PostalCode:       pulumi.String("90210"),
    			Country:          pulumi.String("US"),
    			Phone:            pulumi.String("+1401239523"),
    			Fax:              pulumi.String("+1849491024"),
    			Email:            pulumi.String("apple@contoso.com"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DNSimple = Pulumi.DNSimple;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a contact
        var me = new DNSimple.Contact("me", new()
        {
            Label = "Apple Appleseed",
            FirstName = "Apple",
            LastName = "Appleseed",
            OrganizationName = "Contoso",
            JobTitle = "Manager",
            Address1 = "Level 1, 2 Main St",
            Address2 = "Marsfield",
            City = "San Francisco",
            StateProvince = "California",
            PostalCode = "90210",
            Country = "US",
            Phone = "+1401239523",
            Fax = "+1849491024",
            Email = "apple@contoso.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dnsimple.Contact;
    import com.pulumi.dnsimple.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) {
            // Create a contact
            var me = new Contact("me", ContactArgs.builder()
                .label("Apple Appleseed")
                .firstName("Apple")
                .lastName("Appleseed")
                .organizationName("Contoso")
                .jobTitle("Manager")
                .address1("Level 1, 2 Main St")
                .address2("Marsfield")
                .city("San Francisco")
                .stateProvince("California")
                .postalCode("90210")
                .country("US")
                .phone("+1401239523")
                .fax("+1849491024")
                .email("apple@contoso.com")
                .build());
    
        }
    }
    
    resources:
      # Create a contact
      me:
        type: dnsimple:Contact
        properties:
          label: Apple Appleseed
          firstName: Apple
          lastName: Appleseed
          organizationName: Contoso
          jobTitle: Manager
          address1: Level 1, 2 Main St
          address2: Marsfield
          city: San Francisco
          stateProvince: California
          postalCode: '90210'
          country: US
          phone: '+1401239523'
          fax: '+1849491024'
          email: apple@contoso.com
    

    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: ContactArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Contact(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                first_name: Optional[str] = None,
                address1: Optional[str] = None,
                city: Optional[str] = None,
                country: Optional[str] = None,
                email: Optional[str] = None,
                state_province: Optional[str] = None,
                postal_code: Optional[str] = None,
                phone: Optional[str] = None,
                last_name: Optional[str] = None,
                organization_name: Optional[str] = None,
                label: Optional[str] = None,
                job_title: Optional[str] = None,
                address2: Optional[str] = None,
                fax: Optional[str] = None)
    func NewContact(ctx *Context, name string, args ContactArgs, opts ...ResourceOption) (*Contact, error)
    public Contact(string name, ContactArgs args, CustomResourceOptions? opts = null)
    public Contact(String name, ContactArgs args)
    public Contact(String name, ContactArgs args, CustomResourceOptions options)
    
    type: dnsimple: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 DNSimple.Contact("contactResource", new()
    {
        FirstName = "string",
        Address1 = "string",
        City = "string",
        Country = "string",
        Email = "string",
        StateProvince = "string",
        PostalCode = "string",
        Phone = "string",
        LastName = "string",
        OrganizationName = "string",
        Label = "string",
        JobTitle = "string",
        Address2 = "string",
        Fax = "string",
    });
    
    example, err := dnsimple.NewContact(ctx, "contactResource", &dnsimple.ContactArgs{
    	FirstName:        pulumi.String("string"),
    	Address1:         pulumi.String("string"),
    	City:             pulumi.String("string"),
    	Country:          pulumi.String("string"),
    	Email:            pulumi.String("string"),
    	StateProvince:    pulumi.String("string"),
    	PostalCode:       pulumi.String("string"),
    	Phone:            pulumi.String("string"),
    	LastName:         pulumi.String("string"),
    	OrganizationName: pulumi.String("string"),
    	Label:            pulumi.String("string"),
    	JobTitle:         pulumi.String("string"),
    	Address2:         pulumi.String("string"),
    	Fax:              pulumi.String("string"),
    })
    
    var contactResource = new Contact("contactResource", ContactArgs.builder()
        .firstName("string")
        .address1("string")
        .city("string")
        .country("string")
        .email("string")
        .stateProvince("string")
        .postalCode("string")
        .phone("string")
        .lastName("string")
        .organizationName("string")
        .label("string")
        .jobTitle("string")
        .address2("string")
        .fax("string")
        .build());
    
    contact_resource = dnsimple.Contact("contactResource",
        first_name="string",
        address1="string",
        city="string",
        country="string",
        email="string",
        state_province="string",
        postal_code="string",
        phone="string",
        last_name="string",
        organization_name="string",
        label="string",
        job_title="string",
        address2="string",
        fax="string")
    
    const contactResource = new dnsimple.Contact("contactResource", {
        firstName: "string",
        address1: "string",
        city: "string",
        country: "string",
        email: "string",
        stateProvince: "string",
        postalCode: "string",
        phone: "string",
        lastName: "string",
        organizationName: "string",
        label: "string",
        jobTitle: "string",
        address2: "string",
        fax: "string",
    });
    
    type: dnsimple:Contact
    properties:
        address1: string
        address2: string
        city: string
        country: string
        email: string
        fax: string
        firstName: string
        jobTitle: string
        label: string
        lastName: string
        organizationName: string
        phone: string
        postalCode: string
        stateProvince: 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:

    Address1 string
    Address line 1
    City string
    City
    Country string
    Country
    Email string
    Email

    Attributes Reference

    FirstName string
    First name
    LastName string
    Last name
    Phone string
    Phone
    PostalCode string
    Postal code
    StateProvince string
    State province
    Address2 string
    Address line 2
    Fax string
    Fax
    JobTitle string
    Job title
    Label string
    Label
    OrganizationName string
    Organization name
    Address1 string
    Address line 1
    City string
    City
    Country string
    Country
    Email string
    Email

    Attributes Reference

    FirstName string
    First name
    LastName string
    Last name
    Phone string
    Phone
    PostalCode string
    Postal code
    StateProvince string
    State province
    Address2 string
    Address line 2
    Fax string
    Fax
    JobTitle string
    Job title
    Label string
    Label
    OrganizationName string
    Organization name
    address1 String
    Address line 1
    city String
    City
    country String
    Country
    email String
    Email

    Attributes Reference

    firstName String
    First name
    lastName String
    Last name
    phone String
    Phone
    postalCode String
    Postal code
    stateProvince String
    State province
    address2 String
    Address line 2
    fax String
    Fax
    jobTitle String
    Job title
    label String
    Label
    organizationName String
    Organization name
    address1 string
    Address line 1
    city string
    City
    country string
    Country
    email string
    Email

    Attributes Reference

    firstName string
    First name
    lastName string
    Last name
    phone string
    Phone
    postalCode string
    Postal code
    stateProvince string
    State province
    address2 string
    Address line 2
    fax string
    Fax
    jobTitle string
    Job title
    label string
    Label
    organizationName string
    Organization name
    address1 str
    Address line 1
    city str
    City
    country str
    Country
    email str
    Email

    Attributes Reference

    first_name str
    First name
    last_name str
    Last name
    phone str
    Phone
    postal_code str
    Postal code
    state_province str
    State province
    address2 str
    Address line 2
    fax str
    Fax
    job_title str
    Job title
    label str
    Label
    organization_name str
    Organization name
    address1 String
    Address line 1
    city String
    City
    country String
    Country
    email String
    Email

    Attributes Reference

    firstName String
    First name
    lastName String
    Last name
    phone String
    Phone
    postalCode String
    Postal code
    stateProvince String
    State province
    address2 String
    Address line 2
    fax String
    Fax
    jobTitle String
    Job title
    label String
    Label
    organizationName String
    Organization name

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Contact resource produces the following output properties:

    AccountId int
    The account ID for the contact.
    CreatedAt string
    Timestamp representing when this contact was created.
    FaxNormalized string
    The fax number, normalized.
    Id string
    The provider-assigned unique ID for this managed resource.
    PhoneNormalized string
    The phone number, normalized.
    UpdatedAt string
    Timestamp representing when this contact was updated.
    AccountId int
    The account ID for the contact.
    CreatedAt string
    Timestamp representing when this contact was created.
    FaxNormalized string
    The fax number, normalized.
    Id string
    The provider-assigned unique ID for this managed resource.
    PhoneNormalized string
    The phone number, normalized.
    UpdatedAt string
    Timestamp representing when this contact was updated.
    accountId Integer
    The account ID for the contact.
    createdAt String
    Timestamp representing when this contact was created.
    faxNormalized String
    The fax number, normalized.
    id String
    The provider-assigned unique ID for this managed resource.
    phoneNormalized String
    The phone number, normalized.
    updatedAt String
    Timestamp representing when this contact was updated.
    accountId number
    The account ID for the contact.
    createdAt string
    Timestamp representing when this contact was created.
    faxNormalized string
    The fax number, normalized.
    id string
    The provider-assigned unique ID for this managed resource.
    phoneNormalized string
    The phone number, normalized.
    updatedAt string
    Timestamp representing when this contact was updated.
    account_id int
    The account ID for the contact.
    created_at str
    Timestamp representing when this contact was created.
    fax_normalized str
    The fax number, normalized.
    id str
    The provider-assigned unique ID for this managed resource.
    phone_normalized str
    The phone number, normalized.
    updated_at str
    Timestamp representing when this contact was updated.
    accountId Number
    The account ID for the contact.
    createdAt String
    Timestamp representing when this contact was created.
    faxNormalized String
    The fax number, normalized.
    id String
    The provider-assigned unique ID for this managed resource.
    phoneNormalized String
    The phone number, normalized.
    updatedAt String
    Timestamp representing when this contact was updated.

    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,
            account_id: Optional[int] = None,
            address1: Optional[str] = None,
            address2: Optional[str] = None,
            city: Optional[str] = None,
            country: Optional[str] = None,
            created_at: Optional[str] = None,
            email: Optional[str] = None,
            fax: Optional[str] = None,
            fax_normalized: Optional[str] = None,
            first_name: Optional[str] = None,
            job_title: Optional[str] = None,
            label: Optional[str] = None,
            last_name: Optional[str] = None,
            organization_name: Optional[str] = None,
            phone: Optional[str] = None,
            phone_normalized: Optional[str] = None,
            postal_code: Optional[str] = None,
            state_province: Optional[str] = None,
            updated_at: Optional[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)
    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:
    AccountId int
    The account ID for the contact.
    Address1 string
    Address line 1
    Address2 string
    Address line 2
    City string
    City
    Country string
    Country
    CreatedAt string
    Timestamp representing when this contact was created.
    Email string
    Email

    Attributes Reference

    Fax string
    Fax
    FaxNormalized string
    The fax number, normalized.
    FirstName string
    First name
    JobTitle string
    Job title
    Label string
    Label
    LastName string
    Last name
    OrganizationName string
    Organization name
    Phone string
    Phone
    PhoneNormalized string
    The phone number, normalized.
    PostalCode string
    Postal code
    StateProvince string
    State province
    UpdatedAt string
    Timestamp representing when this contact was updated.
    AccountId int
    The account ID for the contact.
    Address1 string
    Address line 1
    Address2 string
    Address line 2
    City string
    City
    Country string
    Country
    CreatedAt string
    Timestamp representing when this contact was created.
    Email string
    Email

    Attributes Reference

    Fax string
    Fax
    FaxNormalized string
    The fax number, normalized.
    FirstName string
    First name
    JobTitle string
    Job title
    Label string
    Label
    LastName string
    Last name
    OrganizationName string
    Organization name
    Phone string
    Phone
    PhoneNormalized string
    The phone number, normalized.
    PostalCode string
    Postal code
    StateProvince string
    State province
    UpdatedAt string
    Timestamp representing when this contact was updated.
    accountId Integer
    The account ID for the contact.
    address1 String
    Address line 1
    address2 String
    Address line 2
    city String
    City
    country String
    Country
    createdAt String
    Timestamp representing when this contact was created.
    email String
    Email

    Attributes Reference

    fax String
    Fax
    faxNormalized String
    The fax number, normalized.
    firstName String
    First name
    jobTitle String
    Job title
    label String
    Label
    lastName String
    Last name
    organizationName String
    Organization name
    phone String
    Phone
    phoneNormalized String
    The phone number, normalized.
    postalCode String
    Postal code
    stateProvince String
    State province
    updatedAt String
    Timestamp representing when this contact was updated.
    accountId number
    The account ID for the contact.
    address1 string
    Address line 1
    address2 string
    Address line 2
    city string
    City
    country string
    Country
    createdAt string
    Timestamp representing when this contact was created.
    email string
    Email

    Attributes Reference

    fax string
    Fax
    faxNormalized string
    The fax number, normalized.
    firstName string
    First name
    jobTitle string
    Job title
    label string
    Label
    lastName string
    Last name
    organizationName string
    Organization name
    phone string
    Phone
    phoneNormalized string
    The phone number, normalized.
    postalCode string
    Postal code
    stateProvince string
    State province
    updatedAt string
    Timestamp representing when this contact was updated.
    account_id int
    The account ID for the contact.
    address1 str
    Address line 1
    address2 str
    Address line 2
    city str
    City
    country str
    Country
    created_at str
    Timestamp representing when this contact was created.
    email str
    Email

    Attributes Reference

    fax str
    Fax
    fax_normalized str
    The fax number, normalized.
    first_name str
    First name
    job_title str
    Job title
    label str
    Label
    last_name str
    Last name
    organization_name str
    Organization name
    phone str
    Phone
    phone_normalized str
    The phone number, normalized.
    postal_code str
    Postal code
    state_province str
    State province
    updated_at str
    Timestamp representing when this contact was updated.
    accountId Number
    The account ID for the contact.
    address1 String
    Address line 1
    address2 String
    Address line 2
    city String
    City
    country String
    Country
    createdAt String
    Timestamp representing when this contact was created.
    email String
    Email

    Attributes Reference

    fax String
    Fax
    faxNormalized String
    The fax number, normalized.
    firstName String
    First name
    jobTitle String
    Job title
    label String
    Label
    lastName String
    Last name
    organizationName String
    Organization name
    phone String
    Phone
    phoneNormalized String
    The phone number, normalized.
    postalCode String
    Postal code
    stateProvince String
    State province
    updatedAt String
    Timestamp representing when this contact was updated.

    Import

    DNSimple contacts can be imported using their numeric ID.

    bash

    $ pulumi import dnsimple:index/contact:Contact resource_name 5678
    

    The ID can be found within DNSimple Contacts API. Check out Authentication in API Overview for available options.

    bash

    curl -u ‘EMAIL:PASSWORD’ https://api.dnsimple.com/v2/1234/contacts?label_like=example.com | jq

    {

    “data”: [

    {
    
      "id": 1,
    
      "account_id": 1010,
    
      "label": "Default",
    
      "first_name": "First",
    
      "last_name": "User",
    
      "job_title": "CEO",
    
      "organization_name": "Awesome Company",
    
      "email": "first@example.com",
    
      "phone": "+18001234567",
    
      "fax": "+18011234567",
    
      "address1": "Italian Street, 10",
    
      "address2": "",
    
      "city": "Roma",
    
      "state_province": "RM",
    
      "postal_code": "00100",
    
      "country": "IT",
    
      "created_at": "2013-11-08T17:23:15Z",
    
      "updated_at": "2015-01-08T21:30:50Z"
    
    },
    
    {
    
      "id": 2,
    
      "account_id": 1010,
    
      "label": "",
    
      "first_name": "Second",
    
      "last_name": "User",
    
      "job_title": "",
    
      "organization_name": "",
    
      "email": "second@example.com",
    
      "phone": "+18881234567",
    
      "fax": "",
    
      "address1": "French Street",
    
      "address2": "c/o Someone",
    
      "city": "Paris",
    
      "state_province": "XY",
    
      "postal_code": "00200",
    
      "country": "FR",
    
      "created_at": "2014-12-06T15:46:18Z",
    
      "updated_at": "2014-12-06T15:46:18Z"
    
    }
    

    ],

    “pagination”: {

    "current_page": 1,
    
    "per_page": 30,
    
    "total_entries": 2,
    
    "total_pages": 1
    

    }

    }

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

    Package Details

    Repository
    DNSimple pulumi/pulumi-dnsimple
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dnsimple Terraform Provider.
    dnsimple logo
    DNSimple v4.2.0 published on Friday, Oct 18, 2024 by Pulumi