Skip to content
v2.278.0

CfnIdentityPoolRoleAttachmentProps ​

Struct External

Properties for defining a CfnIdentityPoolRoleAttachment.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cognito as cognito } from 'aws-cdk-lib';

declare const roles: any;
const cfnIdentityPoolRoleAttachmentProps: cognito.CfnIdentityPoolRoleAttachmentProps = {
  identityPoolId: 'identityPoolId',

  // the properties below are optional
  roleMappings: {
    roleMappingsKey: {
      type: 'type',

      // the properties below are optional
      ambiguousRoleResolution: 'ambiguousRoleResolution',
      identityProvider: 'identityProvider',
      rulesConfiguration: {
        rules: [{
          claim: 'claim',
          matchType: 'matchType',
          roleArn: 'roleArn',
          value: 'value',
        }],
      },
    },
  },
  roles: roles,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cognito as cognito

# roles: Any

cfn_identity_pool_role_attachment_props = cognito.CfnIdentityPoolRoleAttachmentProps(
    identity_pool_id="identityPoolId",

    # the properties below are optional
    role_mappings={
        "role_mappings_key": cognito.CfnIdentityPoolRoleAttachment.RoleMappingProperty(
            type="type",

            # the properties below are optional
            ambiguous_role_resolution="ambiguousRoleResolution",
            identity_provider="identityProvider",
            rules_configuration=cognito.CfnIdentityPoolRoleAttachment.RulesConfigurationTypeProperty(
                rules=[cognito.CfnIdentityPoolRoleAttachment.MappingRuleProperty(
                    claim="claim",
                    match_type="matchType",
                    role_arn="roleArn",
                    value="value"
                )]
            )
        )
    },
    roles=roles
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cognito.*;

Object roles;

CfnIdentityPoolRoleAttachmentProps cfnIdentityPoolRoleAttachmentProps = CfnIdentityPoolRoleAttachmentProps.builder()
        .identityPoolId("identityPoolId")

        // the properties below are optional
        .roleMappings(Map.of(
                "roleMappingsKey", RoleMappingProperty.builder()
                        .type("type")

                        // the properties below are optional
                        .ambiguousRoleResolution("ambiguousRoleResolution")
                        .identityProvider("identityProvider")
                        .rulesConfiguration(RulesConfigurationTypeProperty.builder()
                                .rules(List.of(MappingRuleProperty.builder()
                                        .claim("claim")
                                        .matchType("matchType")
                                        .roleArn("roleArn")
                                        .value("value")
                                        .build()))
                                .build())
                        .build()))
        .roles(roles)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Cognito;

var roles;

var cfnIdentityPoolRoleAttachmentProps = new CfnIdentityPoolRoleAttachmentProps {
    IdentityPoolId = "identityPoolId",

    // the properties below are optional
    RoleMappings = new Dictionary<string, object> {
        { "roleMappingsKey", new RoleMappingProperty {
            Type = "type",

            // the properties below are optional
            AmbiguousRoleResolution = "ambiguousRoleResolution",
            IdentityProvider = "identityProvider",
            RulesConfiguration = new RulesConfigurationTypeProperty {
                Rules = new [] { new MappingRuleProperty {
                    Claim = "claim",
                    MatchType = "matchType",
                    RoleArn = "roleArn",
                    Value = "value"
                } }
            }
        } }
    },
    Roles = roles
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var roles interface{}

cfnIdentityPoolRoleAttachmentProps := &CfnIdentityPoolRoleAttachmentProps{
	IdentityPoolId: jsii.String("identityPoolId"),

	// the properties below are optional
	RoleMappings: map[string]interface{}{
		"roleMappingsKey": &RoleMappingProperty{
			"type": jsii.String("type"),

			// the properties below are optional
			"ambiguousRoleResolution": jsii.String("ambiguousRoleResolution"),
			"identityProvider": jsii.String("identityProvider"),
			"rulesConfiguration": &RulesConfigurationTypeProperty{
				"rules": []interface{}{
					&MappingRuleProperty{
						"claim": jsii.String("claim"),
						"matchType": jsii.String("matchType"),
						"roleArn": jsii.String("roleArn"),
						"value": jsii.String("value"),
					},
				},
			},
		},
	},
	Roles: roles,
}

Properties ​

identityPoolIdstring | IIdentityPoolRefidentity_pool_idtyping.Union[str, IIdentityPoolRef]identityPoolIdStringIdentityPoolIdstringIdentityPoolIdinterface{} required #
An identity pool ID in the format `REGION:GUID` .
roleMappingsoptionalIResolvable | { [key: string]: IResolvable | CfnIdentityPoolRoleAttachment.RoleMappingProperty }role_mappingsoptionaltyping.Union[IResolvable, typing.Mapping[str, typing.Union[IResolvable, RoleMappingProperty]]]roleMappingsoptionalIResolvableRoleMappingsoptionalIResolvableRoleMappingsoptionalinterface{} #
How users for a specific identity provider are mapped to roles.
notes

This is a string to the RoleMapping object map. The string identifies the identity provider. For example: graph.facebook.com or cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id .

If the IdentityProvider field isn't provided in this object, the string is used as the identity provider name.

For more information, see the RoleMapping property .

rolesoptionalanyrolesoptionalAnyrolesoptionalObjectRolesoptionalobjectRolesoptionalinterface{} #
The map of the roles associated with this pool.

For a given role, the key is either "authenticated" or "unauthenticated". The value is the role ARN.