1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. essentialcontacts
  5. Contact
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

gcp.essentialcontacts.Contact

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

    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"],
    });
    
    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"])
    
    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, nil, 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
    	})
    }
    
    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",
            },
        });
    
    });
    
    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();
    
            var contact = new Contact("contact", ContactArgs.builder()
                .parent(project.applyValue(getProjectResult -> getProjectResult.id()))
                .email("foo@bar.com")
                .languageTag("en-GB")
                .notificationCategorySubscriptions("ALL")
                .build());
    
        }
    }
    
    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: {}
    

    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 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 Gcp.EssentialContacts.Contact("contactResource", new()
    {
        Email = "string",
        LanguageTag = "string",
        NotificationCategorySubscriptions = new[]
        {
            "string",
        },
        Parent = "string",
    });
    
    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"),
    })
    
    var contactResource = new Contact("contactResource", ContactArgs.builder()
        .email("string")
        .languageTag("string")
        .notificationCategorySubscriptions("string")
        .parent("string")
        .build());
    
    contact_resource = gcp.essentialcontacts.Contact("contactResource",
        email="string",
        language_tag="string",
        notification_category_subscriptions=["string"],
        parent="string")
    
    const contactResource = new gcp.essentialcontacts.Contact("contactResource", {
        email: "string",
        languageTag: "string",
        notificationCategorySubscriptions: ["string"],
        parent: "string",
    });
    
    type: gcp:essentialcontacts:Contact
    properties:
        email: string
        languageTag: string
        notificationCategorySubscriptions:
            - string
        parent: 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

    The Contact resource accepts the following input properties:

    Email 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.
    NotificationCategorySubscriptions List<string>
    The categories of notifications that the contact will receive communications for.
    Parent string
    The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


    Email 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.
    NotificationCategorySubscriptions []string
    The categories of notifications that the contact will receive communications for.
    Parent string
    The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


    email 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.
    notificationCategorySubscriptions List<String>
    The categories of notifications that the contact will receive communications for.
    parent String
    The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


    email 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.
    notificationCategorySubscriptions string[]
    The categories of notifications that the contact will receive communications for.
    parent string
    The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


    email 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.
    notification_category_subscriptions Sequence[str]
    The categories of notifications that the contact will receive communications for.
    parent str
    The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


    email 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.
    notificationCategorySubscriptions List<String>
    The categories of notifications that the contact will receive communications for.
    parent 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)
    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:
    Email 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 string
    The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


    Email 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 string
    The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


    email 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 String
    The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


    email 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 string
    The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


    email 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 str
    The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}


    email 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 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}}
    

    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.
    gcp logo
    Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi