Skip to content
GitHubXDiscord

EmailContact

The EmailContact resource allows you to manage email contacts for AWS Notifications. This resource can be utilized to create, update, and manage email contacts for notification purposes. For more information, refer to the AWS NotificationsContacts EmailContacts documentation.

Create a basic email contact with the required properties.

import AWS from "alchemy/aws/control";
const emailContact = await AWS.NotificationsContacts.EmailContact("primaryEmailContact", {
Name: "Primary Contact",
EmailAddress: "primary.contact@example.com",
Tags: [
{ Key: "Department", Value: "Engineering" },
{ Key: "Role", Value: "Developer" }
]
});

Create an email contact with additional properties, including tags.

const advancedEmailContact = await AWS.NotificationsContacts.EmailContact("advancedEmailContact", {
Name: "Advanced Contact",
EmailAddress: "advanced.contact@example.com",
Tags: [
{ Key: "Department", Value: "Marketing" },
{ Key: "Role", Value: "Manager" }
],
adopt: true // Allow adoption of existing resources
});

Update an existing email contact to change its name and tags.

const updatedEmailContact = await AWS.NotificationsContacts.EmailContact("existingEmailContact", {
Name: "Updated Contact Name",
EmailAddress: "updated.contact@example.com",
Tags: [
{ Key: "Department", Value: "Sales" },
{ Key: "Role", Value: "Sales Associate" }
]
});

Delete an existing email contact by using the resource ID.

const deleteEmailContact = await AWS.NotificationsContacts.EmailContact("deleteEmailContact", {
Name: "Delete This Contact",
EmailAddress: "delete.contact@example.com"
});
// Perform delete operation
await deleteEmailContact.delete();