1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. essentialcontacts
  5. Contact
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

gcp.essentialcontacts.Contact

Explore with Pulumi AI

A contact that will receive notifications from Google Cloud.

To get more information about Contact, see:

Warning: If you are using User ADCs (Application Default Credentials) with this resource, you must specify a billing_project and set user_project_override to true in the provider configuration. Otherwise the Essential Contacts API will return a 403 error. Your account must have the serviceusage.services.use permission on the billing_project you defined.

Example Usage

Essential Contact

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

const project = gcp.organizations.getProject({});
const contact = new gcp.essentialcontacts.Contact("contact", {
    parent: project.then(project => project.id),
    email: "foo@bar.com",
    languageTag: "en-GB",
    notificationCategorySubscriptions: ["ALL"],
});
Copy
import pulumi
import pulumi_gcp as gcp

project = gcp.organizations.get_project()
contact = gcp.essentialcontacts.Contact("contact",
    parent=project.id,
    email="foo@bar.com",
    language_tag="en-GB",
    notification_category_subscriptions=["ALL"])
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/essentialcontacts"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = essentialcontacts.NewContact(ctx, "contact", &essentialcontacts.ContactArgs{
			Parent:      pulumi.String(project.Id),
			Email:       pulumi.String("foo@bar.com"),
			LanguageTag: pulumi.String("en-GB"),
			NotificationCategorySubscriptions: pulumi.StringArray{
				pulumi.String("ALL"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var project = Gcp.Organizations.GetProject.Invoke();

    var contact = new Gcp.EssentialContacts.Contact("contact", new()
    {
        Parent = project.Apply(getProjectResult => getProjectResult.Id),
        Email = "foo@bar.com",
        LanguageTag = "en-GB",
        NotificationCategorySubscriptions = new[]
        {
            "ALL",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import com.pulumi.gcp.essentialcontacts.Contact;
import com.pulumi.gcp.essentialcontacts.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) {
        final var project = OrganizationsFunctions.getProject(GetProjectArgs.builder()
            .build());

        var contact = new Contact("contact", ContactArgs.builder()
            .parent(project.id())
            .email("foo@bar.com")
            .languageTag("en-GB")
            .notificationCategorySubscriptions("ALL")
            .build());

    }
}
Copy
resources:
  contact:
    type: gcp:essentialcontacts:Contact
    properties:
      parent: ${project.id}
      email: foo@bar.com
      languageTag: en-GB
      notificationCategorySubscriptions:
        - ALL
variables:
  project:
    fn::invoke:
      function: gcp:organizations:getProject
      arguments: {}
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,
            email: Optional[str] = None,
            language_tag: Optional[str] = None,
            notification_category_subscriptions: Optional[Sequence[str]] = None,
            parent: 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: gcp:essentialcontacts: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 contactResource = new Gcp.EssentialContacts.Contact("contactResource", new()
{
    Email = "string",
    LanguageTag = "string",
    NotificationCategorySubscriptions = new[]
    {
        "string",
    },
    Parent = "string",
});
Copy
example, err := essentialcontacts.NewContact(ctx, "contactResource", &essentialcontacts.ContactArgs{
	Email:       pulumi.String("string"),
	LanguageTag: pulumi.String("string"),
	NotificationCategorySubscriptions: pulumi.StringArray{
		pulumi.String("string"),
	},
	Parent: pulumi.String("string"),
})
Copy
var contactResource = new Contact("contactResource", ContactArgs.builder()
    .email("string")
    .languageTag("string")
    .notificationCategorySubscriptions("string")
    .parent("string")
    .build());
Copy
contact_resource = gcp.essentialcontacts.Contact("contactResource",
    email="string",
    language_tag="string",
    notification_category_subscriptions=["string"],
    parent="string")
Copy
const contactResource = new gcp.essentialcontacts.Contact("contactResource", {
    email: "string",
    languageTag: "string",
    notificationCategorySubscriptions: ["string"],
    parent: "string",
});
Copy
type: gcp:essentialcontacts:Contact
properties:
    email: string
    languageTag: string
    notificationCategorySubscriptions:
        - string
    parent: 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:

Email
This property is required.
Changes to this property will trigger replacement.
string
The email address to send notifications to. This does not need to be a Google account.
LanguageTag This property is required. string
The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
NotificationCategorySubscriptions This property is required. List<string>
The categories of notifications that the contact will receive communications for.
Parent
This property is required.
Changes to this property will trigger replacement.
string
The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


Email
This property is required.
Changes to this property will trigger replacement.
string
The email address to send notifications to. This does not need to be a Google account.
LanguageTag This property is required. string
The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
NotificationCategorySubscriptions This property is required. []string
The categories of notifications that the contact will receive communications for.
Parent
This property is required.
Changes to this property will trigger replacement.
string
The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


email
This property is required.
Changes to this property will trigger replacement.
String
The email address to send notifications to. This does not need to be a Google account.
languageTag This property is required. String
The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
notificationCategorySubscriptions This property is required. List<String>
The categories of notifications that the contact will receive communications for.
parent
This property is required.
Changes to this property will trigger replacement.
String
The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


email
This property is required.
Changes to this property will trigger replacement.
string
The email address to send notifications to. This does not need to be a Google account.
languageTag This property is required. string
The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
notificationCategorySubscriptions This property is required. string[]
The categories of notifications that the contact will receive communications for.
parent
This property is required.
Changes to this property will trigger replacement.
string
The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


email
This property is required.
Changes to this property will trigger replacement.
str
The email address to send notifications to. This does not need to be a Google account.
language_tag This property is required. str
The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
notification_category_subscriptions This property is required. Sequence[str]
The categories of notifications that the contact will receive communications for.
parent
This property is required.
Changes to this property will trigger replacement.
str
The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


email
This property is required.
Changes to this property will trigger replacement.
String
The email address to send notifications to. This does not need to be a Google account.
languageTag This property is required. String
The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
notificationCategorySubscriptions This property is required. List<String>
The categories of notifications that the contact will receive communications for.
parent
This property is required.
Changes to this property will trigger replacement.
String
The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


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.
Name string
The identifier for the contact. Format: {resourceType}/{resource_id}/contacts/{contact_id}
Id string
The provider-assigned unique ID for this managed resource.
Name string
The identifier for the contact. Format: {resourceType}/{resource_id}/contacts/{contact_id}
id String
The provider-assigned unique ID for this managed resource.
name String
The identifier for the contact. Format: {resourceType}/{resource_id}/contacts/{contact_id}
id string
The provider-assigned unique ID for this managed resource.
name string
The identifier for the contact. Format: {resourceType}/{resource_id}/contacts/{contact_id}
id str
The provider-assigned unique ID for this managed resource.
name str
The identifier for the contact. Format: {resourceType}/{resource_id}/contacts/{contact_id}
id String
The provider-assigned unique ID for this managed resource.
name String
The identifier for the contact. Format: {resourceType}/{resource_id}/contacts/{contact_id}

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,
        email: Optional[str] = None,
        language_tag: Optional[str] = None,
        name: Optional[str] = None,
        notification_category_subscriptions: Optional[Sequence[str]] = None,
        parent: 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: gcp:essentialcontacts: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:
Email Changes to this property will trigger replacement. string
The email address to send notifications to. This does not need to be a Google account.
LanguageTag string
The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
Name string
The identifier for the contact. Format: {resourceType}/{resource_id}/contacts/{contact_id}
NotificationCategorySubscriptions List<string>
The categories of notifications that the contact will receive communications for.
Parent Changes to this property will trigger replacement. string
The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


Email Changes to this property will trigger replacement. string
The email address to send notifications to. This does not need to be a Google account.
LanguageTag string
The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
Name string
The identifier for the contact. Format: {resourceType}/{resource_id}/contacts/{contact_id}
NotificationCategorySubscriptions []string
The categories of notifications that the contact will receive communications for.
Parent Changes to this property will trigger replacement. string
The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


email Changes to this property will trigger replacement. String
The email address to send notifications to. This does not need to be a Google account.
languageTag String
The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
name String
The identifier for the contact. Format: {resourceType}/{resource_id}/contacts/{contact_id}
notificationCategorySubscriptions List<String>
The categories of notifications that the contact will receive communications for.
parent Changes to this property will trigger replacement. String
The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


email Changes to this property will trigger replacement. string
The email address to send notifications to. This does not need to be a Google account.
languageTag string
The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
name string
The identifier for the contact. Format: {resourceType}/{resource_id}/contacts/{contact_id}
notificationCategorySubscriptions string[]
The categories of notifications that the contact will receive communications for.
parent Changes to this property will trigger replacement. string
The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


email Changes to this property will trigger replacement. str
The email address to send notifications to. This does not need to be a Google account.
language_tag str
The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
name str
The identifier for the contact. Format: {resourceType}/{resource_id}/contacts/{contact_id}
notification_category_subscriptions Sequence[str]
The categories of notifications that the contact will receive communications for.
parent Changes to this property will trigger replacement. str
The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


email Changes to this property will trigger replacement. String
The email address to send notifications to. This does not need to be a Google account.
languageTag String
The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
name String
The identifier for the contact. Format: {resourceType}/{resource_id}/contacts/{contact_id}
notificationCategorySubscriptions List<String>
The categories of notifications that the contact will receive communications for.
parent Changes to this property will trigger replacement. String
The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


Import

Contact can be imported using any of these accepted formats:

  • {{name}}

When using the pulumi import command, Contact can be imported using one of the formats above. For example:

$ pulumi import gcp:essentialcontacts/contact:Contact default {{name}}
Copy

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

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.