Try AWS Native preview for resources not in the classic version.
aws.cognito.ResourceServer
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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.
- User
Pool stringId - Name string
A name for the resource server.
- Scopes
List<Resource
Server Scope> A list of Authorization Scope.
- Identifier string
An identifier for the resource server.
- User
Pool stringId - Name string
A name for the resource server.
- Scopes
[]Resource
Server Scope Args A list of Authorization Scope.
- identifier String
An identifier for the resource server.
- user
Pool StringId - name String
A name for the resource server.
- scopes
List<Resource
Server Scope> A list of Authorization Scope.
- identifier string
An identifier for the resource server.
- user
Pool stringId - name string
A name for the resource server.
- scopes
Resource
Server Scope[] A list of Authorization Scope.
- identifier str
An identifier for the resource server.
- user_
pool_ strid - name str
A name for the resource server.
- scopes
Sequence[Resource
Server Scope Args] A list of Authorization Scope.
- identifier String
An identifier for the resource server.
- user
Pool StringId - 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.
- Scope
Identifiers 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.
- Scope
Identifiers []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.
- scope
Identifiers 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.
- scope
Identifiers 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.
- scope
Identifiers 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.
- Identifier string
An identifier for the resource server.
- Name string
A name for the resource server.
- Scope
Identifiers List<string> A list of all scopes configured for this resource server in the format identifier/scope_name.
- Scopes
List<Resource
Server Scope> A list of Authorization Scope.
- User
Pool stringId
- Identifier string
An identifier for the resource server.
- Name string
A name for the resource server.
- Scope
Identifiers []string A list of all scopes configured for this resource server in the format identifier/scope_name.
- Scopes
[]Resource
Server Scope Args A list of Authorization Scope.
- User
Pool stringId
- identifier String
An identifier for the resource server.
- name String
A name for the resource server.
- scope
Identifiers List<String> A list of all scopes configured for this resource server in the format identifier/scope_name.
- scopes
List<Resource
Server Scope> A list of Authorization Scope.
- user
Pool StringId
- identifier string
An identifier for the resource server.
- name string
A name for the resource server.
- scope
Identifiers string[] A list of all scopes configured for this resource server in the format identifier/scope_name.
- scopes
Resource
Server Scope[] A list of Authorization Scope.
- user
Pool stringId
- 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[Resource
Server Scope Args] A list of Authorization Scope.
- user_
pool_ strid
- identifier String
An identifier for the resource server.
- name String
A name for the resource server.
- scope
Identifiers 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.
- user
Pool StringId
Supporting Types
ResourceServerScope, ResourceServerScopeArgs
- Scope
Description string The scope description.
- Scope
Name string The scope name.
- Scope
Description string The scope description.
- Scope
Name string The scope name.
- scope
Description String The scope description.
- scope
Name String The scope name.
- scope
Description string The scope description.
- scope
Name string The scope name.
- scope_
description str The scope description.
- scope_
name str The scope name.
- scope
Description String The scope description.
- scope
Name 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.
Try AWS Native preview for resources not in the classic version.