Skip to main content

Generates an IAM policy for the CloudFormation base describe-type's schema

Project description

cfn-giam

Automatically generate the required IAM policies from your Cloudformation file

Manual procedure

  1. Open AWS Cloudshell or any terminal configured with aws cli.
  2. Install cfn-giam
pip3 install cfngiam
  1. Check the IAM Policy required to execute the cloudformation file or folder
cfn-giam -i $yourcfn -o $exportfolder

Automatical procedure

1. Fork to your Github account from this repository

Fork a repo

2. Create IAM Role and IAM ID Provider for Github Actions

  1. Open Cloudformation on your AWS Account.
  2. Create stack from GithubOIDCRole-ReadOnly.yml.
  3. Make a note the Roke-Arn created from stack and region's name having stack.

3. Register Role-Arn and region name to Github sercrets

  1. View Github Actions page on your repository.
  2. Register following list to Github secrets.
  • NAME: AWS_REGION, VALUE: your region's name having stack
  • NAME: ROLE_ARN, VALUE: your Roke-Arn created from stack

4. Commit and Push your Cloudformation file

  1. Add your Cloudformation file in CFn folder.
  2. Commit and Push your repository.

5. Check artifacts on Github Actions

  1. View Github Actions page on your repository.
  2. Make sure the latest "Check the IAM Policy workflow" is successful.
  3. Open the latest workflow.
  4. Download artifact on the latest workflow.

Others

Github Actions thumbprint

Github Actions thumbprint changes from time to time.
e.g. Changelog
In that case, Update to GithubOIDCRole-ReadOnly.yml after get new thumbprint with GetGithubOIDCThumbprint.sh.

sh GetGithubOIDCThumbprint.sh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfngiam-0.0.3.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

cfngiam-0.0.3-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page