Class: AWSCDK::Cognito::CfnIdentityPoolRoleAttachment::MappingRuleProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cognito/cfn_identity_pool_role_attachment.rb

Overview

Defines how to map a claim to a role ARN.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(claim:, match_type:, role_arn:, value:) ⇒ MappingRuleProperty

Returns a new instance of MappingRuleProperty.

Parameters:

  • claim (String)

    The claim name that must be present in the token.

  • match_type (String)

    The match condition that specifies how closely the claim value in the IdP token must match Value .

  • role_arn (String)

    The Amazon Resource Name (ARN) of the role.

  • value (String)

    A brief string that the claim must match.



529
530
531
532
533
534
535
536
537
538
# File 'cognito/cfn_identity_pool_role_attachment.rb', line 529

def initialize(claim:, match_type:, role_arn:, value:)
  @claim = claim
  Jsii::Type.check_type(@claim, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "claim")
  @match_type = match_type
  Jsii::Type.check_type(@match_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "matchType")
  @role_arn = role_arn
  Jsii::Type.check_type(@role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "roleArn")
  @value = value
  Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value")
end

Instance Attribute Details

#claimString (readonly)

The claim name that must be present in the token.

For example: "isAdmin" or "paid".



546
547
548
# File 'cognito/cfn_identity_pool_role_attachment.rb', line 546

def claim
  @claim
end

#match_typeString (readonly)

The match condition that specifies how closely the claim value in the IdP token must match Value .

Valid values are: Equals , Contains , StartsWith , and NotEqual .



553
554
555
# File 'cognito/cfn_identity_pool_role_attachment.rb', line 553

def match_type
  @match_type
end

#role_arnString (readonly)

The Amazon Resource Name (ARN) of the role.



558
559
560
# File 'cognito/cfn_identity_pool_role_attachment.rb', line 558

def role_arn
  @role_arn
end

#valueString (readonly)

A brief string that the claim must match.

For example, "paid" or "yes".



565
566
567
# File 'cognito/cfn_identity_pool_role_attachment.rb', line 565

def value
  @value
end

Class Method Details

.jsii_propertiesObject



567
568
569
570
571
572
573
574
# File 'cognito/cfn_identity_pool_role_attachment.rb', line 567

def self.jsii_properties
  {
    :claim => "claim",
    :match_type => "matchType",
    :role_arn => "roleArn",
    :value => "value",
  }
end

Instance Method Details

#to_jsiiObject



576
577
578
579
580
581
582
583
584
585
# File 'cognito/cfn_identity_pool_role_attachment.rb', line 576

def to_jsii
  result = {}
  result.merge!({
    "claim" => @claim,
    "matchType" => @match_type,
    "roleArn" => @role_arn,
    "value" => @value,
  })
  result.compact
end