{"id":15286139,"url":"https://gitlab.com/jjatria/Config-AWS","last_synced_at":"2025-10-07T01:30:31.359Z","repository":{"id":56834291,"uuid":"5358457","full_name":"jjatria/Config-AWS","owner":"jjatria","description":"","archived":false,"fork":false,"pushed_at":null,"size":null,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":null,"default_branch":"master","last_synced_at":"2025-01-10T09:04:13.878Z","etag":null,"topics":["aws","perl"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":null,"metadata":{"files":{"readme":"README.md","changelog":"Changes","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":"2018-02-04T00:46:35.838Z","updated_at":"2023-06-03T17:07:50.192Z","dependencies_parsed_at":"2022-09-08T07:50:55.756Z","dependency_job_id":null,"html_url":"https://gitlab.com/jjatria/Config-AWS","commit_stats":null,"previous_names":[],"tags_count":21,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/jjatria%2FConfig-AWS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/jjatria%2FConfig-AWS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/jjatria%2FConfig-AWS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/jjatria%2FConfig-AWS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners/jjatria","download_url":"https://gitlab.com/jjatria/Config-AWS/-/archive/master/Config-AWS-master.zip","host":{"name":"gitlab.com","url":"https://gitlab.com","kind":"gitlab","repositories_count":4516963,"owners_count":6668,"icon_url":"https://github.com/gitlab.png","version":null,"created_at":"2022-05-30T11:31:42.605Z","updated_at":"2024-07-18T11:24:13.055Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners"}},"keywords":["aws","perl"],"created_at":"2024-09-30T15:10:45.740Z","updated_at":"2025-10-07T01:30:30.831Z","avatar_url":null,"language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nConfig::AWS - Parse AWS config files\n\n# SYNOPSIS\n\n    use Config::AWS ':all';\n\n    # Read the data for a specific profile\n    $config = read( $source, $profile );\n\n    # Or read the default profile from the default file\n    $config = read();\n\n    # Which is the same as\n    $config = read(\n        -r credentials_file() ? credentials_file() : config_file(),\n        default_profile()\n    );\n\n    # Read all of the profiles from a file\n    $profiles = read_all( $source );\n\n    # Or if you have cycles to burn\n    $profiles = {\n        map { $_ =\u003e read( $source, $_ ) } list_profiles( $source )\n    };\n\n# DESCRIPTION\n\nConfig::AWS is a small distribution with generic methods to correctly parse\nthe contents of config files for the AWS CLI client as described in\n[the AWS documentation](https://docs.aws.amazon.com/cli/latest/topic/config-vars.html).\n\nAlthough it is common to see these files parsed as standard INI files, this\nis not appropriate since AWS config files have an idiosyncratic format for\nnested values (as shown in the link above).\n\nStandard INI parsers (like [Config::INI](https://metacpan.org/pod/Config%3A%3AINI)) are not made to parse this sort of\nstructure (nor should they). So Config::AWS exists to provide a suitable\nand lightweight ad-hoc parser that can be used in other applications.\n\n# ROUTINES\n\nConfig::AWS does not export anything by default. All the functions\ndescribed in this document can be requested by name at the time of import.\nAlternatively, the `:all` tag can be used to import all of them into your\nnamespace in one go. Other tags are explained in the sections below.\n\n## Parsing routines\n\nThese are the prefered methods for parsing AWS config data. These can be\nimported with the `:read` tag.\n\n- **read**\n- **read\\_all**\n- **list\\_profiles**\n\n        $profiles = read_all();                       # Use defaults\n        $profiles = read_all( $source );              # Specify source\n\n        @profile_names = list_profiles();             # Use default file\n        @profile_names = list_profiles( $source );    # Specify source\n\n        $profile = read();                            # Use defaults\n        $profile = read( $source );                   # Use default profile\n        $profile = read( $source, $profile );         # Specify source and profile\n        $profile = read( undef,   $profile );         # Use default file\n\n    Parse AWS config data. All these functions take the data source to use as\n    their first argument. The source can be any of the following:\n\n    - A **string** with the path to the file\n    - A **Path::Tiny object** for the config file\n    - An **array reference** of lines to parse\n    - A **scalar reference** with the entire slurped contents of the file\n    - An **undefined** value\n\n    If the source is undefined, a default file name will be used. This will be\n    the result of calling **credentials\\_file** (if it is a readable file) or the\n    result of calling **config\\_file** otherwise.\n\n    **read\\_all** will return the results of parsing all of the content in the\n    source, for all profiles that may be defined in it.\n\n    **read** will instead return the data _for a single profile only_. This\n    profile can be specified as the second argument. If no profile is provided,\n    **read** will use the result of calling **default\\_profile** as the default.\n\n    **list\\_profiles** will return only the names of the profiles specified in the\n    config as a list. The order will be the same as that used in the source.\n\n## AWS defaults\n\nThese routines provide information about the default values, as understood\nby the AWS CLI interface. These can be imported with the `:aws` tag.\n\n- **default\\_profile**\n\n    Returns the contents of the `AWS_DEFAULT_PROFILE` environment variable, or\n    `default` if undefined.\n\n- **config\\_file**\n\n    Returns the contents of the `AWS_CONFIG_FILE` environment variable, or\n    `~/.aws/config` if undefined.\n\n- **credentials\\_file**\n\n    Returns the contents of the `AWS_SHARED_CREDENTIALS_FILE` environment\n    variable, or `~/.aws/credentials` if undefined.\n\n## Compatibility with Config::INI\n\nThis module includes routines that allow it to be used as a drop-in\nreplacement of [Config::INI](https://metacpan.org/pod/Config%3A%3AINI). The **read\\_file**, **read\\_string**, and\n**read\\_handle** functions behave like those described in the documentation\nfor that distribution. They can be imported with the `:ini` tag.\n\nUnlike the functions described above, they do not use the default values\nfor AWS config files or profiles, and require the source to be explicitly\nstated.\n\nTo more closely mimic the behaviour of the methods they emulate, they return\nthe entire parsed config data. As a concesion, an optional profile can be\nspecified as a second argument, in which case only the data for that profile\nwill be returned.\n\n# CONTRIBUTIONS AND BUG REPORTS\n\nContributions of any kind are most welcome!\n\nThe main repository for this distribution is on\n[GitLab](https://gitlab.com/jjatria/Config-AWS), which is where patches\nand bug reports are mainly tracked.\n\nBug reports can also be sent through the CPAN RT system, or by mail directly\nto the developers at the address below, although these might not be as\nclosely tracked.\n\n# AUTHOR\n\n- José Joaquín Atria \u003cjjatria@cpan.org\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2018-2021 by José Joaquín Atria.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2Fjjatria%2FConfig-AWS","html_url":"https://awesome.ecosyste.ms/projects/gitlab.com%2Fjjatria%2FConfig-AWS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2Fjjatria%2FConfig-AWS/lists"}