Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/provider: TestAccAWSCognitoUserPoolClient_analyticsConfig InvalidParameterException #15722

Closed
YakDriver opened this issue Oct 19, 2020 · 3 comments · Fixed by #14935
Closed
Assignees
Labels
partition/aws-us-gov Pertains to the aws-us-gov partition. service/iam Issues and PRs that pertain to the iam service. service/pinpoint Issues and PRs that pertain to the pinpoint service. service/sts Issues and PRs that pertain to the sts service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Milestone

Comments

@YakDriver
Copy link
Member

YakDriver commented Oct 19, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

The TestAccAWSCognitoUserPoolClient_analyticsConfig test on GovCloud is failing. It fails because the integration with Pinpoint is not supported in us-gov-west-1. Existing PreChecks can check for Cognito Identity and Pinpoint App support but not for the integration. This would be another excellent place for skipping the test with the functionality in hashicorp/terraform-plugin-sdk#592.

New or Affected Resource(s)

  • aws_cognito_user_pool_client

Terraform Configuration Files

data "aws_caller_identity" "current" {}

resource "aws_cognito_user_pool" "test" {
  name = "tf-acc-cognito-user-pool"
}

resource "aws_pinpoint_app" "test" {
  name = "yakdriver"
}

resource "aws_iam_role" "test" {
  name = "yakdriver"

  assume_role_policy = <<EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "cognito-idp.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
EOF
}

resource "aws_iam_role_policy" "test" {
  name = "yakdriver"
  role = aws_iam_role.test.id

  policy = <<-EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "mobiletargeting:UpdateEndpoint",
        "mobiletargeting:PutItems"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:mobiletargeting:*:${data.aws_caller_identity.current.account_id}:apps/${aws_pinpoint_app.test.application_id}*"
    }
  ]
}
EOF
}

resource "aws_cognito_user_pool_client" "test" {
  name         = "tf-acc-cognito-user-pool"
  user_pool_id = aws_cognito_user_pool.test.id

  analytics_configuration {
    application_id = aws_pinpoint_app.test.application_id
    external_id    = "tf-acc-cognito-user-pool"
    role_arn       = aws_iam_role.test.arn
  }
}

Debug Output

    TestAccAWSCognitoUserPoolClient_analyticsConfig: resource_aws_cognito_user_pool_client_test.go:235: Step 1/4 error: Error running apply: 2020/10/19 21:23:22 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0
        
        Error: Error creating Cognito User Pool Client: InvalidParameterException: The integration with Pinpoint is not supported in this region.

--- FAIL: TestAccAWSCognitoUserPoolClient_analyticsConfig (34.82s)

References

@YakDriver YakDriver added the partition/aws-us-gov Pertains to the aws-us-gov partition. label Oct 19, 2020
@ghost ghost added service/cognito service/iam Issues and PRs that pertain to the iam service. service/pinpoint Issues and PRs that pertain to the pinpoint service. service/sts Issues and PRs that pertain to the sts service. labels Oct 19, 2020
@YakDriver YakDriver added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Oct 19, 2020
@bflad
Copy link
Contributor

bflad commented Feb 18, 2021

Just for searchability, a new similar acceptance test part of #16734 will also be affected:

=== CONT  TestAccAWSCognitoUserPoolClient_analyticsConfigWithArn
    resource_aws_cognito_user_pool_client_test.go:284: Step 1/2 error: Error running apply: exit status 1

        Error: Error creating Cognito User Pool Client: InvalidParameterException: The integration with Pinpoint is not supported in this region.

bflad pushed a commit that referenced this issue Feb 18, 2021
…rn` in the `analytics_configuration` block (#16734)

Reference: #16481

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSCognitoUserPoolClient_allFields (27.33s)
--- PASS: TestAccAWSCognitoUserPoolClient_allFieldsUpdatingOneField (38.51s)
--- PASS: TestAccAWSCognitoUserPoolClient_analyticsConfig (51.18s)
--- PASS: TestAccAWSCognitoUserPoolClient_analyticsConfigWithArn (29.25s)
--- PASS: TestAccAWSCognitoUserPoolClient_basic (28.54s)
--- PASS: TestAccAWSCognitoUserPoolClient_disappears (24.96s)
--- PASS: TestAccAWSCognitoUserPoolClient_Name (38.85s)
--- PASS: TestAccAWSCognitoUserPoolClient_RefreshTokenValidity (38.14s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- FAIL: TestAccAWSCognitoUserPoolClient_analyticsConfig (20.37s) # #15722
--- FAIL: TestAccAWSCognitoUserPoolClient_analyticsConfigWithArn (20.33s) # #15722
--- PASS: TestAccAWSCognitoUserPoolClient_allFields (31.97s)
--- PASS: TestAccAWSCognitoUserPoolClient_allFieldsUpdatingOneField (43.43s)
--- PASS: TestAccAWSCognitoUserPoolClient_basic (31.46s)
--- PASS: TestAccAWSCognitoUserPoolClient_disappears (27.90s)
--- PASS: TestAccAWSCognitoUserPoolClient_Name (43.75s)
--- PASS: TestAccAWSCognitoUserPoolClient_RefreshTokenValidity (45.01s)
```
@YakDriver YakDriver self-assigned this Mar 9, 2021
@github-actions github-actions bot added this to the v3.32.0 milestone Mar 9, 2021
@ghost
Copy link

ghost commented Mar 12, 2021

This has been released in version 3.32.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Apr 8, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
partition/aws-us-gov Pertains to the aws-us-gov partition. service/iam Issues and PRs that pertain to the iam service. service/pinpoint Issues and PRs that pertain to the pinpoint service. service/sts Issues and PRs that pertain to the sts service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants