{"id":13505572,"url":"https://github.com/srihariph/cdk-iam-generator","last_synced_at":"2025-03-30T00:31:08.364Z","repository":{"id":36946130,"uuid":"232225003","full_name":"srihariph/cdk-iam-generator","owner":"srihariph","description":"This CDK Construct helps create IAM Managed Policies and IAM Roles using JSON Configuration","archived":false,"fork":false,"pushed_at":"2022-03-26T00:28:50.000Z","size":280,"stargazers_count":18,"open_issues_count":9,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-10T09:16:49.865Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srihariph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-07T02:21:21.000Z","updated_at":"2024-08-13T03:38:15.000Z","dependencies_parsed_at":"2022-08-08T18:30:41.315Z","dependency_job_id":null,"html_url":"https://github.com/srihariph/cdk-iam-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srihariph%2Fcdk-iam-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srihariph%2Fcdk-iam-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srihariph%2Fcdk-iam-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srihariph%2Fcdk-iam-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srihariph","download_url":"https://codeload.github.com/srihariph/cdk-iam-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262490,"owners_count":20749170,"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":[],"created_at":"2024-08-01T00:01:09.957Z","updated_at":"2025-03-30T00:31:03.343Z","avatar_url":"https://github.com/srihariph.png","language":"TypeScript","funding_links":[],"categories":["others","Construct Libraries"],"sub_categories":["Security"],"readme":"# CDK IAM Generator\n\n\n[AWS CDK] construct helps create IAM Managed Policies and IAM Roles using JSON Configuration  \n\nThis package is written in TypeScript and made available via [JSII] to all other supported languages. Package are available on:\n\n- [npm]\n- [PyPI]\n- [nuget]\n\n## Quickstart\n\nInstall or update from npm\n\nTypeScript/Javascript\n\n```console\nnpm i cdk-iam-generator\n\n```\n\nPython\n\n```console\npip install cdk-iamgenerator\n\n```\n\n## Usage\n\n** TypeScript **\n\n```typescript\n    import { IamPolicyGenerator, IamRoleGenerator } from 'cdk-iam-generator';\n\n    new IamPolicyGenerator(this,\"IamPolicyGenerator\",{\n        configPath:\"config/iam_generator_config.json\",\n        policyPath: \"config/policy\"\n    });\n\n    new IamRoleGenerator(this,\"IamRoleGenerator\",{\n        configPath:\"config/iam_generator_config.json\"\n    });\n```\n\n## Prerequsites\n\nExample folder structure for Json Configuration of Roles and Policies: \n\n```\nconfig\n├── policy\n│   ├── CodeCommitArchive.json\n│   └── KMSPolicy.json\n│   └── CreateServiceLinkedRoleECS.json\n│   └── DeployService1.json\n│   └── DeployService2.json\n├── iam_generator_config.json\n\n```\n\nPlace all the Policy Json files inside config/policy in your project root and policy file would look something like this:\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"codecommit:CancelUploadArchive\",\n        \"codecommit:UploadArchive\"\n      ],\n      \"Resource\": \"*\"\n    }\n  ]\n}\n```\n\nConfigure the policies and roles to be created in config/iam_generator_config.json file and would look something like this:\n\n```json\n{\n    \"policies\": [     \n        {\n            \"policy_name\": \"CodeCommitArchive\",\n            \"description\": \"CodeCommitArchive policy\",\n            \"policy_file\": \"CodeCommitArchive.json\"\n        },\n        {\n            \"policy_name\": \"KMSPolicy\",\n            \"description\": \"KMSPolicy policy\",\n            \"policy_file\": \"KMSPolicy.json\"\n        },\n        {\n            \"policy_name\": \"CreateServiceLinkedRoleECS\",\n            \"description\": \"CreateServiceLinkedRoleECS policy\",\n            \"policy_file\": \"CreateServiceLinkedRoleECS.json\"\n        },\n        {\n            \"policy_name\": \"DeployService1\",\n            \"description\": \"DeployService1 policy\",\n            \"policy_file\": \"DeployService1.json\"\n        },\n        {\n            \"policy_name\": \"DeployService2\",\n            \"description\": \"DeployService2 policy\",\n            \"policy_file\": \"DeployService2.json\"\n        }\n    ],\n    \"roles\": [\n        {\n            \"role_name\": \"TestRole1\",\n            \"trust_service_principal\": [\"apigateway.amazonaws.com\",\"lambda.amazonaws.com\"],\n            \"customer_managed_policies\": [\"DeployService1\",\"DeployService2\",\"KMSPolicy\"],\n            \"aws_managed_policies\": [\"service-role/AmazonAPIGatewayPushToCloudWatchLogs\"]\n        },\n        {\n            \"role_name\": \"TestRole2\",\n            \"trust_service_principal\": [\"sns.amazonaws.com\"],\n            \"trust_account_principal\": [\"748669239283\"],\n            \"customer_managed_policies\": [\"CreateServiceLinkedRoleECS\",\"CodeCommitArchive\",\"KMSPolicy\"],\n            \"aws_managed_policies\": [\"service-role/AmazonAPIGatewayPushToCloudWatchLogs\"]\n        },\n        {\n            \"role_name\": \"TestRole3\",\n            \"trust_service_principal\": [\"ec2.amazonaws.com\",\"sns.amazonaws.com\"],\n            \"trust_account_principal\": [\"748669239283\"],\n            \"customer_managed_policies\": [\"DeployService2\",\"CodeCommitArchive\",\"KMSPolicy\"],\n            \"aws_managed_policies\": [\"AWSLambdaFullAccess\"]\n        }\n        \n    ]\n}\n```\n ## License\n\ncdk-iam-generator is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).\n\nSee [LICENSE](./LICENSE) for more information.\n\n[AWS CDK]: https://aws.amazon.com/cdk/\n[JSII]: https://github.com/aws/jsii\n[npm]: https://www.npmjs.com/package/cdk-iam-generator\n[PyPI]: https://pypi.org/project/cdk-iamgenerator/\n[nuget]: https://www.nuget.org/packages/Srihari.IAMGenerator/\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrihariph%2Fcdk-iam-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrihariph%2Fcdk-iam-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrihariph%2Fcdk-iam-generator/lists"}