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

[Enhancement]: Data Sources for Cognito User Pool #36087

Closed hanoj-budime closed 2 days ago

hanoj-budime commented 3 months ago

Description

Currently, we lack real-time descriptions of user pool information, which is crucial for end applications and Terraform operations to gather data. This information includes whether the user pool configuration has MFA activated, password patterns, sign-up enablement, required fields, etc.

Similarly, we are also missing real-time descriptions of app client information. This could prove beneficial for end applications, providing insights into whether the app client auth session timeout settings, etc.

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

data "aws_cognito_user_pool" "describe_user_pool"
{
  "UserPool": {
      "MfaConfiguration": "OFF",
      "Name": "MyUserPool",
      "AutoVerifiedAttributes": [
          "email"
      ],
      "Policies": {
          "PasswordPolicy": {
              "RequireLowercase": true,
              "RequireSymbols": true,
              "RequireNumbers": true,
              "MinimumLength": 8,
              "RequireUppercase": true
          }
      },
      "UsernameAttributes": [
          "email"
      ],
      "Id": "us-west-2_aaaaaaaaa",
  }
}

Potential Terraform Configuration

No response

References

No response

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

danquack commented 3 months ago

@HanojHanu you mentioned a data source for a specific user pool, but your title also stated a data source for an app client. There is a data source for user_pool_client is that what you are referring to?

From the description, it just appears you want to lookup the properties for a user pool, so just want to make sure I understand what insight you are looking for.

hanoj-budime commented 3 months ago

Yes, @danquack.

Looking for data source for a specific user pool

SolomonHD commented 2 months ago

Yes, we need a data "aws_cognito_user_pool", without we can't get the custom domain attribute. I have to use a pre-existing user pool.

I've got a hack with the import block and the resource "aws_cognito_user_pool" with an ignore_changes lifecycle attached, but it requires that I remove it from state before deleting to avoid errors.

github-actions[bot] commented 2 days ago

[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.