1. Packages
  2. Azure Classic
  3. API Docs
  4. securitycenter
  5. Contact

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.securitycenter.Contact

Explore with Pulumi AI

Manages the subscription’s Security Center Contact.

NOTE: Owner access permission is required.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = new azure.securitycenter.Contact("example", {
    name: "contact",
    email: "contact@example.com",
    phone: "+1-555-555-5555",
    alertNotifications: true,
    alertsToAdmins: true,
});
Copy
import pulumi
import pulumi_azure as azure

example = azure.securitycenter.Contact("example",
    name="contact",
    email="contact@example.com",
    phone="+1-555-555-5555",
    alert_notifications=True,
    alerts_to_admins=True)
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/securitycenter"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := securitycenter.NewContact(ctx, "example", &securitycenter.ContactArgs{
			Name:               pulumi.String("contact"),
			Email:              pulumi.String("contact@example.com"),
			Phone:              pulumi.String("+1-555-555-5555"),
			AlertNotifications: pulumi.Bool(true),
			AlertsToAdmins:     pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = new Azure.SecurityCenter.Contact("example", new()
    {
        Name = "contact",
        Email = "contact@example.com",
        Phone = "+1-555-555-5555",
        AlertNotifications = true,
        AlertsToAdmins = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.securitycenter.Contact;
import com.pulumi.azure.securitycenter.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 example = new Contact("example", ContactArgs.builder()
            .name("contact")
            .email("contact@example.com")
            .phone("+1-555-555-5555")
            .alertNotifications(true)
            .alertsToAdmins(true)
            .build());

    }
}
Copy
resources:
  example:
    type: azure:securitycenter:Contact
    properties:
      name: contact
      email: contact@example.com
      phone: +1-555-555-5555
      alertNotifications: true
      alertsToAdmins: true
Copy

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,
            alert_notifications: Optional[bool] = None,
            alerts_to_admins: Optional[bool] = None,
            email: Optional[str] = None,
            name: Optional[str] = None,
            phone: 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: azure:securitycenter:Contact
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ContactArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. ContactArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ContactArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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 azureContactResource = new Azure.SecurityCenter.Contact("azureContactResource", new()
{
    AlertNotifications = false,
    AlertsToAdmins = false,
    Email = "string",
    Name = "string",
    Phone = "string",
});
Copy
example, err := securitycenter.NewContact(ctx, "azureContactResource", &securitycenter.ContactArgs{
	AlertNotifications: pulumi.Bool(false),
	AlertsToAdmins:     pulumi.Bool(false),
	Email:              pulumi.String("string"),
	Name:               pulumi.String("string"),
	Phone:              pulumi.String("string"),
})
Copy
var azureContactResource = new com.pulumi.azure.securitycenter.Contact("azureContactResource", com.pulumi.azure.securitycenter.ContactArgs.builder()
    .alertNotifications(false)
    .alertsToAdmins(false)
    .email("string")
    .name("string")
    .phone("string")
    .build());
Copy
azure_contact_resource = azure.securitycenter.Contact("azureContactResource",
    alert_notifications=False,
    alerts_to_admins=False,
    email="string",
    name="string",
    phone="string")
Copy
const azureContactResource = new azure.securitycenter.Contact("azureContactResource", {
    alertNotifications: false,
    alertsToAdmins: false,
    email: "string",
    name: "string",
    phone: "string",
});
Copy
type: azure:securitycenter:Contact
properties:
    alertNotifications: false
    alertsToAdmins: false
    email: string
    name: string
    phone: string
Copy

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:

AlertNotifications This property is required. bool
Whether to send security alerts notifications to the security contact.
AlertsToAdmins This property is required. bool
Whether to send security alerts notifications to subscription admins.
Email This property is required. string
The email of the Security Center Contact.
Name Changes to this property will trigger replacement. string
The name of the Security Center Contact. Changing this forces a new Security Center Contact to be created.
Phone string
The phone number of the Security Center Contact.
AlertNotifications This property is required. bool
Whether to send security alerts notifications to the security contact.
AlertsToAdmins This property is required. bool
Whether to send security alerts notifications to subscription admins.
Email This property is required. string
The email of the Security Center Contact.
Name Changes to this property will trigger replacement. string
The name of the Security Center Contact. Changing this forces a new Security Center Contact to be created.
Phone string
The phone number of the Security Center Contact.
alertNotifications This property is required. Boolean
Whether to send security alerts notifications to the security contact.
alertsToAdmins This property is required. Boolean
Whether to send security alerts notifications to subscription admins.
email This property is required. String
The email of the Security Center Contact.
name Changes to this property will trigger replacement. String
The name of the Security Center Contact. Changing this forces a new Security Center Contact to be created.
phone String
The phone number of the Security Center Contact.
alertNotifications This property is required. boolean
Whether to send security alerts notifications to the security contact.
alertsToAdmins This property is required. boolean
Whether to send security alerts notifications to subscription admins.
email This property is required. string
The email of the Security Center Contact.
name Changes to this property will trigger replacement. string
The name of the Security Center Contact. Changing this forces a new Security Center Contact to be created.
phone string
The phone number of the Security Center Contact.
alert_notifications This property is required. bool
Whether to send security alerts notifications to the security contact.
alerts_to_admins This property is required. bool
Whether to send security alerts notifications to subscription admins.
email This property is required. str
The email of the Security Center Contact.
name Changes to this property will trigger replacement. str
The name of the Security Center Contact. Changing this forces a new Security Center Contact to be created.
phone str
The phone number of the Security Center Contact.
alertNotifications This property is required. Boolean
Whether to send security alerts notifications to the security contact.
alertsToAdmins This property is required. Boolean
Whether to send security alerts notifications to subscription admins.
email This property is required. String
The email of the Security Center Contact.
name Changes to this property will trigger replacement. String
The name of the Security Center Contact. Changing this forces a new Security Center Contact to be created.
phone String
The phone number of the Security Center Contact.

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,
        alert_notifications: Optional[bool] = None,
        alerts_to_admins: Optional[bool] = None,
        email: Optional[str] = None,
        name: Optional[str] = None,
        phone: 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)
resources:  _:    type: azure:securitycenter:Contact    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
AlertNotifications bool
Whether to send security alerts notifications to the security contact.
AlertsToAdmins bool
Whether to send security alerts notifications to subscription admins.
Email string
The email of the Security Center Contact.
Name Changes to this property will trigger replacement. string
The name of the Security Center Contact. Changing this forces a new Security Center Contact to be created.
Phone string
The phone number of the Security Center Contact.
AlertNotifications bool
Whether to send security alerts notifications to the security contact.
AlertsToAdmins bool
Whether to send security alerts notifications to subscription admins.
Email string
The email of the Security Center Contact.
Name Changes to this property will trigger replacement. string
The name of the Security Center Contact. Changing this forces a new Security Center Contact to be created.
Phone string
The phone number of the Security Center Contact.
alertNotifications Boolean
Whether to send security alerts notifications to the security contact.
alertsToAdmins Boolean
Whether to send security alerts notifications to subscription admins.
email String
The email of the Security Center Contact.
name Changes to this property will trigger replacement. String
The name of the Security Center Contact. Changing this forces a new Security Center Contact to be created.
phone String
The phone number of the Security Center Contact.
alertNotifications boolean
Whether to send security alerts notifications to the security contact.
alertsToAdmins boolean
Whether to send security alerts notifications to subscription admins.
email string
The email of the Security Center Contact.
name Changes to this property will trigger replacement. string
The name of the Security Center Contact. Changing this forces a new Security Center Contact to be created.
phone string
The phone number of the Security Center Contact.
alert_notifications bool
Whether to send security alerts notifications to the security contact.
alerts_to_admins bool
Whether to send security alerts notifications to subscription admins.
email str
The email of the Security Center Contact.
name Changes to this property will trigger replacement. str
The name of the Security Center Contact. Changing this forces a new Security Center Contact to be created.
phone str
The phone number of the Security Center Contact.
alertNotifications Boolean
Whether to send security alerts notifications to the security contact.
alertsToAdmins Boolean
Whether to send security alerts notifications to subscription admins.
email String
The email of the Security Center Contact.
name Changes to this property will trigger replacement. String
The name of the Security Center Contact. Changing this forces a new Security Center Contact to be created.
phone String
The phone number of the Security Center Contact.

Import

Security Center Contacts can be imported using the resource id, e.g.

$ pulumi import azure:securitycenter/contact:Contact example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Security/securityContacts/default1
Copy

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

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.