Resource: aws_cognito_resource_server

Provides a Cognito Resource Server.

Example Usage

Create a basic resource server

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

resource "aws_cognito_resource_server" "resource" {
  identifier = "https://example.com"
  name       = "example"

  user_pool_id = aws_cognito_user_pool.pool.id
}

Create a resource server with sample-scope

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

resource "aws_cognito_resource_server" "resource" {
  identifier = "https://example.com"
  name       = "example"

  scope {
    scope_name        = "sample-scope"
    scope_description = "a Sample Scope Description"
  }

  user_pool_id = aws_cognito_user_pool.pool.id
}

Argument Reference

This resource supports the following arguments:

Authorization Scope

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import aws_cognito_resource_server using their User Pool ID and Identifier. For example:

import {
  to = aws_cognito_resource_server.example
  id = "us-west-2_abc123|https://example.com"
}

Using terraform import, import aws_cognito_resource_server using their User Pool ID and Identifier. For example:

% terraform import aws_cognito_resource_server.example "us-west-2_abc123|https://example.com"