1. Packages
  2. AWS Classic
  3. API Docs
  4. cognito
  5. ResourceServer

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.13.1 published on Tuesday, Dec 5, 2023 by Pulumi

aws.cognito.ResourceServer

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.13.1 published on Tuesday, Dec 5, 2023 by Pulumi

    Provides a Cognito Resource Server.

    Example Usage

    Create a basic resource server

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var pool = new Aws.Cognito.UserPool("pool");
    
        var resource = new Aws.Cognito.ResourceServer("resource", new()
        {
            Identifier = "https://example.com",
            UserPoolId = pool.Id,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cognito"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		pool, err := cognito.NewUserPool(ctx, "pool", nil)
    		if err != nil {
    			return err
    		}
    		_, err = cognito.NewResourceServer(ctx, "resource", &cognito.ResourceServerArgs{
    			Identifier: pulumi.String("https://example.com"),
    			UserPoolId: pool.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cognito.UserPool;
    import com.pulumi.aws.cognito.ResourceServer;
    import com.pulumi.aws.cognito.ResourceServerArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var pool = new UserPool("pool");
    
            var resource = new ResourceServer("resource", ResourceServerArgs.builder()        
                .identifier("https://example.com")
                .userPoolId(pool.id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    pool = aws.cognito.UserPool("pool")
    resource = aws.cognito.ResourceServer("resource",
        identifier="https://example.com",
        user_pool_id=pool.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const pool = new aws.cognito.UserPool("pool", {});
    const resource = new aws.cognito.ResourceServer("resource", {
        identifier: "https://example.com",
        userPoolId: pool.id,
    });
    
    resources:
      pool:
        type: aws:cognito:UserPool
      resource:
        type: aws:cognito:ResourceServer
        properties:
          identifier: https://example.com
          userPoolId: ${pool.id}
    

    Create a resource server with sample-scope

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var pool = new Aws.Cognito.UserPool("pool");
    
        var resource = new Aws.Cognito.ResourceServer("resource", new()
        {
            Identifier = "https://example.com",
            Scopes = new[]
            {
                new Aws.Cognito.Inputs.ResourceServerScopeArgs
                {
                    ScopeName = "sample-scope",
                    ScopeDescription = "a Sample Scope Description",
                },
            },
            UserPoolId = pool.Id,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cognito"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		pool, err := cognito.NewUserPool(ctx, "pool", nil)
    		if err != nil {
    			return err
    		}
    		_, err = cognito.NewResourceServer(ctx, "resource", &cognito.ResourceServerArgs{
    			Identifier: pulumi.String("https://example.com"),
    			Scopes: cognito.ResourceServerScopeArray{
    				&cognito.ResourceServerScopeArgs{
    					ScopeName:        pulumi.String("sample-scope"),
    					ScopeDescription: pulumi.String("a Sample Scope Description"),
    				},
    			},
    			UserPoolId: pool.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cognito.UserPool;
    import com.pulumi.aws.cognito.ResourceServer;
    import com.pulumi.aws.cognito.ResourceServerArgs;
    import com.pulumi.aws.cognito.inputs.ResourceServerScopeArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var pool = new UserPool("pool");
    
            var resource = new ResourceServer("resource", ResourceServerArgs.builder()        
                .identifier("https://example.com")
                .scopes(ResourceServerScopeArgs.builder()
                    .scopeName("sample-scope")
                    .scopeDescription("a Sample Scope Description")
                    .build())
                .userPoolId(pool.id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    pool = aws.cognito.UserPool("pool")
    resource = aws.cognito.ResourceServer("resource",
        identifier="https://example.com",
        scopes=[aws.cognito.ResourceServerScopeArgs(
            scope_name="sample-scope",
            scope_description="a Sample Scope Description",
        )],
        user_pool_id=pool.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const pool = new aws.cognito.UserPool("pool", {});
    const resource = new aws.cognito.ResourceServer("resource", {
        identifier: "https://example.com",
        scopes: [{
            scopeName: "sample-scope",
            scopeDescription: "a Sample Scope Description",
        }],
        userPoolId: pool.id,
    });
    
    resources:
      pool:
        type: aws:cognito:UserPool
      resource:
        type: aws:cognito:ResourceServer
        properties:
          identifier: https://example.com
          scopes:
            - scopeName: sample-scope
              scopeDescription: a Sample Scope Description
          userPoolId: ${pool.id}
    

    Create ResourceServer Resource

    new ResourceServer(name: string, args: ResourceServerArgs, opts?: CustomResourceOptions);
    @overload
    def ResourceServer(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       identifier: Optional[str] = None,
                       name: Optional[str] = None,
                       scopes: Optional[Sequence[ResourceServerScopeArgs]] = None,
                       user_pool_id: Optional[str] = None)
    @overload
    def ResourceServer(resource_name: str,
                       args: ResourceServerArgs,
                       opts: Optional[ResourceOptions] = None)
    func NewResourceServer(ctx *Context, name string, args ResourceServerArgs, opts ...ResourceOption) (*ResourceServer, error)
    public ResourceServer(string name, ResourceServerArgs args, CustomResourceOptions? opts = null)
    public ResourceServer(String name, ResourceServerArgs args)
    public ResourceServer(String name, ResourceServerArgs args, CustomResourceOptions options)
    
    type: aws:cognito:ResourceServer
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ResourceServerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ResourceServerArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ResourceServerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ResourceServerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ResourceServerArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ResourceServer Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ResourceServer resource accepts the following input properties:

    Identifier string

    An identifier for the resource server.

    UserPoolId string
    Name string

    A name for the resource server.

    Scopes List<ResourceServerScope>

    A list of Authorization Scope.

    Identifier string

    An identifier for the resource server.

    UserPoolId string
    Name string

    A name for the resource server.

    Scopes []ResourceServerScopeArgs

    A list of Authorization Scope.

    identifier String

    An identifier for the resource server.

    userPoolId String
    name String

    A name for the resource server.

    scopes List<ResourceServerScope>

    A list of Authorization Scope.

    identifier string

    An identifier for the resource server.

    userPoolId string
    name string

    A name for the resource server.

    scopes ResourceServerScope[]

    A list of Authorization Scope.

    identifier str

    An identifier for the resource server.

    user_pool_id str
    name str

    A name for the resource server.

    scopes Sequence[ResourceServerScopeArgs]

    A list of Authorization Scope.

    identifier String

    An identifier for the resource server.

    userPoolId String
    name String

    A name for the resource server.

    scopes List<Property Map>

    A list of Authorization Scope.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ResourceServer resource produces the following output properties:

    Id string

    The provider-assigned unique ID for this managed resource.

    ScopeIdentifiers List<string>

    A list of all scopes configured for this resource server in the format identifier/scope_name.

    Id string

    The provider-assigned unique ID for this managed resource.

    ScopeIdentifiers []string

    A list of all scopes configured for this resource server in the format identifier/scope_name.

    id String

    The provider-assigned unique ID for this managed resource.

    scopeIdentifiers List<String>

    A list of all scopes configured for this resource server in the format identifier/scope_name.

    id string

    The provider-assigned unique ID for this managed resource.

    scopeIdentifiers string[]

    A list of all scopes configured for this resource server in the format identifier/scope_name.

    id str

    The provider-assigned unique ID for this managed resource.

    scope_identifiers Sequence[str]

    A list of all scopes configured for this resource server in the format identifier/scope_name.

    id String

    The provider-assigned unique ID for this managed resource.

    scopeIdentifiers List<String>

    A list of all scopes configured for this resource server in the format identifier/scope_name.

    Look up Existing ResourceServer Resource

    Get an existing ResourceServer resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ResourceServerState, opts?: CustomResourceOptions): ResourceServer
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            identifier: Optional[str] = None,
            name: Optional[str] = None,
            scope_identifiers: Optional[Sequence[str]] = None,
            scopes: Optional[Sequence[ResourceServerScopeArgs]] = None,
            user_pool_id: Optional[str] = None) -> ResourceServer
    func GetResourceServer(ctx *Context, name string, id IDInput, state *ResourceServerState, opts ...ResourceOption) (*ResourceServer, error)
    public static ResourceServer Get(string name, Input<string> id, ResourceServerState? state, CustomResourceOptions? opts = null)
    public static ResourceServer get(String name, Output<String> id, ResourceServerState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Identifier string

    An identifier for the resource server.

    Name string

    A name for the resource server.

    ScopeIdentifiers List<string>

    A list of all scopes configured for this resource server in the format identifier/scope_name.

    Scopes List<ResourceServerScope>

    A list of Authorization Scope.

    UserPoolId string
    Identifier string

    An identifier for the resource server.

    Name string

    A name for the resource server.

    ScopeIdentifiers []string

    A list of all scopes configured for this resource server in the format identifier/scope_name.

    Scopes []ResourceServerScopeArgs

    A list of Authorization Scope.

    UserPoolId string
    identifier String

    An identifier for the resource server.

    name String

    A name for the resource server.

    scopeIdentifiers List<String>

    A list of all scopes configured for this resource server in the format identifier/scope_name.

    scopes List<ResourceServerScope>

    A list of Authorization Scope.

    userPoolId String
    identifier string

    An identifier for the resource server.

    name string

    A name for the resource server.

    scopeIdentifiers string[]

    A list of all scopes configured for this resource server in the format identifier/scope_name.

    scopes ResourceServerScope[]

    A list of Authorization Scope.

    userPoolId string
    identifier str

    An identifier for the resource server.

    name str

    A name for the resource server.

    scope_identifiers Sequence[str]

    A list of all scopes configured for this resource server in the format identifier/scope_name.

    scopes Sequence[ResourceServerScopeArgs]

    A list of Authorization Scope.

    user_pool_id str
    identifier String

    An identifier for the resource server.

    name String

    A name for the resource server.

    scopeIdentifiers List<String>

    A list of all scopes configured for this resource server in the format identifier/scope_name.

    scopes List<Property Map>

    A list of Authorization Scope.

    userPoolId String

    Supporting Types

    ResourceServerScope, ResourceServerScopeArgs

    ScopeDescription string

    The scope description.

    ScopeName string

    The scope name.

    ScopeDescription string

    The scope description.

    ScopeName string

    The scope name.

    scopeDescription String

    The scope description.

    scopeName String

    The scope name.

    scopeDescription string

    The scope description.

    scopeName string

    The scope name.

    scope_description str

    The scope description.

    scope_name str

    The scope name.

    scopeDescription String

    The scope description.

    scopeName String

    The scope name.

    Import

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

     $ pulumi import aws:cognito/resourceServer:ResourceServer example "us-west-2_abc123|https://example.com"
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the aws Terraform Provider.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.13.1 published on Tuesday, Dec 5, 2023 by Pulumi