hashicorp / terraform-provider-awscc

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

Optional parameters guardrail_policies and sns_topics_arn not taken into consideration #891

Open jmpcba opened 1 year ago

jmpcba 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_slack_channel_configuration" "chatbot_slack_channel" {
  count              = var.enable_slack_integration ? 1 : 0
  configuration_name = "cost-anomaly-alerts"
  iam_role_arn       = aws_iam_role.cost_anomaly_chatbot_role[0].arn
  slack_channel_id   = var.slack_channel_id
  slack_workspace_id = var.slack_workspace_id
  guardrail_policies = tolist(["arn:aws:iam::aws:policy/AWSAccountManagementReadOnlyAccess",])
  sns_topic_arns = tolist([aws_sns_topic.cost_anomaly_topic.arn,])
}

Debug Output

Panic Output

Expected Behavior

the awscc_chatbot_slack_channel_configuration resource should use the values provided by the optional parameters guardrail_policies and sns_topic_arns

Actual Behavior

the resource uses default values and ignores the ones passed as parameters

Steps to Reproduce

  1. terraform plan

Important Factoids

References

kadrach commented 1 year ago

Hey @jmpcba thank you for reporting! I cannot reproduce this on v0.54.0, the snippet above produces the desired configuration with topic and guardrails. Are you able to provide a minimum reproducible Terraform configuration?