com.pulumi.gcp.essentialcontacts.kotlin.ContactArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.essentialcontacts.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.essentialcontacts.ContactArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* A contact that will receive notifications from Google Cloud.
* To get more information about Contact, see:
* * [API documentation](https://cloud.google.com/resource-manager/docs/reference/essentialcontacts/rest/v1/projects.contacts)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/resource-manager/docs/managing-notification-contacts)
* > **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
*
* ```typescript
* 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: "[email protected]",
* languageTag: "en-GB",
* notificationCategorySubscriptions: ["ALL"],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* project = gcp.organizations.get_project()
* contact = gcp.essentialcontacts.Contact("contact",
* parent=project.id,
* email="[email protected]",
* language_tag="en-GB",
* notification_category_subscriptions=["ALL"])
* ```
* ```csharp
* 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 = "[email protected]",
* LanguageTag = "en-GB",
* NotificationCategorySubscriptions = new[]
* {
* "ALL",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/essentialcontacts"
* "github.com/pulumi/pulumi-gcp/sdk/v7/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("[email protected]"),
* LanguageTag: pulumi.String("en-GB"),
* NotificationCategorySubscriptions: pulumi.StringArray{
* pulumi.String("ALL"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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("[email protected]")
* .languageTag("en-GB")
* .notificationCategorySubscriptions("ALL")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* contact:
* type: gcp:essentialcontacts:Contact
* properties:
* parent: ${project.id}
* email: [email protected]
* languageTag: en-GB
* notificationCategorySubscriptions:
* - ALL
* variables:
* project:
* fn::invoke:
* Function: gcp:organizations:getProject
* Arguments: {}
* ```
*
* ## 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:
* ```sh
* $ pulumi import gcp:essentialcontacts/contact:Contact default {{name}}
* ```
* @property email The email address to send notifications to. This does not need to be a Google account.
* @property languageTag The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
* @property notificationCategorySubscriptions The categories of notifications that the contact will receive communications for.
* @property parent The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}
* - - -
*/
public data class ContactArgs(
public val email: Output? = null,
public val languageTag: Output? = null,
public val notificationCategorySubscriptions: Output>? = null,
public val parent: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.essentialcontacts.ContactArgs =
com.pulumi.gcp.essentialcontacts.ContactArgs.builder()
.email(email?.applyValue({ args0 -> args0 }))
.languageTag(languageTag?.applyValue({ args0 -> args0 }))
.notificationCategorySubscriptions(
notificationCategorySubscriptions?.applyValue({ args0 ->
args0.map({ args0 -> args0 })
}),
)
.parent(parent?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ContactArgs].
*/
@PulumiTagMarker
public class ContactArgsBuilder internal constructor() {
private var email: Output? = null
private var languageTag: Output? = null
private var notificationCategorySubscriptions: Output>? = null
private var parent: Output? = null
/**
* @param value The email address to send notifications to. This does not need to be a Google account.
*/
@JvmName("ilsqtdpejbjtxuuq")
public suspend fun email(`value`: Output) {
this.email = value
}
/**
* @param value The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
*/
@JvmName("xfomfnkcdpafyrry")
public suspend fun languageTag(`value`: Output) {
this.languageTag = value
}
/**
* @param value The categories of notifications that the contact will receive communications for.
*/
@JvmName("whasphcckusjfdux")
public suspend fun notificationCategorySubscriptions(`value`: Output>) {
this.notificationCategorySubscriptions = value
}
@JvmName("qsimwgjlcpkignsk")
public suspend fun notificationCategorySubscriptions(vararg values: Output) {
this.notificationCategorySubscriptions = Output.all(values.asList())
}
/**
* @param values The categories of notifications that the contact will receive communications for.
*/
@JvmName("hyjvgbxducofrbmj")
public suspend fun notificationCategorySubscriptions(values: List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy