hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.61k stars 8.99k forks source link

[New Resource]: Cognito User Pool LogDeliveryConfiguration #36251

Open merinhunter opened 3 months ago

merinhunter commented 3 months ago

Description

The resource aws_cognito_user_pool allows to modify several attributes of a Cognito User Pool. However, the LogDeliveryConfiguration cannot be set using this resource or any other from the Terraform Provider for AWS.

In CloudFormation there is a resource called AWS::Cognito::LogDeliveryConfiguration that serves for the purpose I'm looking for, and it is different from the one that creates the Cognito User Pool, that is called AWS::Cognito::UserPool. Also, according to the AWS Cognito API Reference this setting can be configured via API call.

For these reasons, it makes sense to create a new resource rather than modifying the aws_cognito_user_pool existing one.

Requested Resource(s) and/or Data Source(s)

aws_cognito_log_delivery_configuration

Potential Terraform Configuration

resource "aws_cognito_log_delivery_configuration" "example" {
  user_pool_id = aws_cognito_user_pool.pool.id

  log_configurations {
    log_level = "ERROR"
    event_source = "userNotification"
    cloudwatch_logs_configuration = {
      log_group_arn = aws_cloudwatch_log_group.aws_cognito_example.arn
    }
  }
}

resource "aws_cognito_user_pool" "pool" {
  name = "pool"
}

resource "aws_cloudwatch_log_group" "aws_cognito_example" {
  name              = "/aws/cognito/${aws_cognito_user_pool.pool.name}"
  retention_in_days = 30
}

References

Would you like to implement a fix?

No

github-actions[bot] commented 3 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue