dnsimple.Contact
Explore with Pulumi AI
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
- First
Name string - First name
- Last
Name string - Last name
- Phone string
- Phone
- Postal
Code string - Postal code
- State
Province string - State province
- Address2 string
- Address line 2
- Fax string
- Fax
- Job
Title string - Job title
- Label string
- Label
- Organization
Name string - Organization name
- Address1 string
- Address line 1
- City string
- City
- Country string
- Country
- Email string
- Email
Attributes Reference
- First
Name string - First name
- Last
Name string - Last name
- Phone string
- Phone
- Postal
Code string - Postal code
- State
Province string - State province
- Address2 string
- Address line 2
- Fax string
- Fax
- Job
Title string - Job title
- Label string
- Label
- Organization
Name string - Organization name
- address1 String
- Address line 1
- city String
- City
- country String
- Country
- email String
- Email
Attributes Reference
- first
Name String - First name
- last
Name String - Last name
- phone String
- Phone
- postal
Code String - Postal code
- state
Province String - State province
- address2 String
- Address line 2
- fax String
- Fax
- job
Title String - Job title
- label String
- Label
- organization
Name String - Organization name
- address1 string
- Address line 1
- city string
- City
- country string
- Country
- email string
- Email
Attributes Reference
- first
Name string - First name
- last
Name string - Last name
- phone string
- Phone
- postal
Code string - Postal code
- state
Province string - State province
- address2 string
- Address line 2
- fax string
- Fax
- job
Title string - Job title
- label string
- Label
- organization
Name 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
- first
Name String - First name
- last
Name String - Last name
- phone String
- Phone
- postal
Code String - Postal code
- state
Province String - State province
- address2 String
- Address line 2
- fax String
- Fax
- job
Title String - Job title
- label String
- Label
- organization
Name String - Organization name
Outputs
All input properties are implicitly available as output properties. Additionally, the Contact resource produces the following output properties:
- Account
Id int - The account ID for the contact.
- Created
At string - Timestamp representing when this contact was created.
- Fax
Normalized string - The fax number, normalized.
- Id string
- The provider-assigned unique ID for this managed resource.
- Phone
Normalized string - The phone number, normalized.
- Updated
At string - Timestamp representing when this contact was updated.
- Account
Id int - The account ID for the contact.
- Created
At string - Timestamp representing when this contact was created.
- Fax
Normalized string - The fax number, normalized.
- Id string
- The provider-assigned unique ID for this managed resource.
- Phone
Normalized string - The phone number, normalized.
- Updated
At string - Timestamp representing when this contact was updated.
- account
Id Integer - The account ID for the contact.
- created
At String - Timestamp representing when this contact was created.
- fax
Normalized String - The fax number, normalized.
- id String
- The provider-assigned unique ID for this managed resource.
- phone
Normalized String - The phone number, normalized.
- updated
At String - Timestamp representing when this contact was updated.
- account
Id number - The account ID for the contact.
- created
At string - Timestamp representing when this contact was created.
- fax
Normalized string - The fax number, normalized.
- id string
- The provider-assigned unique ID for this managed resource.
- phone
Normalized string - The phone number, normalized.
- updated
At 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.
- account
Id Number - The account ID for the contact.
- created
At String - Timestamp representing when this contact was created.
- fax
Normalized String - The fax number, normalized.
- id String
- The provider-assigned unique ID for this managed resource.
- phone
Normalized String - The phone number, normalized.
- updated
At 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.
- Account
Id int - The account ID for the contact.
- Address1 string
- Address line 1
- Address2 string
- Address line 2
- City string
- City
- Country string
- Country
- Created
At string - Timestamp representing when this contact was created.
- Email string
- Email
Attributes Reference
- Fax string
- Fax
- Fax
Normalized string - The fax number, normalized.
- First
Name string - First name
- Job
Title string - Job title
- Label string
- Label
- Last
Name string - Last name
- Organization
Name string - Organization name
- Phone string
- Phone
- Phone
Normalized string - The phone number, normalized.
- Postal
Code string - Postal code
- State
Province string - State province
- Updated
At string - Timestamp representing when this contact was updated.
- Account
Id int - The account ID for the contact.
- Address1 string
- Address line 1
- Address2 string
- Address line 2
- City string
- City
- Country string
- Country
- Created
At string - Timestamp representing when this contact was created.
- Email string
- Email
Attributes Reference
- Fax string
- Fax
- Fax
Normalized string - The fax number, normalized.
- First
Name string - First name
- Job
Title string - Job title
- Label string
- Label
- Last
Name string - Last name
- Organization
Name string - Organization name
- Phone string
- Phone
- Phone
Normalized string - The phone number, normalized.
- Postal
Code string - Postal code
- State
Province string - State province
- Updated
At string - Timestamp representing when this contact was updated.
- account
Id Integer - The account ID for the contact.
- address1 String
- Address line 1
- address2 String
- Address line 2
- city String
- City
- country String
- Country
- created
At String - Timestamp representing when this contact was created.
- email String
- Email
Attributes Reference
- fax String
- Fax
- fax
Normalized String - The fax number, normalized.
- first
Name String - First name
- job
Title String - Job title
- label String
- Label
- last
Name String - Last name
- organization
Name String - Organization name
- phone String
- Phone
- phone
Normalized String - The phone number, normalized.
- postal
Code String - Postal code
- state
Province String - State province
- updated
At String - Timestamp representing when this contact was updated.
- account
Id number - The account ID for the contact.
- address1 string
- Address line 1
- address2 string
- Address line 2
- city string
- City
- country string
- Country
- created
At string - Timestamp representing when this contact was created.
- email string
- Email
Attributes Reference
- fax string
- Fax
- fax
Normalized string - The fax number, normalized.
- first
Name string - First name
- job
Title string - Job title
- label string
- Label
- last
Name string - Last name
- organization
Name string - Organization name
- phone string
- Phone
- phone
Normalized string - The phone number, normalized.
- postal
Code string - Postal code
- state
Province string - State province
- updated
At 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.
- account
Id Number - The account ID for the contact.
- address1 String
- Address line 1
- address2 String
- Address line 2
- city String
- City
- country String
- Country
- created
At String - Timestamp representing when this contact was created.
- email String
- Email
Attributes Reference
- fax String
- Fax
- fax
Normalized String - The fax number, normalized.
- first
Name String - First name
- job
Title String - Job title
- label String
- Label
- last
Name String - Last name
- organization
Name String - Organization name
- phone String
- Phone
- phone
Normalized String - The phone number, normalized.
- postal
Code String - Postal code
- state
Province String - State province
- updated
At 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.