All Projects → youyo → awscredswrap

youyo / awscredswrap

Licence: MIT license
awscredswrap uses temporary credentials for the specified iam role to set a shell environment variable or execute a command.

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to awscredswrap

terraform-aws-iam-assumed-roles
Terraform Module for Assumed Roles on AWS with IAM Groups Requiring MFA
Stars: ✭ 33 (+120%)
Mutual labels:  iam-role, assume-role
nextjs-github-pages
🚀 Deploy a Next.js app to Github Pages via Github Actions.
Stars: ✭ 89 (+493.33%)
Mutual labels:  github-actions
package-version-check-action
GitHub Actions to check package version before publish
Stars: ✭ 30 (+100%)
Mutual labels:  github-actions
github-actions-all-in-one-project
Automatically add an issue or pull request to specific GitHub Project when you create them.
Stars: ✭ 27 (+80%)
Mutual labels:  github-actions
holochrome
Use your IAM role (from instance metadata) to open the AWS console
Stars: ✭ 102 (+580%)
Mutual labels:  iam-role
vidyabhandary
Self updating profile readme for github
Stars: ✭ 36 (+140%)
Mutual labels:  github-actions
Github-Android-Action
Android Github Action that builds Android project, runs unit tests and generates debug APK, builds for Github Actions hackathon
Stars: ✭ 29 (+93.33%)
Mutual labels:  github-actions
cognises-flask
Flask Cognises: AWS Cognito group based authorization with user management
Stars: ✭ 16 (+6.67%)
Mutual labels:  iam-role
github-deploy-actions
This action will auto deploy to target branch when it get triggered
Stars: ✭ 24 (+60%)
Mutual labels:  github-actions
action-ansible-playbook
⚙️ A GitHub Action for running Ansible playbooks
Stars: ✭ 133 (+786.67%)
Mutual labels:  github-actions
translation-action
GitHub action that translates any text to any language supported by chosen provider.
Stars: ✭ 25 (+66.67%)
Mutual labels:  github-actions
deploy-firebase
A GitHub Action to deploy to Firebase Hosting
Stars: ✭ 63 (+320%)
Mutual labels:  github-actions
rspec-github
Formatter for RSpec to show errors in GitHub action annotations
Stars: ✭ 33 (+120%)
Mutual labels:  github-actions
100 Days Of Go
100 days of Go learning
Stars: ✭ 24 (+60%)
Mutual labels:  github-actions
blackcater
Using Node.js to generate my Github profile readme automatically.
Stars: ✭ 84 (+460%)
Mutual labels:  github-actions
actions
GitHub Actions for R-hub
Stars: ✭ 18 (+20%)
Mutual labels:  github-actions
actions
🧰 Collection of github actions for automation
Stars: ✭ 28 (+86.67%)
Mutual labels:  github-actions
django-github-digitalocean
Continuously Deploying Django to DigitalOcean with Docker and GitHub Actions
Stars: ✭ 45 (+200%)
Mutual labels:  github-actions
pin-github-action
Pin your GitHub actions to a specific hash
Stars: ✭ 38 (+153.33%)
Mutual labels:  github-actions
setup-arduino-cli
GitHub Action to setup Arduino CLI
Stars: ✭ 59 (+293.33%)
Mutual labels:  github-actions

awscredswrap

Go Report Card License

AWS assume role credential wrapper.

Description

awscredswrap uses temporary credentials for the specified iam role to set a shell environment variable or execute a command.

Use as CLI

Install

  • Brew
$ brew install youyo/tap/awscredswrap

Other platforms are download from github release page.

Usage

$ awscredswrap --help
awscredswrap uses temporary credentials for the specified iam role to set a shell environment variable or execute a command.

Usage:
  awscredswrap [flags]

Flags:
  -d, --duration-seconds int       The duration, in seconds, of the role session. (default 3600)
  -h, --help                       help for awscredswrap
  -m, --mfa-serial string          The identification number of the MFA device that is associated with the user who is making the AssumeRole call.
  -r, --role-arn string            The arn of the role to assume.
  -n, --role-session-name string   An identifier for the assumed role session.
      --version                    version for awscredswrap

As command wrapper

$ awscredswrap --role-arn arn:aws:iam::00000000:role/foo -- some_command [arg1 arg2...]

As env exporter

When awscredswrap is executed with no arguments, awscredswrap outputs shell script to export AWS credentials environment variables.

$ awscredswrap --role-arn arn:aws:iam::00000000:role/foo
export AWS_ACCESS_KEY_ID='XXXXXXXXXXXXXXXX'
export AWS_SECRET_ACCESS_KEY='zWarBXUtMKJYnC8y4dNAf9e5HQqFTp....'
export AWS_SESSION_TOKEN='Wj3YGuSMwn8aJx4AN6TFsbtB5URKHEpVgdDkPvy7....'
export AWS_DEFAULT_REGION='us-east-1'

You can set the credentials in current shell by eval.

$ eval $(awscredswrap --role-arn arn:aws:iam::00000000:role/foo)

Temporary credentials has expiration time (about 1 hour).

Use as GitHub Actions

DEPRECATED IN FAVOR OF THE OFFICIAL aws-actions/configure-aws-credentials

Inputs

  • role_arn Required The arn of the role to assume.
  • role_session_name An identifier for the assumed role session. (default awscredswrap@GitHubActions)
  • duration_seconds The duration, in seconds, of the role session. (default 3600)

ENV

  • AWS_ACCESS_KEY_ID Required
  • AWS_SECRET_ACCESS_KEY Required
  • AWS_DEFAULT_REGION Required

Recommended to get AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from secrets.

Example usage

on: [push]

jobs:
  assume_role:
    runs-on: ubuntu-latest
    steps:
      - name: Assume Role
        uses: youyo/awscredswrap@v1
        with:
          role_arn: ${{ secrets.ROLE_ARN }}
          duration_seconds: 3600
          role_session_name: 'awscredswrap@GitHubActions'
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_DEFAULT_REGION: 'ap-northeast-1'
      - name: Install aws-cli
        uses: chrislennon/[email protected]
      - name: Identity Check
        run: aws sts get-caller-identity

License

MIT

Author

youyo

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].