Skip to content
This repository has been archived by the owner on Dec 24, 2023. It is now read-only.

Commit

Permalink
Temp remove cognito_identity_pool_roles_attachment example beacuse of…
Browse files Browse the repository at this point in the history
… flaky translation
  • Loading branch information
t0yv0 authored and iwahbe committed Jul 7, 2023
1 parent ff49f63 commit 4a95acc
Showing 1 changed file with 0 additions and 81 deletions.
81 changes: 0 additions & 81 deletions website/docs/r/cognito_identity_pool_roles_attachment.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,87 +12,6 @@ Provides an AWS Cognito Identity Pool Roles Attachment.

## Example Usage

```terraform
resource "aws_cognito_identity_pool" "main" {
identity_pool_name = "identity pool"
allow_unauthenticated_identities = false
supported_login_providers = {
"graph.facebook.com" = "7346241598935555"
}
}
data "aws_iam_policy_document" "authenticated" {
statement {
effect = "Allow"
principals {
type = "Federated"
identifiers = ["cognito-identity.amazonaws.com"]
}
actions = ["sts:AssumeRoleWithWebIdentity"]
condition {
test = "StringEquals"
variable = "cognito-identity.amazonaws.com:aud"
values = [aws_cognito_identity_pool.main.id]
}
condition {
test = "ForAnyValue:StringLike"
variable = "cognito-identity.amazonaws.com:amr"
values = ["authenticated"]
}
}
}
resource "aws_iam_role" "authenticated" {
name = "cognito_authenticated"
assume_role_policy = data.aws_iam_policy_document.authenticated.json
}
data "aws_iam_policy_document" "authenticated_role_policy" {
statement {
effect = "Allow"
actions = [
"mobileanalytics:PutEvents",
"cognito-sync:*",
"cognito-identity:*",
]
resources = ["*"]
}
}
resource "aws_iam_role_policy" "authenticated" {
name = "authenticated_policy"
role = aws_iam_role.authenticated.id
policy = data.aws_iam_policy_document.authenticated_role_policy.json
}
resource "aws_cognito_identity_pool_roles_attachment" "main" {
identity_pool_id = aws_cognito_identity_pool.main.id
role_mapping {
identity_provider = "graph.facebook.com"
ambiguous_role_resolution = "AuthenticatedRole"
type = "Rules"
mapping_rule {
claim = "isAdmin"
match_type = "Equals"
role_arn = aws_iam_role.authenticated.arn
value = "paid"
}
}
roles = {
"authenticated" = aws_iam_role.authenticated.arn
}
}
```

## Argument Reference

Expand Down

0 comments on commit 4a95acc

Please sign in to comment.