UNPKG

@cloud-copilot/iam-collect

Version:

Collect IAM information from AWS Accounts

131 lines (117 loc) 4.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultConfigFileName = void 0; exports.fullDefaultConfigPath = fullDefaultConfigPath; exports.defaultConfigExists = defaultConfigExists; exports.getDefaultConfig = getDefaultConfig; const fs_1 = require("fs"); const path_1 = require("path"); const packageVersion_js_1 = require("./packageVersion.js"); exports.defaultConfigFileName = 'iam-collect.jsonc'; /** * Get the full path to the config file. * * @returns The full path to the config file. */ function fullDefaultConfigPath() { return (0, path_1.resolve)(process.cwd(), exports.defaultConfigFileName); } /** * * @returns Whether the default config file exists */ function defaultConfigExists() { return (0, fs_1.existsSync)(fullDefaultConfigPath()); } const defaultConfig = ` { // The name of the configuration, used if you need to have multiple configurations. "name": "default config", "iamCollectVersion": "0.0.0", // Default storage is on the file system. "storage": { "type": "file", //If this starts with a '.', it is relative to the config file, otherwise it is an absolute path. "path": "./iam-data" }, /* You can also use S3 storage instead of the default file storage. "storage": { "type": "s3", "bucket": "my-bucket", "prefix": "iam-data/", "region": "us-west-2", "endpoint": "https://s3.us-west-2.amazonaws.com", // Optional endpoint if using a specific VPC endpoint //Optional auth configuration, see https://github.com/cloud-copilot/iam-collect/docs/Storage.md "auth": { // See https://github.com/cloud-copilot/iam-collect/docs/Storage.md } }, */ /* Optionally specify a list of accounts to include. If empty, it will use the current credentials. Can be overridden by the --accounts flag. "accounts": { "included": [ "111111111111", "222222222222" ] }, */ /* Optionally specify separate configurations for accounts: "accountConfigs": { "123456789012": { //Optional auth for the account: "auth": { //The type of authentication to use https://github.com/cloud-copilot/iam-collect/docs/Authentication.md }, "regions": { //Optional regions to include, if empty all regions are included // "included": ["us-east-1", "us-west-1"], //Optional regions to exclude, if empty no regions are excluded. You can use it with included, but that wouldn't make much sense. // "excluded": ["us-west-2"] }, "serviceConfigs" : { "s3": { "endpoint": "https://s3.us-west-2.amazonaws.com", // Optional endpoint if using a specific VPC endpoint "auth": { //Override auth for a specific service } regionConfigs: { "us-west-1": { //Optional configuration for the region endpoint: "https://s3.us-west-1.amazonaws.com", // Optional endpoint if using a specific VPC endpoint } } } } } */ // Optional block, by default all regions returned by ec2:DescribeRegions with 'opt-in-not-required' or 'opted-in' are included // If regions are specified in the CLI, this is ignored // "regions": { //Optional regions to include, if empty all regions are included // "included": ["us-east-1", "us-west-1"], //Optional regions to exclude, if empty no regions are excluded. You can use it with included, but that wouldn't make much sense. // "excluded": ["us-west-2"] // }, // Optional block, by default all supported services are included // If services are specified in the CLI, this is ignored // "services": { //Optional services to include, if empty all supported services are included // "included": ["s3", "ec2"], //Optional services to exclude, if empty no services are excluded. You can use it with included, but that wouldn't make much sense. // "excluded": ["iam"] // }, // Optional block for authentication, see , see https://github.com/cloud-copilot/iam-collect/docs/Authentication.md // "auth": { // //The type of authentication to use before connecting to any individual accounts // } } `; async function getDefaultConfig() { const version = await (0, packageVersion_js_1.iamCollectVersion)(); return defaultConfig.replace('0.0.0', version); } //# sourceMappingURL=defaultConfig.js.map