aws.cognito.IdentityPoolRoleAttachment
Explore with Pulumi AI
Provides an AWS Cognito Identity Pool Roles Attachment.
Create IdentityPoolRoleAttachment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IdentityPoolRoleAttachment(name: string, args: IdentityPoolRoleAttachmentArgs, opts?: CustomResourceOptions);
@overload
def IdentityPoolRoleAttachment(resource_name: str,
args: IdentityPoolRoleAttachmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IdentityPoolRoleAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
identity_pool_id: Optional[str] = None,
roles: Optional[Mapping[str, str]] = None,
role_mappings: Optional[Sequence[IdentityPoolRoleAttachmentRoleMappingArgs]] = None)
func NewIdentityPoolRoleAttachment(ctx *Context, name string, args IdentityPoolRoleAttachmentArgs, opts ...ResourceOption) (*IdentityPoolRoleAttachment, error)
public IdentityPoolRoleAttachment(string name, IdentityPoolRoleAttachmentArgs args, CustomResourceOptions? opts = null)
public IdentityPoolRoleAttachment(String name, IdentityPoolRoleAttachmentArgs args)
public IdentityPoolRoleAttachment(String name, IdentityPoolRoleAttachmentArgs args, CustomResourceOptions options)
type: aws:cognito:IdentityPoolRoleAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args IdentityPoolRoleAttachmentArgs
- 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 IdentityPoolRoleAttachmentArgs
- 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 IdentityPoolRoleAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IdentityPoolRoleAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IdentityPoolRoleAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var identityPoolRoleAttachmentResource = new Aws.Cognito.IdentityPoolRoleAttachment("identityPoolRoleAttachmentResource", new()
{
IdentityPoolId = "string",
Roles =
{
{ "string", "string" },
},
RoleMappings = new[]
{
new Aws.Cognito.Inputs.IdentityPoolRoleAttachmentRoleMappingArgs
{
IdentityProvider = "string",
Type = "string",
AmbiguousRoleResolution = "string",
MappingRules = new[]
{
new Aws.Cognito.Inputs.IdentityPoolRoleAttachmentRoleMappingMappingRuleArgs
{
Claim = "string",
MatchType = "string",
RoleArn = "string",
Value = "string",
},
},
},
},
});
example, err := cognito.NewIdentityPoolRoleAttachment(ctx, "identityPoolRoleAttachmentResource", &cognito.IdentityPoolRoleAttachmentArgs{
IdentityPoolId: pulumi.String("string"),
Roles: pulumi.StringMap{
"string": pulumi.String("string"),
},
RoleMappings: cognito.IdentityPoolRoleAttachmentRoleMappingArray{
&cognito.IdentityPoolRoleAttachmentRoleMappingArgs{
IdentityProvider: pulumi.String("string"),
Type: pulumi.String("string"),
AmbiguousRoleResolution: pulumi.String("string"),
MappingRules: cognito.IdentityPoolRoleAttachmentRoleMappingMappingRuleArray{
&cognito.IdentityPoolRoleAttachmentRoleMappingMappingRuleArgs{
Claim: pulumi.String("string"),
MatchType: pulumi.String("string"),
RoleArn: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
},
},
})
var identityPoolRoleAttachmentResource = new IdentityPoolRoleAttachment("identityPoolRoleAttachmentResource", IdentityPoolRoleAttachmentArgs.builder()
.identityPoolId("string")
.roles(Map.of("string", "string"))
.roleMappings(IdentityPoolRoleAttachmentRoleMappingArgs.builder()
.identityProvider("string")
.type("string")
.ambiguousRoleResolution("string")
.mappingRules(IdentityPoolRoleAttachmentRoleMappingMappingRuleArgs.builder()
.claim("string")
.matchType("string")
.roleArn("string")
.value("string")
.build())
.build())
.build());
identity_pool_role_attachment_resource = aws.cognito.IdentityPoolRoleAttachment("identityPoolRoleAttachmentResource",
identity_pool_id="string",
roles={
"string": "string",
},
role_mappings=[{
"identityProvider": "string",
"type": "string",
"ambiguousRoleResolution": "string",
"mappingRules": [{
"claim": "string",
"matchType": "string",
"roleArn": "string",
"value": "string",
}],
}])
const identityPoolRoleAttachmentResource = new aws.cognito.IdentityPoolRoleAttachment("identityPoolRoleAttachmentResource", {
identityPoolId: "string",
roles: {
string: "string",
},
roleMappings: [{
identityProvider: "string",
type: "string",
ambiguousRoleResolution: "string",
mappingRules: [{
claim: "string",
matchType: "string",
roleArn: "string",
value: "string",
}],
}],
});
type: aws:cognito:IdentityPoolRoleAttachment
properties:
identityPoolId: string
roleMappings:
- ambiguousRoleResolution: string
identityProvider: string
mappingRules:
- claim: string
matchType: string
roleArn: string
value: string
type: string
roles:
string: string
IdentityPoolRoleAttachment 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 IdentityPoolRoleAttachment resource accepts the following input properties:
- Identity
Pool stringId - An identity pool ID in the format
REGION_GUID
. - Roles Dictionary<string, string>
- The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
- Role
Mappings List<IdentityPool Role Attachment Role Mapping> - A List of Role Mapping.
- Identity
Pool stringId - An identity pool ID in the format
REGION_GUID
. - Roles map[string]string
- The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
- Role
Mappings []IdentityPool Role Attachment Role Mapping Args - A List of Role Mapping.
- identity
Pool StringId - An identity pool ID in the format
REGION_GUID
. - roles Map<String,String>
- The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
- role
Mappings List<IdentityPool Role Attachment Role Mapping> - A List of Role Mapping.
- identity
Pool stringId - An identity pool ID in the format
REGION_GUID
. - roles {[key: string]: string}
- The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
- role
Mappings IdentityPool Role Attachment Role Mapping[] - A List of Role Mapping.
- identity_
pool_ strid - An identity pool ID in the format
REGION_GUID
. - roles Mapping[str, str]
- The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
- role_
mappings Sequence[IdentityPool Role Attachment Role Mapping Args] - A List of Role Mapping.
- identity
Pool StringId - An identity pool ID in the format
REGION_GUID
. - roles Map<String>
- The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
- role
Mappings List<Property Map> - A List of Role Mapping.
Outputs
All input properties are implicitly available as output properties. Additionally, the IdentityPoolRoleAttachment 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 IdentityPoolRoleAttachment Resource
Get an existing IdentityPoolRoleAttachment 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?: IdentityPoolRoleAttachmentState, opts?: CustomResourceOptions): IdentityPoolRoleAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
identity_pool_id: Optional[str] = None,
role_mappings: Optional[Sequence[IdentityPoolRoleAttachmentRoleMappingArgs]] = None,
roles: Optional[Mapping[str, str]] = None) -> IdentityPoolRoleAttachment
func GetIdentityPoolRoleAttachment(ctx *Context, name string, id IDInput, state *IdentityPoolRoleAttachmentState, opts ...ResourceOption) (*IdentityPoolRoleAttachment, error)
public static IdentityPoolRoleAttachment Get(string name, Input<string> id, IdentityPoolRoleAttachmentState? state, CustomResourceOptions? opts = null)
public static IdentityPoolRoleAttachment get(String name, Output<String> id, IdentityPoolRoleAttachmentState 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.
- Identity
Pool stringId - An identity pool ID in the format
REGION_GUID
. - Role
Mappings List<IdentityPool Role Attachment Role Mapping> - A List of Role Mapping.
- Roles Dictionary<string, string>
- The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
- Identity
Pool stringId - An identity pool ID in the format
REGION_GUID
. - Role
Mappings []IdentityPool Role Attachment Role Mapping Args - A List of Role Mapping.
- Roles map[string]string
- The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
- identity
Pool StringId - An identity pool ID in the format
REGION_GUID
. - role
Mappings List<IdentityPool Role Attachment Role Mapping> - A List of Role Mapping.
- roles Map<String,String>
- The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
- identity
Pool stringId - An identity pool ID in the format
REGION_GUID
. - role
Mappings IdentityPool Role Attachment Role Mapping[] - A List of Role Mapping.
- roles {[key: string]: string}
- The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
- identity_
pool_ strid - An identity pool ID in the format
REGION_GUID
. - role_
mappings Sequence[IdentityPool Role Attachment Role Mapping Args] - A List of Role Mapping.
- roles Mapping[str, str]
- The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
- identity
Pool StringId - An identity pool ID in the format
REGION_GUID
. - role
Mappings List<Property Map> - A List of Role Mapping.
- roles Map<String>
- The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
Supporting Types
IdentityPoolRoleAttachmentRoleMapping, IdentityPoolRoleAttachmentRoleMappingArgs
- Identity
Provider string - A string identifying the identity provider, for example, "graph.facebook.com" or "cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id". Depends on
cognito_identity_providers
set onaws.cognito.IdentityPool
resource or aaws.cognito.IdentityProvider
resource. - Type string
- The role mapping type.
- Ambiguous
Role stringResolution - Specifies the action to be taken if either no rules match the claim value for the Rules type, or there is no cognito:preferred_role claim and there are multiple cognito:roles matches for the Token type.
Required
if you specify Token or Rules as the Type. - Mapping
Rules List<IdentityPool Role Attachment Role Mapping Mapping Rule> - The Rules Configuration to be used for mapping users to roles. You can specify up to 25 rules per identity provider. Rules are evaluated in order. The first one to match specifies the role.
- Identity
Provider string - A string identifying the identity provider, for example, "graph.facebook.com" or "cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id". Depends on
cognito_identity_providers
set onaws.cognito.IdentityPool
resource or aaws.cognito.IdentityProvider
resource. - Type string
- The role mapping type.
- Ambiguous
Role stringResolution - Specifies the action to be taken if either no rules match the claim value for the Rules type, or there is no cognito:preferred_role claim and there are multiple cognito:roles matches for the Token type.
Required
if you specify Token or Rules as the Type. - Mapping
Rules []IdentityPool Role Attachment Role Mapping Mapping Rule - The Rules Configuration to be used for mapping users to roles. You can specify up to 25 rules per identity provider. Rules are evaluated in order. The first one to match specifies the role.
- identity
Provider String - A string identifying the identity provider, for example, "graph.facebook.com" or "cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id". Depends on
cognito_identity_providers
set onaws.cognito.IdentityPool
resource or aaws.cognito.IdentityProvider
resource. - type String
- The role mapping type.
- ambiguous
Role StringResolution - Specifies the action to be taken if either no rules match the claim value for the Rules type, or there is no cognito:preferred_role claim and there are multiple cognito:roles matches for the Token type.
Required
if you specify Token or Rules as the Type. - mapping
Rules List<IdentityPool Role Attachment Role Mapping Mapping Rule> - The Rules Configuration to be used for mapping users to roles. You can specify up to 25 rules per identity provider. Rules are evaluated in order. The first one to match specifies the role.
- identity
Provider string - A string identifying the identity provider, for example, "graph.facebook.com" or "cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id". Depends on
cognito_identity_providers
set onaws.cognito.IdentityPool
resource or aaws.cognito.IdentityProvider
resource. - type string
- The role mapping type.
- ambiguous
Role stringResolution - Specifies the action to be taken if either no rules match the claim value for the Rules type, or there is no cognito:preferred_role claim and there are multiple cognito:roles matches for the Token type.
Required
if you specify Token or Rules as the Type. - mapping
Rules IdentityPool Role Attachment Role Mapping Mapping Rule[] - The Rules Configuration to be used for mapping users to roles. You can specify up to 25 rules per identity provider. Rules are evaluated in order. The first one to match specifies the role.
- identity_
provider str - A string identifying the identity provider, for example, "graph.facebook.com" or "cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id". Depends on
cognito_identity_providers
set onaws.cognito.IdentityPool
resource or aaws.cognito.IdentityProvider
resource. - type str
- The role mapping type.
- ambiguous_
role_ strresolution - Specifies the action to be taken if either no rules match the claim value for the Rules type, or there is no cognito:preferred_role claim and there are multiple cognito:roles matches for the Token type.
Required
if you specify Token or Rules as the Type. - mapping_
rules Sequence[IdentityPool Role Attachment Role Mapping Mapping Rule] - The Rules Configuration to be used for mapping users to roles. You can specify up to 25 rules per identity provider. Rules are evaluated in order. The first one to match specifies the role.
- identity
Provider String - A string identifying the identity provider, for example, "graph.facebook.com" or "cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id". Depends on
cognito_identity_providers
set onaws.cognito.IdentityPool
resource or aaws.cognito.IdentityProvider
resource. - type String
- The role mapping type.
- ambiguous
Role StringResolution - Specifies the action to be taken if either no rules match the claim value for the Rules type, or there is no cognito:preferred_role claim and there are multiple cognito:roles matches for the Token type.
Required
if you specify Token or Rules as the Type. - mapping
Rules List<Property Map> - The Rules Configuration to be used for mapping users to roles. You can specify up to 25 rules per identity provider. Rules are evaluated in order. The first one to match specifies the role.
IdentityPoolRoleAttachmentRoleMappingMappingRule, IdentityPoolRoleAttachmentRoleMappingMappingRuleArgs
- Claim string
- The claim name that must be present in the token, for example, "isAdmin" or "paid".
- Match
Type string - The match condition that specifies how closely the claim value in the IdP token must match Value.
- Role
Arn string - The role ARN.
- Value string
- A brief string that the claim must match, for example, "paid" or "yes".
- Claim string
- The claim name that must be present in the token, for example, "isAdmin" or "paid".
- Match
Type string - The match condition that specifies how closely the claim value in the IdP token must match Value.
- Role
Arn string - The role ARN.
- Value string
- A brief string that the claim must match, for example, "paid" or "yes".
- claim String
- The claim name that must be present in the token, for example, "isAdmin" or "paid".
- match
Type String - The match condition that specifies how closely the claim value in the IdP token must match Value.
- role
Arn String - The role ARN.
- value String
- A brief string that the claim must match, for example, "paid" or "yes".
- claim string
- The claim name that must be present in the token, for example, "isAdmin" or "paid".
- match
Type string - The match condition that specifies how closely the claim value in the IdP token must match Value.
- role
Arn string - The role ARN.
- value string
- A brief string that the claim must match, for example, "paid" or "yes".
- claim str
- The claim name that must be present in the token, for example, "isAdmin" or "paid".
- match_
type str - The match condition that specifies how closely the claim value in the IdP token must match Value.
- role_
arn str - The role ARN.
- value str
- A brief string that the claim must match, for example, "paid" or "yes".
- claim String
- The claim name that must be present in the token, for example, "isAdmin" or "paid".
- match
Type String - The match condition that specifies how closely the claim value in the IdP token must match Value.
- role
Arn String - The role ARN.
- value String
- A brief string that the claim must match, for example, "paid" or "yes".
Import
Using pulumi import
, import Cognito Identity Pool Roles Attachment using the Identity Pool ID. For example:
$ pulumi import aws:cognito/identityPoolRoleAttachment:IdentityPoolRoleAttachment example us-west-2:b64805ad-cb56-40ba-9ffc-f5d8207e6d42
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.