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

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.IdentityProvider

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 User Identity Provider resource.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Cognito.UserPool("example", new()
        {
            AutoVerifiedAttributes = new[]
            {
                "email",
            },
        });
    
        var exampleProvider = new Aws.Cognito.IdentityProvider("exampleProvider", new()
        {
            UserPoolId = example.Id,
            ProviderName = "Google",
            ProviderType = "Google",
            ProviderDetails = 
            {
                { "authorize_scopes", "email" },
                { "client_id", "your client_id" },
                { "client_secret", "your client_secret" },
            },
            AttributeMapping = 
            {
                { "email", "email" },
                { "username", "sub" },
            },
        });
    
    });
    
    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 {
    		example, err := cognito.NewUserPool(ctx, "example", &cognito.UserPoolArgs{
    			AutoVerifiedAttributes: pulumi.StringArray{
    				pulumi.String("email"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cognito.NewIdentityProvider(ctx, "exampleProvider", &cognito.IdentityProviderArgs{
    			UserPoolId:   example.ID(),
    			ProviderName: pulumi.String("Google"),
    			ProviderType: pulumi.String("Google"),
    			ProviderDetails: pulumi.StringMap{
    				"authorize_scopes": pulumi.String("email"),
    				"client_id":        pulumi.String("your client_id"),
    				"client_secret":    pulumi.String("your client_secret"),
    			},
    			AttributeMapping: pulumi.StringMap{
    				"email":    pulumi.String("email"),
    				"username": pulumi.String("sub"),
    			},
    		})
    		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.UserPoolArgs;
    import com.pulumi.aws.cognito.IdentityProvider;
    import com.pulumi.aws.cognito.IdentityProviderArgs;
    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 example = new UserPool("example", UserPoolArgs.builder()        
                .autoVerifiedAttributes("email")
                .build());
    
            var exampleProvider = new IdentityProvider("exampleProvider", IdentityProviderArgs.builder()        
                .userPoolId(example.id())
                .providerName("Google")
                .providerType("Google")
                .providerDetails(Map.ofEntries(
                    Map.entry("authorize_scopes", "email"),
                    Map.entry("client_id", "your client_id"),
                    Map.entry("client_secret", "your client_secret")
                ))
                .attributeMapping(Map.ofEntries(
                    Map.entry("email", "email"),
                    Map.entry("username", "sub")
                ))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.cognito.UserPool("example", auto_verified_attributes=["email"])
    example_provider = aws.cognito.IdentityProvider("exampleProvider",
        user_pool_id=example.id,
        provider_name="Google",
        provider_type="Google",
        provider_details={
            "authorize_scopes": "email",
            "client_id": "your client_id",
            "client_secret": "your client_secret",
        },
        attribute_mapping={
            "email": "email",
            "username": "sub",
        })
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.cognito.UserPool("example", {autoVerifiedAttributes: ["email"]});
    const exampleProvider = new aws.cognito.IdentityProvider("exampleProvider", {
        userPoolId: example.id,
        providerName: "Google",
        providerType: "Google",
        providerDetails: {
            authorize_scopes: "email",
            client_id: "your client_id",
            client_secret: "your client_secret",
        },
        attributeMapping: {
            email: "email",
            username: "sub",
        },
    });
    
    resources:
      example:
        type: aws:cognito:UserPool
        properties:
          autoVerifiedAttributes:
            - email
      exampleProvider:
        type: aws:cognito:IdentityProvider
        properties:
          userPoolId: ${example.id}
          providerName: Google
          providerType: Google
          providerDetails:
            authorize_scopes: email
            client_id: your client_id
            client_secret: your client_secret
          attributeMapping:
            email: email
            username: sub
    

    Create IdentityProvider Resource

    new IdentityProvider(name: string, args: IdentityProviderArgs, opts?: CustomResourceOptions);
    @overload
    def IdentityProvider(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         attribute_mapping: Optional[Mapping[str, str]] = None,
                         idp_identifiers: Optional[Sequence[str]] = None,
                         provider_details: Optional[Mapping[str, str]] = None,
                         provider_name: Optional[str] = None,
                         provider_type: Optional[str] = None,
                         user_pool_id: Optional[str] = None)
    @overload
    def IdentityProvider(resource_name: str,
                         args: IdentityProviderArgs,
                         opts: Optional[ResourceOptions] = None)
    func NewIdentityProvider(ctx *Context, name string, args IdentityProviderArgs, opts ...ResourceOption) (*IdentityProvider, error)
    public IdentityProvider(string name, IdentityProviderArgs args, CustomResourceOptions? opts = null)
    public IdentityProvider(String name, IdentityProviderArgs args)
    public IdentityProvider(String name, IdentityProviderArgs args, CustomResourceOptions options)
    
    type: aws:cognito:IdentityProvider
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args IdentityProviderArgs
    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 IdentityProviderArgs
    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 IdentityProviderArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IdentityProviderArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IdentityProviderArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    IdentityProvider 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 IdentityProvider resource accepts the following input properties:

    ProviderDetails Dictionary<string, string>

    The map of identity details, such as access token

    ProviderName string

    The provider name

    ProviderType string

    The provider type. See AWS API for valid values

    UserPoolId string

    The user pool id

    AttributeMapping Dictionary<string, string>

    The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation

    IdpIdentifiers List<string>

    The list of identity providers.

    ProviderDetails map[string]string

    The map of identity details, such as access token

    ProviderName string

    The provider name

    ProviderType string

    The provider type. See AWS API for valid values

    UserPoolId string

    The user pool id

    AttributeMapping map[string]string

    The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation

    IdpIdentifiers []string

    The list of identity providers.

    providerDetails Map<String,String>

    The map of identity details, such as access token

    providerName String

    The provider name

    providerType String

    The provider type. See AWS API for valid values

    userPoolId String

    The user pool id

    attributeMapping Map<String,String>

    The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation

    idpIdentifiers List<String>

    The list of identity providers.

    providerDetails {[key: string]: string}

    The map of identity details, such as access token

    providerName string

    The provider name

    providerType string

    The provider type. See AWS API for valid values

    userPoolId string

    The user pool id

    attributeMapping {[key: string]: string}

    The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation

    idpIdentifiers string[]

    The list of identity providers.

    provider_details Mapping[str, str]

    The map of identity details, such as access token

    provider_name str

    The provider name

    provider_type str

    The provider type. See AWS API for valid values

    user_pool_id str

    The user pool id

    attribute_mapping Mapping[str, str]

    The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation

    idp_identifiers Sequence[str]

    The list of identity providers.

    providerDetails Map<String>

    The map of identity details, such as access token

    providerName String

    The provider name

    providerType String

    The provider type. See AWS API for valid values

    userPoolId String

    The user pool id

    attributeMapping Map<String>

    The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation

    idpIdentifiers List<String>

    The list of identity providers.

    Outputs

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

    Id string

    The provider-assigned unique ID for this managed resource.

    Id string

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    id string

    The provider-assigned unique ID for this managed resource.

    id str

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    Look up Existing IdentityProvider Resource

    Get an existing IdentityProvider 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?: IdentityProviderState, opts?: CustomResourceOptions): IdentityProvider
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            attribute_mapping: Optional[Mapping[str, str]] = None,
            idp_identifiers: Optional[Sequence[str]] = None,
            provider_details: Optional[Mapping[str, str]] = None,
            provider_name: Optional[str] = None,
            provider_type: Optional[str] = None,
            user_pool_id: Optional[str] = None) -> IdentityProvider
    func GetIdentityProvider(ctx *Context, name string, id IDInput, state *IdentityProviderState, opts ...ResourceOption) (*IdentityProvider, error)
    public static IdentityProvider Get(string name, Input<string> id, IdentityProviderState? state, CustomResourceOptions? opts = null)
    public static IdentityProvider get(String name, Output<String> id, IdentityProviderState 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:
    AttributeMapping Dictionary<string, string>

    The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation

    IdpIdentifiers List<string>

    The list of identity providers.

    ProviderDetails Dictionary<string, string>

    The map of identity details, such as access token

    ProviderName string

    The provider name

    ProviderType string

    The provider type. See AWS API for valid values

    UserPoolId string

    The user pool id

    AttributeMapping map[string]string

    The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation

    IdpIdentifiers []string

    The list of identity providers.

    ProviderDetails map[string]string

    The map of identity details, such as access token

    ProviderName string

    The provider name

    ProviderType string

    The provider type. See AWS API for valid values

    UserPoolId string

    The user pool id

    attributeMapping Map<String,String>

    The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation

    idpIdentifiers List<String>

    The list of identity providers.

    providerDetails Map<String,String>

    The map of identity details, such as access token

    providerName String

    The provider name

    providerType String

    The provider type. See AWS API for valid values

    userPoolId String

    The user pool id

    attributeMapping {[key: string]: string}

    The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation

    idpIdentifiers string[]

    The list of identity providers.

    providerDetails {[key: string]: string}

    The map of identity details, such as access token

    providerName string

    The provider name

    providerType string

    The provider type. See AWS API for valid values

    userPoolId string

    The user pool id

    attribute_mapping Mapping[str, str]

    The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation

    idp_identifiers Sequence[str]

    The list of identity providers.

    provider_details Mapping[str, str]

    The map of identity details, such as access token

    provider_name str

    The provider name

    provider_type str

    The provider type. See AWS API for valid values

    user_pool_id str

    The user pool id

    attributeMapping Map<String>

    The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation

    idpIdentifiers List<String>

    The list of identity providers.

    providerDetails Map<String>

    The map of identity details, such as access token

    providerName String

    The provider name

    providerType String

    The provider type. See AWS API for valid values

    userPoolId String

    The user pool id

    Import

    Using pulumi import, import aws_cognito_identity_provider resources using their User Pool ID and Provider Name. For example:

     $ pulumi import aws:cognito/identityProvider:IdentityProvider example us-west-2_abc123:CorpAD
    

    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