Module: AwsAssumeRole::Types

Included in:
Cli::Actions::AbstractAction
Defined in:
lib/aws_assume_role/types.rb

Constant Summary collapse

Dry =
Dry::Types.module
Credentials =
::Dry::Types["aws.credentials"]
ACCESS_KEY_REGEX =
/[\w]+/
ACCESS_KEY_VALIDATOR =
proc { filled? & str? & format?(ACCESS_KEY_REGEX) & min_size?(16) & max_size?(32) }
ARN_REGEX =
%r{arn:[\w+=\/,[email protected]]+:[\w+=\/,[email protected]]+:[\w+=\/,[email protected]]*:[0-9]+:[\w+=,[email protected]]+(\/[\w+=\/,[email protected]]+)*}
EXTERNAL_ID_REGEX =
%r{[\w+=,[email protected]:\/-]*}
MFA_REGEX =
%r{arn:aws:iam::[0-9]+:mfa\/([\w+=,[email protected]]+)*|automatic}
REGION_REGEX =
/^(us|eu|ap|sa|ca)\-\w+\-\d+$|^cn\-\w+\-\d+$|^us\-gov\-\w+\-\d+$/
REGION_VALIDATOR =
proc { filled? & str? & format?(REGION_REGEX) }
ROLE_REGEX =
%r{arn:aws:iam::[0-9]+:role\/([\w+=,[email protected]]+)*}
ROLE_SESSION_NAME_REGEX =
/[\w+=,[email protected]]*/
SECRET_ACCESS_KEY_REGEX =
//
SECRET_ACCESS_KEY_VALIDATOR =
proc { filled? & str? & format?(SECRET_ACCESS_KEY_REGEX) }
Region =
Dry::Strict::String.constrained(
    format: REGION_REGEX,
)
MfaSerial =
Dry::Strict::String.constrained(
    format: MFA_REGEX,
)