{"id":18566558,"url":"https://github.com/youyo/awscredswrap","last_synced_at":"2025-04-10T05:32:18.340Z","repository":{"id":57657358,"uuid":"220166919","full_name":"youyo/awscredswrap","owner":"youyo","description":"awscredswrap uses temporary credentials for the specified iam role to set a shell environment variable or execute a command.","archived":false,"fork":false,"pushed_at":"2022-05-27T05:28:19.000Z","size":54,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T16:46:16.465Z","etag":null,"topics":["assume-role","aws","github-actions","iam-role","temporary-credentials"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/youyo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-07T06:27:53.000Z","updated_at":"2024-11-06T19:16:20.000Z","dependencies_parsed_at":"2023-01-04T12:30:59.747Z","dependency_job_id":null,"html_url":"https://github.com/youyo/awscredswrap","commit_stats":{"total_commits":27,"total_committers":2,"mean_commits":13.5,"dds":"0.11111111111111116","last_synced_commit":"5292ccfc912c1a5df3de081389b0026ade464ae8"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyo%2Fawscredswrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyo%2Fawscredswrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyo%2Fawscredswrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyo%2Fawscredswrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youyo","download_url":"https://codeload.github.com/youyo/awscredswrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248163207,"owners_count":21057889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assume-role","aws","github-actions","iam-role","temporary-credentials"],"created_at":"2024-11-06T22:23:32.669Z","updated_at":"2025-04-10T05:32:18.017Z","avatar_url":"https://github.com/youyo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# awscredswrap\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/youyo/awscredswrap)](https://goreportcard.com/report/github.com/youyo/awscredswrap)\n[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](./LICENSE)\n\nAWS assume role credential wrapper.\n\n## Description\n\nawscredswrap uses temporary credentials for the specified iam role to set a shell environment variable or execute a command.\n\n## Use as CLI\n\n### Install\n\n- Brew\n\n```\n$ brew install youyo/tap/awscredswrap\n```\n\nOther platforms are download from [github release page](https://github.com/youyo/awscredswrap/releases).\n\n### Usage\n\n```bash\n$ awscredswrap --help\nawscredswrap uses temporary credentials for the specified iam role to set a shell environment variable or execute a command.\n\nUsage:\n  awscredswrap [flags]\n\nFlags:\n  -d, --duration-seconds int       The duration, in seconds, of the role session. (default 3600)\n  -h, --help                       help for awscredswrap\n  -m, --mfa-serial string          The identification number of the MFA device that is associated with the user who is making the AssumeRole call.\n  -r, --role-arn string            The arn of the role to assume.\n  -n, --role-session-name string   An identifier for the assumed role session.\n      --version                    version for awscredswrap\n```\n\n#### As command wrapper\n\n```console\n$ awscredswrap --role-arn arn:aws:iam::00000000:role/foo -- some_command [arg1 arg2...]\n```\n\n#### As env exporter\n\nWhen awscredswrap is executed with no arguments, awscredswrap outputs shell script to export AWS credentials environment variables.\n\n```console\n$ awscredswrap --role-arn arn:aws:iam::00000000:role/foo\nexport AWS_ACCESS_KEY_ID='XXXXXXXXXXXXXXXX'\nexport AWS_SECRET_ACCESS_KEY='zWarBXUtMKJYnC8y4dNAf9e5HQqFTp....'\nexport AWS_SESSION_TOKEN='Wj3YGuSMwn8aJx4AN6TFsbtB5URKHEpVgdDkPvy7....'\nexport AWS_DEFAULT_REGION='us-east-1'\n```\n\nYou can set the credentials in current shell by `eval`.\n\n```console\n$ eval $(awscredswrap --role-arn arn:aws:iam::00000000:role/foo)\n```\n\nTemporary credentials has expiration time (about 1 hour).\n\n## Use as GitHub Actions\n\nDEPRECATED IN FAVOR OF THE OFFICIAL [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials)\n\n### Inputs\n\n-  `role_arn` **Required** The arn of the role to assume.\n-  `role_session_name` An identifier for the assumed role session. (default awscredswrap@GitHubActions)\n-  `duration_seconds` The duration, in seconds, of the role session. (default 3600)\n\n### ENV\n\n- `AWS_ACCESS_KEY_ID` **Required**\n- `AWS_SECRET_ACCESS_KEY` **Required**\n- `AWS_DEFAULT_REGION` **Required**\n\nRecommended to get `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` from secrets.\n\n### Example usage\n\n```yaml\non: [push]\n\njobs:\n  assume_role:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Assume Role\n        uses: youyo/awscredswrap@v1\n        with:\n          role_arn: ${{ secrets.ROLE_ARN }}\n          duration_seconds: 3600\n          role_session_name: 'awscredswrap@GitHubActions'\n        env:\n          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          AWS_DEFAULT_REGION: 'ap-northeast-1'\n      - name: Install aws-cli\n        uses: chrislennon/action-aws-cli@v1.1\n      - name: Identity Check\n        run: aws sts get-caller-identity\n```\n\n## License\n\n[MIT](LICENSE)\n\n## Author\n\n[youyo](https://github.com/youyo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouyo%2Fawscredswrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyouyo%2Fawscredswrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouyo%2Fawscredswrap/lists"}