diff --git a/website/docs/r/cognito_identity_pool_roles_attachment.markdown b/website/docs/r/cognito_identity_pool_roles_attachment.markdown index 52afa0cbe08..0e5f66201c4 100644 --- a/website/docs/r/cognito_identity_pool_roles_attachment.markdown +++ b/website/docs/r/cognito_identity_pool_roles_attachment.markdown @@ -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