Gmail Send As Alias resource in the Terraform Googleworkspace provider. Please ensure the Gmail API is enabled for your workspace and that the user being configured has a Gmail license. Gmail Send As Alias resides under the https://www.googleapis.com/auth/gmail.settings
client scope.
data "googleworkspace_user" "example" {
primary_email = "user.with.gmail.license@example.com"
}
resource "googleworkspace_user" "alias" {
primary_email = "alias@example.com"
password = "34819d7beeabb9260a5c854bc85b3e44"
hash_function = "MD5"
name {
family_name = "Scott"
given_name = "Michael"
}
}
resource "googleworkspace_gmail_send_as_alias" "test" {
primary_email = data.googleworkspace_user.example.primary_email
send_as_email = googleworkspace_user.alias.primary_email
}
primary_email
(String) User's primary email address.send_as_email
(String) The email address that appears in the 'From:' header for mail sent using this alias.display_name
(String) A name that appears in the 'From:' header for mail sent using this alias. For custom 'from' addresses, when this is empty, Gmail will populate the 'From:' header with the name that is used for the primary address associated with the account. If the admin has disabled the ability for users to update their name format, requests to update this field for the primary login will silently fail.is_default
(Boolean) Whether this address is selected as the default 'From:' address in situations such as composing a new message or sending a vacation auto-reply. Every Gmail account has exactly one default send-as address, so the only legal value that clients may write to this field is true. Changing this from false to true for an address will result in this field becoming false for the other previous default address. Toggling an existing alias' default to false is not possible, another alias must be added/imported and toggled to true to remove the default from an existing alias. To avoid drift with Terraform, please change the previous default's config to false AFTER a new default is applied and perform a refresh to synchronize with remote state.reply_to_address
(String) An optional email address that is included in a 'Reply-To:' header for mail sent using this alias. If this is empty, Gmail will not generate a 'Reply-To:' header.signature
(String) An optional HTML signature that is included in messages composed with this alias in the Gmail web UI. This signature is added to new emails only.smtp_msa
(Block List, Max: 1) An optional SMTP service that will be used as an outbound relay for mail sent using this alias. If this is empty, outbound mail will be sent directly from Gmail's servers to the destination SMTP service. This setting only applies to custom 'from' aliases. (see below for nested schema)treat_as_alias
(Boolean) Defaults to true
. Whether Gmail should treat this address as an alias for the user's primary email address. This setting only applies to custom 'from' aliases. See https://support.google.com/a/answer/1710338 for help on making this decisionid
(String) The ID of this resource.is_primary
(Boolean) Whether this address is the primary address used to login to the account. Every Gmail account has exactly one primary address, and it cannot be deleted from the collection of send-as aliases.verification_status
(String) Indicates whether this address has been verified for use as a send-as alias.smtp_msa
Required:
host
(String) The hostname of the SMTP service.port
(Number) The port of the SMTP service.Optional:
password
(String, Sensitive) The password that will be used for authentication with the SMTP service. This is a write-only field that can be specified in requests to create or update SendAs settings; it is never populated in responses.security_mode
(String) Defaults to securityModeUnspecified
. The protocol that will be used to secure communication with the SMTP service.username
(String) The username that will be used for authentication with the SMTP service. This is a write-only field that can be specified in requests to create or update SendAs settings; it is never populated in responses.Import is supported using the following syntax:
terraform import googleworkspace_gmail_send_as_alias.alias user@example.com:alias@anotherexample.com