-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Resource:
azurerm_bot_channel_email
(#4389)
- v4.14.0
- v4.13.0
- v4.12.0
- v4.11.0
- v4.10.0
- v4.9.0
- v4.8.0
- v4.7.0
- v4.6.0
- v4.5.0
- v4.4.0
- v4.3.0
- v4.2.0
- v4.1.0
- v4.0.1
- v4.0.0
- v3.117.0
- v3.116.0
- v3.115.0
- v3.114.0
- v3.113.0
- v3.112.0
- v3.111.0
- v3.110.0
- v3.109.0
- v3.108.0
- v3.107.0
- v3.106.1
- v3.106.0
- v3.105.0
- v3.104.2
- v3.104.1
- v3.104.0
- v3.103.1
- v3.103.0
- v3.102.0
- v3.101.0
- v3.100.0
- v3.99.0
- v3.98.0
- v3.97.1
- v3.97.0
- v3.96.0
- v3.95.0
- v3.94.0
- v3.93.0
- v3.92.0
- v3.91.0
- v3.90.0
- v3.89.0
- v3.88.0
- v3.87.0
- v3.86.0
- v3.85.0
- v3.84.0
- v3.83.0
- v3.82.0
- v3.81.0
- v3.80.0
- v3.79.0
- v3.78.0
- v3.77.0
- v3.76.0
- v3.75.0
- v3.74.0
- v3.73.0
- v3.72.0
- v3.71.0
- v3.70.0
- v3.69.0
- v3.68.0
- v3.67.0
- v3.66.0
- v3.65.0
- v3.64.0
- v3.63.0
- v3.62.1
- v3.62.0
- v3.61.0
- v3.60.0
- v3.59.0
- v3.58.0
- v3.57.0
- v3.56.0
- v3.55.0
- v3.54.0
- v3.53.0
- v3.52.0
- v3.51.0
- v3.50.0
- v3.49.0
- v3.48.0
- v3.47.0
- v3.46.0
- v3.45.0
- v3.44.1
- v3.44.0
- v3.43.0
- v3.42.0
- v3.41.0
- v3.40.0
- v3.39.1
- v3.39.0
- v3.38.0
- v3.37.0
- v3.36.0
- v3.35.0
- v3.34.0
- v3.33.0
- v3.32.0
- v3.31.0
- v3.30.0
- v3.29.1
- v3.29.0
- v3.28.0
- v3.27.0
- v3.26.0
- v3.25.0
- v3.24.0
- v3.23.0
- v3.22.0
- v3.21.1
- v3.21.0
- v3.20.0
- v3.19.1
- v3.19.0
- v3.18.0
- v3.17.0
- v3.16.0
- v3.15.1
- v3.15.0
- v3.14.0
- v3.13.0
- v3.12.0
- v3.11.0
- v3.10.0
- v3.9.0
- v3.8.0
- v3.7.0
- v3.6.0
- v3.5.0
- v3.4.0
- v3.3.0
- v3.2.0
- v3.1.0
- v3.0.2
- v3.0.1
- v3.0.0
- v2.99.0
- v2.98.0
- v2.97.0
- v2.96.0
- v2.95.0
- v2.94.0
- v2.93.1
- v2.93.0
- v2.92.0
- v2.91.0
- v2.90.0
- v2.89.0
- v2.88.1
- v2.88.0
- v2.87.0
- v2.86.0
- v2.85.0
- v2.84.0
- v2.83.0
- v2.82.0
- v2.81.0
- v2.80.0
- v2.79.1
- v2.79.0
- v2.78.0
- v2.77.0
- v2.76.0
- v2.75.0
- v2.74.0
- v2.73.0
- v2.72.0
- v2.71.0
- v2.70.0
- v2.69.0
- v2.68.0
- v2.67.0
- v2.66.0
- v2.65.0
- v2.64.0
- v2.63.0
- v2.62.1
- v2.62.0
- v2.61.0
- v2.60.0
- v2.59.0
- v2.58.0
- v2.57.0
- v2.56.0
- v2.55.0
- v2.54.0
- v2.53.0
- v2.52.0
- v2.51.0
- v2.50.0
- v2.49.0
- v2.48.0
- v2.47.0
- v2.46.1
- v2.46.0
- v2.45.1
- v2.45.0
- v2.44.0
- v2.43.0
- v2.42.0
- v2.41.0
- v2.40.0
- v2.39.0
- v2.38.0
- v2.37.0
- v2.36.0
- v2.35.0
- v2.34.0
- v2.33.0
- v2.32.0
- v2.31.1
- v2.31.0
- v2.30.0
- v2.29.0
- v2.28.0
- v2.27.0
- v2.26.0
- v2.25.0
- v2.24.0
- v2.23.0
- v2.22.0
- v2.21.0
- v2.20.0
- v2.19.0
- v2.18.0
- v2.17.0
- v2.16.0
- v2.15.0
- v2.14.0
- v2.13.0
- v2.12.0
- v2.11.0
- v2.10.0
- v2.9.0
- v2.8.0
- v2.7.0
- v2.6.0
- v2.5.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v1.44.0
- v1.43.0
- v1.42.0
- v1.41.0
- v1.40.0
- v1.39.0
- v1.38.0
- v1.37.0
- v1.36.1
- v1.36.0
- v1.35.0
Showing
5 changed files
with
466 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
package azurerm | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
"github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2018-07-12/botservice" | ||
"github.com/hashicorp/terraform/helper/schema" | ||
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" | ||
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" | ||
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" | ||
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" | ||
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" | ||
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" | ||
) | ||
|
||
func resourceArmBotChannelEmail() *schema.Resource { | ||
return &schema.Resource{ | ||
Create: resourceArmBotChannelEmailCreate, | ||
Read: resourceArmBotChannelEmailRead, | ||
Delete: resourceArmBotChannelEmailDelete, | ||
Update: resourceArmBotChannelEmailUpdate, | ||
|
||
Importer: &schema.ResourceImporter{ | ||
State: schema.ImportStatePassthrough, | ||
}, | ||
|
||
Schema: map[string]*schema.Schema{ | ||
"resource_group_name": azure.SchemaResourceGroupName(), | ||
|
||
"location": azure.SchemaLocation(), | ||
|
||
"bot_name": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
ValidateFunc: validate.NoEmptyStrings, | ||
}, | ||
|
||
"email_address": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
ValidateFunc: validate.NoEmptyStrings, | ||
}, | ||
|
||
"email_password": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
Sensitive: true, | ||
ValidateFunc: validate.NoEmptyStrings, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
func resourceArmBotChannelEmailCreate(d *schema.ResourceData, meta interface{}) error { | ||
client := meta.(*ArmClient).bot.ChannelClient | ||
ctx := meta.(*ArmClient).StopContext | ||
|
||
resourceGroup := d.Get("resource_group_name").(string) | ||
botName := d.Get("bot_name").(string) | ||
|
||
if features.ShouldResourcesBeImported() && d.IsNewResource() { | ||
existing, err := client.Get(ctx, resourceGroup, string(botservice.ChannelNameEmailChannel), botName) | ||
if err != nil { | ||
if !utils.ResponseWasNotFound(existing.Response) { | ||
return fmt.Errorf("Error checking for presence of creating Channel Email for Bot %q (Resource Group %q): %+v", resourceGroup, botName, err) | ||
} | ||
} | ||
if existing.ID != nil && *existing.ID != "" { | ||
return tf.ImportAsExistsError("azurerm_bot_channel_email", *existing.ID) | ||
} | ||
} | ||
|
||
channel := botservice.BotChannel{ | ||
Properties: botservice.EmailChannel{ | ||
Properties: &botservice.EmailChannelProperties{ | ||
EmailAddress: utils.String(d.Get("email_address").(string)), | ||
Password: utils.String(d.Get("email_password").(string)), | ||
IsEnabled: utils.Bool(true), | ||
}, | ||
ChannelName: botservice.ChannelNameEmailChannel1, | ||
}, | ||
Location: utils.String(azure.NormalizeLocation(d.Get("location").(string))), | ||
Kind: botservice.KindBot, | ||
} | ||
|
||
if _, err := client.Create(ctx, resourceGroup, botName, botservice.ChannelNameEmailChannel, channel); err != nil { | ||
return fmt.Errorf("Error issuing create request for Channel Email for Bot %q (Resource Group %q): %+v", resourceGroup, botName, err) | ||
} | ||
|
||
resp, err := client.Get(ctx, resourceGroup, botName, string(botservice.ChannelNameEmailChannel)) | ||
if err != nil { | ||
return fmt.Errorf("Error making get request for Channel Email for Bot %q (Resource Group %q): %+v", resourceGroup, botName, err) | ||
} | ||
|
||
if resp.ID == nil { | ||
return fmt.Errorf("Cannot read Channel Email for Bot %q (Resource Group %q): %+v", resourceGroup, botName, err) | ||
} | ||
|
||
d.SetId(*resp.ID) | ||
|
||
return resourceArmBotChannelEmailRead(d, meta) | ||
} | ||
|
||
func resourceArmBotChannelEmailRead(d *schema.ResourceData, meta interface{}) error { | ||
client := meta.(*ArmClient).bot.ChannelClient | ||
ctx := meta.(*ArmClient).StopContext | ||
|
||
id, err := azure.ParseAzureResourceID(d.Id()) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
botName := id.Path["botServices"] | ||
resp, err := client.Get(ctx, id.ResourceGroup, botName, string(botservice.ChannelNameEmailChannel)) | ||
if err != nil { | ||
if utils.ResponseWasNotFound(resp.Response) { | ||
log.Printf("[INFO] Channel Email for Bot %q (Resource Group %q) was not found - removing from state!", id.ResourceGroup, botName) | ||
d.SetId("") | ||
return nil | ||
} | ||
|
||
return fmt.Errorf("Error reading Channel Email for Bot %q (Resource Group %q): %+v", id.ResourceGroup, botName, err) | ||
} | ||
|
||
d.Set("resource_group_name", id.ResourceGroup) | ||
d.Set("location", resp.Location) | ||
d.Set("bot_name", botName) | ||
|
||
if props := resp.Properties; props != nil { | ||
if channel, ok := props.AsEmailChannel(); ok { | ||
if channelProps := channel.Properties; channelProps != nil { | ||
d.Set("email_address", channelProps.EmailAddress) | ||
} | ||
} | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func resourceArmBotChannelEmailUpdate(d *schema.ResourceData, meta interface{}) error { | ||
client := meta.(*ArmClient).bot.ChannelClient | ||
ctx := meta.(*ArmClient).StopContext | ||
|
||
id, err := azure.ParseAzureResourceID(d.Id()) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
botName := id.Path["botServices"] | ||
|
||
channel := botservice.BotChannel{ | ||
Properties: botservice.EmailChannel{ | ||
Properties: &botservice.EmailChannelProperties{ | ||
EmailAddress: utils.String(d.Get("email_address").(string)), | ||
Password: utils.String(d.Get("email_password").(string)), | ||
IsEnabled: utils.Bool(true), | ||
}, | ||
ChannelName: botservice.ChannelNameEmailChannel1, | ||
}, | ||
Location: utils.String(azure.NormalizeLocation(d.Get("location").(string))), | ||
Kind: botservice.KindBot, | ||
} | ||
|
||
if _, err := client.Update(ctx, id.ResourceGroup, botName, botservice.ChannelNameEmailChannel, channel); err != nil { | ||
return fmt.Errorf("Error issuing create request for Channel Email for Bot %q (Resource Group %q): %+v", id.ResourceGroup, botName, err) | ||
} | ||
|
||
resp, err := client.Get(ctx, id.ResourceGroup, botName, string(botservice.ChannelNameEmailChannel)) | ||
if err != nil { | ||
return fmt.Errorf("Error making get request for Channel Email for Bot %q (Resource Group %q): %+v", id.ResourceGroup, botName, err) | ||
} | ||
|
||
if resp.ID == nil { | ||
return fmt.Errorf("Cannot read Channel Email for Bot %q (Resource Group %q): %+v", id.ResourceGroup, botName, err) | ||
} | ||
|
||
d.SetId(*resp.ID) | ||
|
||
return resourceArmBotChannelEmailRead(d, meta) | ||
} | ||
|
||
func resourceArmBotChannelEmailDelete(d *schema.ResourceData, meta interface{}) error { | ||
client := meta.(*ArmClient).bot.ChannelClient | ||
ctx := meta.(*ArmClient).StopContext | ||
|
||
id, err := azure.ParseAzureResourceID(d.Id()) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
botName := id.Path["botServices"] | ||
|
||
resp, err := client.Delete(ctx, id.ResourceGroup, botName, string(botservice.ChannelNameEmailChannel)) | ||
if err != nil { | ||
if !response.WasNotFound(resp.Response) { | ||
return fmt.Errorf("Error deleting Channel Email for Bot %q (Resource Group %q): %+v", id.ResourceGroup, botName, err) | ||
} | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
package azurerm | ||
|
||
import ( | ||
"fmt" | ||
"net/http" | ||
"os" | ||
"testing" | ||
|
||
"github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2018-07-12/botservice" | ||
"github.com/hashicorp/terraform/helper/resource" | ||
"github.com/hashicorp/terraform/terraform" | ||
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" | ||
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" | ||
) | ||
|
||
func TestAccAzureRMBotChannelEmail_basic(t *testing.T) { | ||
if ok := skipEmailChannel(); ok { | ||
t.Skip("Skipping as one of `ARM_TEST_EMAIL`, AND `ARM_TEST_EMAIL_PASSWORD` was not specified") | ||
} | ||
ri := tf.AccRandTimeInt() | ||
config := testAccAzureRMBotChannelEmail_basicConfig(ri, testLocation()) | ||
resourceName := "azurerm_bot_channel_email.test" | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMBotChannelEmailDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
Check: resource.ComposeTestCheckFunc( | ||
testCheckAzureRMBotChannelEmailExists(resourceName), | ||
), | ||
}, | ||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{ | ||
"email_password", | ||
}, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func TestAccAzureRMBotChannelEmail_update(t *testing.T) { | ||
if ok := skipEmailChannel(); ok { | ||
t.Skip("Skipping as one of `ARM_TEST_EMAIL`, AND `ARM_TEST_EMAIL_PASSWORD` was not specified") | ||
} | ||
if ok := skipSlackChannel(); ok { | ||
t.Skip("Skipping as one of `ARM_TEST_SLACK_CLIENT_ID`, `ARM_TEST_SLACK_CLIENT_SECRET`, or `ARM_TEST_SLACK_VERIFICATION_TOKEN` was not specified") | ||
} | ||
ri := tf.AccRandTimeInt() | ||
config := testAccAzureRMBotChannelEmail_basicConfig(ri, testLocation()) | ||
config2 := testAccAzureRMBotChannelEmail_basicUpdate(ri, testLocation()) | ||
resourceName := "azurerm_bot_channel_email.test" | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMBotChannelEmailDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
Check: resource.ComposeTestCheckFunc( | ||
testCheckAzureRMBotChannelEmailExists(resourceName), | ||
), | ||
}, | ||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{ | ||
"email_password", | ||
}, | ||
}, | ||
{ | ||
Config: config2, | ||
Check: resource.ComposeTestCheckFunc( | ||
testCheckAzureRMBotChannelEmailExists(resourceName), | ||
), | ||
}, | ||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{ | ||
"email_password", | ||
}, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func testCheckAzureRMBotChannelEmailExists(name string) resource.TestCheckFunc { | ||
return func(s *terraform.State) error { | ||
// Ensure we have enough information in state to look up in API | ||
rs, ok := s.RootModule().Resources[name] | ||
if !ok { | ||
return fmt.Errorf("Not found: %s", name) | ||
} | ||
|
||
botName := rs.Primary.Attributes["bot_name"] | ||
resourceGroup, hasResourceGroup := rs.Primary.Attributes["resource_group_name"] | ||
if !hasResourceGroup { | ||
return fmt.Errorf("Bad: no resource group found in state for Bot Channel Email") | ||
} | ||
|
||
client := testAccProvider.Meta().(*ArmClient).bot.ChannelClient | ||
ctx := testAccProvider.Meta().(*ArmClient).StopContext | ||
|
||
resp, err := client.Get(ctx, resourceGroup, botName, string(botservice.ChannelNameEmailChannel)) | ||
if err != nil { | ||
return fmt.Errorf("Bad: Get on botChannelClient: %+v", err) | ||
} | ||
|
||
if utils.ResponseWasNotFound(resp.Response) { | ||
return fmt.Errorf("Bad: Bot Channel Email %q (resource group: %q / bot: %q) does not exist", name, resourceGroup, botName) | ||
} | ||
|
||
return nil | ||
} | ||
} | ||
|
||
func testCheckAzureRMBotChannelEmailDestroy(s *terraform.State) error { | ||
client := testAccProvider.Meta().(*ArmClient).bot.ChannelClient | ||
ctx := testAccProvider.Meta().(*ArmClient).StopContext | ||
|
||
for _, rs := range s.RootModule().Resources { | ||
if rs.Type != "azurerm_bot_channel_email" { | ||
continue | ||
} | ||
|
||
botName := rs.Primary.Attributes["bot_name"] | ||
resourceGroup := rs.Primary.Attributes["resource_group_name"] | ||
|
||
resp, err := client.Get(ctx, resourceGroup, botName, string(botservice.ChannelNameEmailChannel)) | ||
|
||
if err != nil { | ||
return nil | ||
} | ||
|
||
if resp.StatusCode != http.StatusNotFound { | ||
return fmt.Errorf("Bot Channel Email still exists:\n%#v", resp.Properties) | ||
} | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func testAccAzureRMBotChannelEmail_basicConfig(rInt int, location string) string { | ||
template := testAccAzureRMBotChannelsRegistration_basicConfig(rInt, location) | ||
return fmt.Sprintf(` | ||
%s | ||
resource "azurerm_bot_channel_email" "test" { | ||
bot_name = "${azurerm_bot_channels_registration.test.name}" | ||
location = "${azurerm_bot_channels_registration.test.location}" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
email_address = "%s" | ||
email_password = "%s" | ||
} | ||
`, template, os.Getenv("ARM_TEST_EMAIL"), os.Getenv("ARM_TEST_EMAIL_PASSWORD")) | ||
} | ||
|
||
func testAccAzureRMBotChannelEmail_basicUpdate(rInt int, location string) string { | ||
template := testAccAzureRMBotChannelsRegistration_basicConfig(rInt, location) | ||
return fmt.Sprintf(` | ||
%s | ||
resource "azurerm_bot_channel_email" "test" { | ||
bot_name = "${azurerm_bot_channels_registration.test.name}" | ||
location = "${azurerm_bot_channels_registration.test.location}" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
email_address = "%s" | ||
email_password = "%s" | ||
} | ||
`, template, os.Getenv("ARM_TEST_EMAIL"), os.Getenv("ARM_TEST_EMAIL_PASSWORD")) | ||
} | ||
|
||
func skipEmailChannel() bool { | ||
if os.Getenv("ARM_TEST_EMAIL") == "" || os.Getenv("ARM_TEST_EMAIL_PASSWORD") == "" { | ||
return true | ||
} | ||
|
||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
layout: "azurerm" | ||
page_title: "Azure Resource Manager: azurerm_bot_channel_email" | ||
sidebar_current: "docs-azurerm-resource-bot-channel-email" | ||
description: |- | ||
Manages a Email integration for a Bot Channel | ||
--- | ||
|
||
# azurerm_bot_connection | ||
|
||
Manages a Email integration for a Bot Channel | ||
|
||
~> **Note** A bot can only have a single Email Channel associated with it. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "azurerm_client_config" "current" {} | ||
resource "azurerm_resource_group" "example" { | ||
name = "example" | ||
location = "northeurope" | ||
} | ||
resource "azurerm_bot_channels_registration" "example" { | ||
name = "example" | ||
location = "global" | ||
resource_group_name = "${azurerm_resource_group.example.name}" | ||
sku = "F0" | ||
microsoft_app_id = "${data.azurerm_client_config.current.service_principal_application_id}" | ||
} | ||
resource "azurerm_bot_channel_Email" "example" { | ||
bot_name = "${azurerm_bot_channels_registration.example.name}" | ||
location = "${azurerm_bot_channels_registration.example.location}" | ||
resource_group_name = "${azurerm_resource_group.example.name}" | ||
client_id = "exampleId" | ||
client_secret = "exampleSecret" | ||
verification_token = "exampleVerificationToken" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `resource_group_name` - (Required) The name of the resource group in which to create the Bot Channel. Changing this forces a new resource to be created. | ||
|
||
* `location` - (Required) The supported Azure location where the resource exists. Changing this forces a new resource to be created. | ||
|
||
* `bot_name` - (Required) The name of the Bot Resource this channel will be associated with. Changing this forces a new resource to be created. | ||
|
||
* `email_address` - (Required) The email address that the Bot will authenticate with. | ||
|
||
* `email_password` - (Required) The email password that the the Bot will authenticate with. | ||
|
||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `id` - The Bot Channel ID. | ||
|
||
## Import | ||
|
||
The Email Channel for a Bot can be imported using the `resource id`, e.g. | ||
|
||
```shell | ||
terraform import azurerm_bot_channel_email.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.BotService/botServices/example/channels/EmailChannel | ||
``` |