AWS-Signature-V4

 view release on metacpan or  search on metacpan

script/aws-iam-ra  view on Meta::CPAN

   pod2usage(message => "$0 $VERSION", -verbose => 99, -sections => ' ')
     if $cmdline{version};
   pod2usage(-verbose => 99, -sections => 'USAGE') if $cmdline{usage};
   pod2usage(-verbose => 99, -sections => 'USAGE|EXAMPLES|OPTIONS')
     if $cmdline{help};
   pod2usage(-verbose => 2) if $cmdline{man};

   my %overall = (%default, %environment, %cmdline);
   if (my @missing = grep { ! exists($overall{$_}) } @required) {
      my $list = join ', ', @missing;
      pod2usage(message => "missing: $list", -verbose => 99,
         -sections => ' ');
   }

   return bless {%overall, _args => \@args}, __PACKAGE__;
} ## end sub get_options

__END__

=pod

=encoding utf-8

=head1 NAME

aws-iam-ra - get credentials from AWS IAM Roles Anywhere

=head1 USAGE

   aws-iam-ra [--help] [--man] [--usage] [--version]

   aws-iam-ra --certificate|-c <path>
              [--duration|-d <duration-in-sec>]
              [--full]
              --key|-k <path>
              [--key-type|-K <RSA|ECDSA>]
              --profile-arn|-p <string>
              --region|-R <region-name>
              --role-arn|-r <string>
              --trust-anchor-arn|-t <string>

=head1 EXAMPLES

   aws-iam-ra \
      --certificate /path/to/certificate.pem \
      --key /path/to/key.pem \
      --profile-arn 'arn:aws:rolesanywhere:eu-south-1:1234:profile/12...' \
      --role-arn 'arn:aws:iam::1234:role/test1234...' \
      --trust-anchor 'arn:aws:rolesanywhere:eu-south-1:1234:trust-anc...' \
      --region eu-south-1


=head1 DESCRIPTION

Program to fetch credentials for assuming a specific role using AWS IAM
Roles Anywhere. It's meant as a replacement for C<aws_credential_helper>.

It's basically everything in the example.

You can restrict the duration by providing option C<--duration>, use a value
that is at least 900 or you will get an error.

By default it prints out only the credentials; you can use C<--full> to
print the whole response from AWS.

The key type is assumed to be C<RSA> by default. Set it to C<ECDSA> in case
you are using the other type.

=head1 CONFIGURATION

Most of the command-line parameters can be set using environment variables:

=over

=item *

C<CERT_FILE> corresponds to C<--certificate|-c>

=item *

C<DURATION> corresponds to C<--duration|-d>

=item *

C<KEY_FILE> corresponds to C<--key|-k>

=item *

C<KEY_TYPE> corresponds to C<--key-type|-K>

=item *

C<PROFILE_ARN> corresponds to C<--profile-arn|-p>

=item *

C<REGION> corresponds to C<--region|-R>

=item *

C<ROLE_ARN> corresponds to C<--role-arn|-r>

=item *

C<TRUST_ANCHOR_ARN> corresponds to C<--trust-anchor-arn|-t>

=back

When set, command-line parameters take precedence over environment
variables.

=head1 AUTHOR

Flavio Poletti C<flavio@polettix.it>.

=head1 LICENSE AND COPYRIGHT

Copyright 2026 by Flavio Poletti C<flavio@polettix.it>.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.



( run in 0.677 second using v1.01-cache-2.11-cpan-10df4c37326 )