This command-line program provides an simple easy-to-use interface for generating AWS IAM policies in Terraform HCL format. With the program, you can:
- List all available AWS services
- View the actions available for a specific service
- Generate a Terraform HCL policy file for a specific service with a given list of actions
Generate AWS IAM policies in Terraform HCL format:
- Fast and easy way to create new policies
- Policies are generated with a clear and consistent format
- Policies are easy to read and maintain
- Consistent use of Terraform HCL format across multiple policies
To use the program, follow these steps:
- Clone the project to your local machine
- Install the required dependencies by running
npm install
from the project directory - Open the command line and navigate to the project directory
- Start the program by running the command
node main.js
- Select an option from the menu
- Follow the prompts to input any required information, such as the name of the service and the list of actions
How to use the program to generate a Terraform HCL policy file:
- Open the command line and navigate to the project directory
- Start the program by running the command
node main.js
- Select option 3 from the menu to create an HCL policy file
- When prompted, enter the name of the service for the policy file
- When prompted, enter a comma-separated list of the actions for the policy file
- The program will generate a Terraform HCL policy file with the given service name and actions
$ node main.js
Select an option:
1. List all services
2. View actions for a service
3. Create an HCL policy file
4. Exit
Option: 3
Enter service name: AWS EC2
Enter actions (comma-separated): ec2:DescribeInstances, ec2:StartInstances, ec2:StopInstances
HCL policy file created: policy_AWSEC2_2022-05-09T14-53-01.tf
The program requires the following dependencies:
- Node.js v12 or later
fs
(built-in)readline
(built-in)
This project is licensed under the MIT License. See the LICENSE
file for more information.
- Add Conditions configuration to HCL. Currently generates blank condition.