Open
Description
What new functionality are you requesting?
- Data Source
aws_chatbot_slack_channel_configuration
- Service: AWS Chatbot Slack Channel Configuration
Description
I'd like to request a new data source for the existing aws_chatbot_slack_channel_configuration
resource.
When managing infrastructure with Terraform, it’s common to separate resources with different lifecycles into separate Terraform projects.
In my case, I’ve separated resources into two projects:
- One that creates AWS Chatbot Slack channel configurations.
- One that references these configurations (e.g., for notification rules).
Currently, there's no data source available to reference existing Chatbot Slack channel configurations.
Adding this data source would improve modularity and separation of concerns in Terraform configurations that work with AWS Chatbot resources.
Potential Terraform Configuration
Lookup by configuration name:
data "aws_chatbot_slack_channel_configuration" "example" {
configuration_name = "my-slack-channel"
}
Lookup by Slack channel and team IDs:
data "aws_chatbot_slack_channel_configuration" "example" {
slack_channel_id = "C07EZ1ABC23"
slack_team_id = "T07EA123LEP"
}
Usage example:
resource "aws_codestarnotifications_notification_rule" "codebuild" {
name = "build-notification"
// ...
target {
type = "AWSChatbotSlack"
address = data.aws_chatbot_slack_channel_configuration.example.configuration_arn
}
}
References
- https://docs.aws.amazon.com/cli/latest/reference/chatbot/describe-slack-channel-configurations.html
- https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/chatbot#Client.DescribeSlackChannelConfigurations
Would you like to implement the enhancement?
Yes