hashicorp / terraform-provider-awscc

Terraform AWS Cloud Control provider
https://registry.terraform.io/providers/hashicorp/awscc/latest/docs
Mozilla Public License 2.0
256 stars 117 forks source link

Terraform doesn't send the "Channel Name" to AWS chatbot in in awscc_chatbot_microsoft_teams_channel_configuration #1233

Open javicor opened 1 year ago

javicor commented 1 year ago

Community Note

Terraform CLI and Terraform AWS Cloud Control Provider Version

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "awscc_chatbot_microsoft_teams_channel_configuration" "ChatBot_Test" {

  configuration_name = var.Name_Chatbot
  iam_role_arn       = aws_iam_role.role.arn
  team_id            = var.team_id
  ## Here we put the channel ID of the Microsoft teams group, but in the AWS Chatbot when it creates it does not identify the "Channel Name" and sets it to Null.
  teams_channel_id   = var.teams_channel_id
  teams_tenant_id    = var.teams_tenant_id
  guardrail_policies = [data.aws_iam_policy.PolicyReadEc2.arn]
  sns_topic_arns     = [var.sns_arn]

}

Debug Output

Resource "awscc_chatbot_microsoft_teams_channel_configuration" "ChatBot_test" {

Panic Output

Expected Behavior

field: teams_channel_id

In the configuration Channels of AWS Chatboot the channel name field should appear as the name of the channel name if the default is "General" or if you create another should also put the name.

I provide the information on how the link to the teams channel is provided.

https://teams.microsoft.com/l/channel/xx%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%40thread.tacv2/General?groupId=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx&tenantId=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Actual Behavior

field: teams_channel_id

It is always setting the Channel Name to NULL.

Steps to Reproduce

  1. Enter all the information from Resource "awscc_chatbot_microsoft_teams_channel_configuration".
  2. terraform apply
  3. Validate in the AWS ChatBot in the Channel settings. Check the field called Channel Name. You will notice that there is nothing.
  4. Select the Channel I just created and edit it manually.
  5. Check the field called Channel URL and copy all the information from the URL that appears there. Look that in this link appears the word NULL and not the name of the channel we want to send the notifications. https://teams.microsoft.com/l/channel/xx%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%40thread.tacv2/null?groupId=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx&tenantId=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  6. If you try to send a test notification it does not reach the Teams group, because you cannot identify which channel name to send it to.

Important Factoids

References

cristianketrics commented 5 months ago

Same problem here

SuryaTeja18 commented 4 months ago

The issue is also the same with CDK CfnMicrosoftTeamsChannelConfiguration construct:

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_chatbot.CfnMicrosoftTeamsChannelConfiguration.html

It doesn’t send Channel Name so its always set to null. If it does include Channel Name, this ideally shouldn’t occur.

SuryaTeja18 commented 4 months ago

On a side note, is there any reason as to why ChannelName is also not a "required" parameter in SDK? Eg - create_microsoft_teams_channel_configuration (boto3)

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/chatbot/client/create_microsoft_teams_channel_configuration.html

rafal-skurka commented 4 months ago

bump, it still doesn't work

7adityaraj commented 2 months ago

same issue, It is always setting the Channel Name to NULL. while trying to create via AWS console, it take full URL of msteam (link to the channel) and channel name get populated itself

wellsiau-aws commented 2 months ago

@SuryaTeja18 , to confirm, are you able to replicate the problem while using CDK ? where the Channel name always returned null ?