IdentityPoolProviderPrincipalTag class

Provides an AWS Cognito Identity Principal Mapping.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as std from "@pulumi/std";

const example = new aws.cognito.UserPool("example", {
    name: "user pool",
    autoVerifiedAttributes: ["email"],
});
const exampleUserPoolClient = new aws.cognito.UserPoolClient("example", {
    name: "client",
    userPoolId: example.id,
    supportedIdentityProviders: std.compact({
        input: ["COGNITO"],
    }).then(invoke => invoke.result),
});
const exampleIdentityPool = new aws.cognito.IdentityPool("example", {
    cognitoIdentityProviders: [{
        clientId: exampleUserPoolClient.id,
        providerName: example.endpoint,
        serverSideTokenCheck: false,
    }],
    identityPoolName: "identity pool",
    allowUnauthenticatedIdentities: false,
});
const exampleIdentityPoolProviderPrincipalTag = new aws.cognito.IdentityPoolProviderPrincipalTag("example", {
    identityPoolId: exampleIdentityPool.id,
    identityProviderName: example.endpoint,
    useDefaults: false,
    principalTags: {
        test: "value",
    },
});
import pulumi
import pulumi_aws as aws
import pulumi_std as std

example = aws.cognito.UserPool("example",
    name="user pool",
    auto_verified_attributes=["email"])
example_user_pool_client = aws.cognito.UserPoolClient("example",
    name="client",
    user_pool_id=example.id,
    supported_identity_providers=std.compact(input=["COGNITO"]).result)
example_identity_pool = aws.cognito.IdentityPool("example",
    cognito_identity_providers=[{
        "client_id": example_user_pool_client.id,
        "provider_name": example.endpoint,
        "server_side_token_check": False,
    }],
    identity_pool_name="identity pool",
    allow_unauthenticated_identities=False)
example_identity_pool_provider_principal_tag = aws.cognito.IdentityPoolProviderPrincipalTag("example",
    identity_pool_id=example_identity_pool.id,
    identity_provider_name=example.endpoint,
    use_defaults=False,
    principal_tags={
        "test": "value",
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using Std = Pulumi.Std;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Cognito.UserPool("example", new()
    {
        Name = "user pool",
        AutoVerifiedAttributes = new[]
        {
            "email",
        },
    });

    var exampleUserPoolClient = new Aws.Cognito.UserPoolClient("example", new()
    {
        Name = "client",
        UserPoolId = example.Id,
        SupportedIdentityProviders = Std.Compact.Invoke(new()
        {
            Input = new[]
            {
                "COGNITO",
            },
        }).Apply(invoke => invoke.Result),
    });

    var exampleIdentityPool = new Aws.Cognito.IdentityPool("example", new()
    {
        CognitoIdentityProviders = new[]
        {
            new Aws.Cognito.Inputs.IdentityPoolCognitoIdentityProviderArgs
            {
                ClientId = exampleUserPoolClient.Id,
                ProviderName = example.Endpoint,
                ServerSideTokenCheck = false,
            },
        },
        IdentityPoolName = "identity pool",
        AllowUnauthenticatedIdentities = false,
    });

    var exampleIdentityPoolProviderPrincipalTag = new Aws.Cognito.IdentityPoolProviderPrincipalTag("example", new()
    {
        IdentityPoolId = exampleIdentityPool.Id,
        IdentityProviderName = example.Endpoint,
        UseDefaults = false,
        PrincipalTags =
        {
            { "test", "value" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cognito"
	"github.com/pulumi/pulumi-std/sdk/go/std"
	"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{
			Name: pulumi.String("user pool"),
			AutoVerifiedAttributes: pulumi.StringArray{
				pulumi.String("email"),
			},
		})
		if err != nil {
			return err
		}
		invokeCompact, err := std.Compact(ctx, &std.CompactArgs{
			Input: []string{
				"COGNITO",
			},
		}, nil)
		if err != nil {
			return err
		}
		exampleUserPoolClient, err := cognito.NewUserPoolClient(ctx, "example", &cognito.UserPoolClientArgs{
			Name:                       pulumi.String("client"),
			UserPoolId:                 example.ID().ToIDOutput().ToStringOutput(),
			SupportedIdentityProviders: pulumi.StringArray(invokeCompact.Result),
		})
		if err != nil {
			return err
		}
		exampleIdentityPool, err := cognito.NewIdentityPool(ctx, "example", &cognito.IdentityPoolArgs{
			CognitoIdentityProviders: cognito.IdentityPoolCognitoIdentityProviderArray{
				&cognito.IdentityPoolCognitoIdentityProviderArgs{
					ClientId:             exampleUserPoolClient.ID().ToIDOutput().ToStringOutput(),
					ProviderName:         example.Endpoint,
					ServerSideTokenCheck: pulumi.Bool(false),
				},
			},
			IdentityPoolName:               pulumi.String("identity pool"),
			AllowUnauthenticatedIdentities: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		_, err = cognito.NewIdentityPoolProviderPrincipalTag(ctx, "example", &cognito.IdentityPoolProviderPrincipalTagArgs{
			IdentityPoolId:       exampleIdentityPool.ID().ToIDOutput().ToStringOutput(),
			IdentityProviderName: example.Endpoint,
			UseDefaults:          pulumi.Bool(false),
			PrincipalTags: pulumi.StringMap{
				"test": pulumi.String("value"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
    std = {
      source = "pulumi/std"
    }
  }
}

resource "aws_cognito_userpool" "example" {
  name                     = "user pool"
  auto_verified_attributes = ["email"]
}
resource "aws_cognito_userpoolclient" "example" {
  name                         = "client"
  user_pool_id                 = aws_cognito_userpool.example.id
  supported_identity_providers = compact(["COGNITO"])
}
resource "aws_cognito_identitypool" "example" {
  cognito_identity_providers {
    client_id               = aws_cognito_userpoolclient.example.id
    provider_name           = aws_cognito_userpool.example.endpoint
    server_side_token_check = false
  }
  identity_pool_name               = "identity pool"
  allow_unauthenticated_identities = false
}
resource "aws_cognito_identitypoolproviderprincipaltag" "example" {
  identity_pool_id       = aws_cognito_identitypool.example.id
  identity_provider_name = aws_cognito_userpool.example.endpoint
  use_defaults           = false
  principal_tags = {
    "test" = "value"
  }
}
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.UserPoolClient;
import com.pulumi.aws.cognito.UserPoolClientArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.CompactArgs;
import com.pulumi.aws.cognito.IdentityPool;
import com.pulumi.aws.cognito.IdentityPoolArgs;
import com.pulumi.aws.cognito.inputs.IdentityPoolCognitoIdentityProviderArgs;
import com.pulumi.aws.cognito.IdentityPoolProviderPrincipalTag;
import com.pulumi.aws.cognito.IdentityPoolProviderPrincipalTagArgs;
import java.util.ArrayList;
import java.util.Arrays;
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()
            .name("user pool")
            .autoVerifiedAttributes("email")
            .build());

        var exampleUserPoolClient = new UserPoolClient("exampleUserPoolClient", UserPoolClientArgs.builder()
            .name("client")
            .userPoolId(example.id())
            .supportedIdentityProviders(StdFunctions.compact(CompactArgs.builder()
                .input("COGNITO")
                .build()).result())
            .build());

        var exampleIdentityPool = new IdentityPool("exampleIdentityPool", IdentityPoolArgs.builder()
            .cognitoIdentityProviders(IdentityPoolCognitoIdentityProviderArgs.builder()
                .clientId(exampleUserPoolClient.id())
                .providerName(example.endpoint())
                .serverSideTokenCheck(false)
                .build())
            .identityPoolName("identity pool")
            .allowUnauthenticatedIdentities(false)
            .build());

        var exampleIdentityPoolProviderPrincipalTag = new IdentityPoolProviderPrincipalTag("exampleIdentityPoolProviderPrincipalTag", IdentityPoolProviderPrincipalTagArgs.builder()
            .identityPoolId(exampleIdentityPool.id())
            .identityProviderName(example.endpoint())
            .useDefaults(false)
            .principalTags(Map.of("test", "value"))
            .build());

    }
}
resources:
  example:
    type: aws:cognito:UserPool
    properties:
      name: user pool
      autoVerifiedAttributes:
        - email
  exampleUserPoolClient:
    type: aws:cognito:UserPoolClient
    name: example
    properties:
      name: client
      userPoolId: ${example.id}
      supportedIdentityProviders:
        fn::invoke:
          function: std:compact
          arguments:
            input:
              - COGNITO
          return: result
  exampleIdentityPool:
    type: aws:cognito:IdentityPool
    name: example
    properties:
      cognitoIdentityProviders:
        - clientId: ${exampleUserPoolClient.id}
          providerName: ${example.endpoint}
          serverSideTokenCheck: false
      identityPoolName: identity pool
      allowUnauthenticatedIdentities: false
  exampleIdentityPoolProviderPrincipalTag:
    type: aws:cognito:IdentityPoolProviderPrincipalTag
    name: example
    properties:
      identityPoolId: ${exampleIdentityPool.id}
      identityProviderName: ${example.endpoint}
      useDefaults: false
      principalTags:
        test: value

Import

Using pulumi import, import Cognito Identity Pool Roles Attachment using the Identity Pool ID and provider name. For example:

$ pulumi import aws:cognito/identityPoolProviderPrincipalTag:IdentityPoolProviderPrincipalTag example us-west-2_abc123:CorpAD

Constructors

IdentityPoolProviderPrincipalTag(String name, {IdentityPoolProviderPrincipalTagArgs? args, CustomResourceOptions? options})
Creates a new IdentityPoolProviderPrincipalTag. name The Pulumi resource name. args Arguments used to configure this IdentityPoolProviderPrincipalTag. The set of arguments for IdentityPoolProviderPrincipalTag. options Resource options controlling this resource's behavior.
IdentityPoolProviderPrincipalTag.reference(String urn)
Creates a typed reference to an existing IdentityPoolProviderPrincipalTag resource.

Properties

childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
identityPoolId ↔ Output<String>
An identity pool ID.
latefinal
identityProviderName ↔ Output<String>
The name of the identity provider.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
principalTags ↔ Output<Map<String, String>?>
String to string map of variables.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
useDefaults ↔ Output<bool?>
use default (username and clientID) attribute mappings.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {IdentityPoolProviderPrincipalTagState? state, CustomResourceOptions? options}) → IdentityPoolProviderPrincipalTag
Gets an existing IdentityPoolProviderPrincipalTag resource's state with the given name and id.