{"id":17540697,"url":"https://github.com/cmlicata/cloudcli-cookbook","last_synced_at":"2025-04-23T23:05:26.845Z","repository":{"id":77075283,"uuid":"52506442","full_name":"cmlicata/cloudcli-cookbook","owner":"cmlicata","description":"Cookbook which installs and configures cloud cli tools","archived":false,"fork":false,"pushed_at":"2019-06-14T17:01:37.000Z","size":75,"stargazers_count":19,"open_issues_count":7,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T23:05:11.497Z","etag":null,"topics":["aws-cli","chef-cookbook","cloud","docker","kitchen-ec2"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/cmlicata.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-25T07:44:37.000Z","updated_at":"2023-03-31T15:22:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"980faf24-efbe-4836-b278-402cf4c2d35d","html_url":"https://github.com/cmlicata/cloudcli-cookbook","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmlicata%2Fcloudcli-cookbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmlicata%2Fcloudcli-cookbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmlicata%2Fcloudcli-cookbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmlicata%2Fcloudcli-cookbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmlicata","download_url":"https://codeload.github.com/cmlicata/cloudcli-cookbook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528732,"owners_count":21445516,"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":["aws-cli","chef-cookbook","cloud","docker","kitchen-ec2"],"created_at":"2024-10-20T22:24:49.624Z","updated_at":"2025-04-23T23:05:26.835Z","avatar_url":"https://github.com/cmlicata.png","language":"Ruby","readme":"cloudcli Cookbook\n=============\nInstalls cloud provider CLI tools and provide custom resources which expose the cloud tools to cookbooks.\n\nCLI Tools Supported\n-------------------\n* aws-cli\n\nRequirements\n------------\n\n* Chef 12.5 or higher\n\nTested Platforms\n----------------\n* Ubuntu 14.04\n* CentOS 6.5\n* Amazon 2015.09.2\n\nAttributes\n----------\nAll attributes are located under `node['cloudcli']`\n\n| Attribute  | Description                                             | Example            | Default     |\n|------------|---------------------------------------------------------|--------------------|-------------|\n| version    | The version of awscli to install                        | 1.4.0              | nil (latest)|\n| virtualenv | Python virtualenv you would like to install awscli into | /home/ubuntu/my_ve | nil         |\n\nRecipes\n-------\n\n### default\nInstalls the awscli tools.\n\nResources/Providers\n-------------------\n\n### cloudcli_aws_s3_file\n#### Actions\n\n| Action | Description                       |\n|--------|-----------------------------------|\n| :get   | Download a file from an s3 bucket |\n\n#### Attribute Parameters\n\n| Parameter             | Description                                                                               | Default        |\n|-----------------------|-------------------------------------------------------------------------------------------|----------------|\n| aws_access_key_id     | AWS API Access Key ID                                                                     | nil            |\n| aws_secret_access_key | AWS API Secret Access Key                                                                 | nil            |\n| path                  | Location to store downloaded file                                                         | name attribute |\n| bucket                | S3 bucket name                                                                            |                |\n| key                   | S3 Key name to download                                                                   |                |\n| checksum              | Sha256 checksum to validate download                                                      | nil            |\n| region                | AWS endpoint region                                                                       | us-east-1      |\n| profile               | The AWS profile to use if multiple configurations are defined                             | nil            |\n| timeout               | Number of seconds to wait for download to complete                                        | 900            |\n| owner                 | The owner of the downloaded file                                                          | root           |\n| group                 | The group name the file should be grouped into                                            | root           |\n| mode                  | The mode to set on the file. Setting to nil, leaves this to the operating system defaults | nil            |\n\n#### Usage Examples\n```ruby\n# Provide all credential information to download file and store it to /tmp/testfile\ncloudcli_aws_s3_file '/tmp/testfile' do\n  aws_access_key_id 'YOUR_ACCESS_KEY_ID'\n  aws_secret_access_key 'YOUR_SECRET_ACCESS_KEY'\n  region 'us-west-2'\n  bucket 'my-test-bucket'\n  key 'my_large_file.gz'\n  checksum '37f9405a23d1e53082dbe9ea0ef19ec8791c778a6ecd0b02a6c1af2cf9bd4847'\n  timeout 1200\n  owner 'testuser'\n  group 'testgroup'\n  mode '0644'\nend\n```\n\n```ruby\n# Do not pass any credentials to provider because our instance is on EC2 and uses an IAM Profile\ncloudcli_aws_s3_file '/tmp/testfile' do\n  bucket 'my-test-bucket'\n  key 'my_large_file.gz'\nend\n```\n\n### cloudcli_aws_credentials\nThis resource allows you to setup credential files for aws-cli. The resource is designed to only\nwrite out the credentials file once. Because of this, you can write multiple profiles for the same\ncredentials file with multiple calls to this resource. Take a look at the examples section for\nan example of this behavior.\n\n#### Actions\n| Action  | Description                    |\n|---------|--------------------------------|\n| :create | Create an AWS credentials file |\n| :delete | Remove the credentials file    |\n\n#### Attribute Parameters\n| Parameter           | Description                                                                     | Default        |\n|---------------------|---------------------------------------------------------------------------------|----------------|\n| path                | Location to write the credentials file                                          | name attribute |\n| profile             | The name of the profile for this set of credentials                             | `default`      |\n| credential_params   | Hash of additional configuration key=value pairs to set in the credentials file | {}             |\n| owner               | Credentials file owner                                                          | `root`         |\n| group               | Credentials file group                                                          | `root`         |\n| mode                | Credentials file mode                                                           | 0600           |\n\n#### Usage Examples\n```ruby\n# Standard configuration setting access key, secret key and region\ncloudcli_aws_credentials '/etc/aws/credentials' do\n  owner 'testuser'\n  group 'testuser'\n  mode 0600\n  credential_params(\n    aws_access_key_id: 'ASDASDASKD123',\n    aws_secret_access_key: 'TESTPASS12345',\n    region: 'us-west-2'\n  )\nend\n\n```\n\n```ruby\ncloudcli_aws_credentials '/etc/aws/credentials' do\n  owner 'testuser'\n  group 'testuser'\n  profile 'primary'\n  mode 0600\n  credential_params(\n    aws_access_key_id: 'ASDASDASKD123',\n    aws_secret_access_key: 'TESTPASS12345',\n    region: 'us-west-2'\n  )\nend\n\n# Creating a cross-account role profile named secondary in the same credentials file\n# as the `primary` profile defined above.\ncloudcli_aws_credentials '/etc/aws/credentials' do\n  owner 'root'\n  group 'root'\n  mode 0660\n  profile 'secondary'\n  credential_params(\n    region: 'eu-west-2',\n    role_arn: 'arn:aws:iam::123456789012:role/testingchef'\n  )\nend\n\n```\n\n```ruby\n# Configuring S3 threading parameters\ns3_config = \u003c\u003cEOF\n\n  max_concurrent_requests=20\n  max_queue_size=10000\n  multipart_threshold=64MB\n  multipart_chunksize=16MB\nEOF\n\ncloudcli_aws_credentials '/home/testuser/.aws/credentials' do\n  owner 'testuser'\n  group 'testuser'\n  mode 0600\n  credential_params(\n    aws_access_key_id: 'TEST123',\n    aws_secret_access_key: 'SECRETKEY!',\n    s3: s3_config\n  )\nend\n\n```\n\nTesting\n-------\nIn order to run the integration tests for this cookbook, you must have a valid AWS account and go through a few setup steps.\n__*Please note, you may incur AWS fees when executing the kitchen integration tests.*__\n\n### Local Configuration\nThe testing suites are setup to use environment variables to pass in end user specific information.\n\n#### Variables used by .kitchen.yml\nThese variables are used to setup the `test_get` and `profile_test_get` (kitchen-ec2 only) suites. Kitchen will setup proper\nnode attributes based on these variables. See the .kitchen.yml file for information on which variables are set.\n\n```bash\nexport TEST_AWS_ACCESS_KEY_ID=\nexport TEST_AWS_SECRET_ACCESS_KEY=\nexport TEST_AWS_REGION=\nexport TEST_BUCKET=\nexport TEST_KEY=\nexport TEST_CHECKSUM=\n```\n\n#### Variables used by .kitchen.ec2.yml\nThe .kitchen.ec2.yml file is used to test within EC2. In order to use it, you must configure proper AWS security credentials\nas well as a few other settings. Take a look at .kitchen.ec2.yml to see which specific kitchen-ec2 variables are set from\nthese environment variables.\n\n```bash\nexport AWS_ACCESS_KEY_ID=\nexport AWS_SECRET_ACCESS_KEY=\nexport AWS_KEYPAIR_NAME=\nexport AWS_REGION=\nexport AWS_SUBNET_ID=\nexport AWS_AVAILABILITY_ZONE=\nexport EC2_SSH_KEY_PATH=\nexport AWS_IAM_PROFILE=\nexport AWS_UBUNTU_1404_AMI=\nexport AWS_AMAZON_AMI=\n```\n\n### AWS Configuration\n\n#### `test_get` suite dependencies\nThe following items need to be setup properly in order to use the `test_get` suite.\n\n* AWS S3 Bucket containing a test file\n* AWS IAM Account with at least GetObject access to the bucket setup in the previous step\n* AWS IAM Account API keys for the account setup in the previous step\n\n#### `profile_test_get` suite dependencies\nThe following items need to be setup properly in order to use the `profile_test_get` suite.\n\n* AWS S3 Bucket containing a test file\n* AWS IAM Role/Profile with at least GetObject access to the bucket setup in the previous step\n* AWS IAM Account API Keys for an account with enough access to run an EC2 instance\n\n### Executing the integration tests\nThe `test_get` suite will download the file by\nproviding the credentials configured via the environment. Those files\nwill then be verified against the checksum you set via\n`TEST_CHECKSUM`.  If the checksum does not match the downloaded file,\nthe tests will fail.\n\n__Note: kitchen-ec2 profile support is waiting for a release. If you would like to test with\nIAM profiles, you will need to build the kitchen-ec2 gem from source.__\n\nThe `profile_test_get` suite is only available when using the\nkitchen-ec2 driver. The .kitchen.cloud.yml file is configured to use\nthe kitchen-ec2 driver. To enable this file, set the\n`KITCHEN_LOCAL_YAML` environment variable to the path for the\n.kitchen.cloud.yml file.\n\n* IAM Role Documentation: http://docs.aws.amazon.com/IAM/latest/UserGuide/role-usecase-ec2app.html\n* kitchen-ec2 plugin repository: https://github.com/test-kitchen/kitchen-ec2\n\nContributing\n------------\n\n1. Fork the repository on Github: \u003chttps://help.github.com/articles/fork-a-repo\u003e\n2. Clone the repository locally:\n\n    ```bash\n    $ git clone http://github.com/nickryand/cloudcli-cookbook\n    ```\n\n3. Create a named feature branch:\n\n    ```bash\n    $ cd cloudcli-cookbook\n    $ git checkout -b [new feature branch]\n    ```\n\n4. Add your change(s)\n5. Write tests for your change(s):\n6. Install the gem dependencies:\n\n    ```bash\n    $ bundle install\n    ```\n7. Run the integration and spec tests to ensure they all pass:\n\n    ```bash\n    bundle exec rake integration\n    ```\n8. Run the style tests to ensure they all pass:\n\n    ```bash\n    bundle exec rake style\n    ```\n9. Update the README.md with new information if applicable.\n10. Commit and push your changes up to your feature branch\n11. Submit a Pull Request\n\nLicense and Authors\n-------------------\n- Author:: Christopher Licata (\u003ccmlpolyglotdev@gmail.com\u003e)\n- Author:: Nick Downs (\u003cnickryand@gmail.com\u003e)\n\n```\nCopyright 2017 Christopher Licata\nCopyright 2016 Nick Downs\nCopyright 2014 Amazon Web Services\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmlicata%2Fcloudcli-cookbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmlicata%2Fcloudcli-cookbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmlicata%2Fcloudcli-cookbook/lists"}