30 lines
11 KiB
JSON
30 lines
11 KiB
JSON
{
|
|
"name": "aws",
|
|
"description": "LWRPs for managing AWS resources",
|
|
"long_description": "Description\n===========\n\nThis cookbook provides libraries, resources and providers to configure and manage Amazon Web Services components and offerings with the EC2 API. Currently supported resources:\n\n* EBS Volumes (`ebs_volume`)\n* EBS Raid (`ebs_raid`)\n* Elastic IPs (`elastic_ip`)\n* Elastic Load Balancer (`elastic_lb`)\n* AWS Resource Tags (`resource_tag`)\n\nRequirements\n============\n\nRequires Chef 0.7.10 or higher for Lightweight Resource and Provider support. Chef 0.8+ is recommended. While this cookbook can be used in `chef-solo` mode, to gain the most flexibility, we recommend using `chef-client` with a Chef Server.\n\nAn Amazon Web Services account is required. The Access Key and Secret Access Key are used to authenticate with EC2.\n\nAWS Credentials\n===============\n\nIn order to manage AWS components, authentication credentials need to be available to the node. There are a number of ways to handle this, such as node attributes or roles. We recommend storing these in a databag (Chef 0.8+), and loading them in the recipe where the resources are needed.\n\nDataBag recommendation:\n\n % knife data bag show aws main\n {\n \"id\": \"main\",\n \"aws_access_key_id\": \"YOUR_ACCESS_KEY\",\n \"aws_secret_access_key\": \"YOUR_SECRET_ACCESS_KEY\"\n }\n\nThis can be loaded in a recipe with:\n\n aws = data_bag_item(\"aws\", \"main\")\n\nAnd to access the values:\n\n aws['aws_access_key_id']\n aws['aws_secret_access_key']\n\nWe'll look at specific usage below.\n\nRecipes\n=======\n\ndefault.rb\n----------\n\nThe default recipe installs the `right_aws` RubyGem, which this cookbook requires in order to work with the EC2 API. Make sure that the aws recipe is in the node or role `run_list` before any resources from this cookbook are used.\n\n \"run_list\": [\n \"recipe[aws]\"\n ]\n\nThe `gem_package` is created as a Ruby Object and thus installed during the Compile Phase of the Chef run.\n\nLibraries\n=========\n\nThe cookbook has a library module, `Opscode::AWS::Ec2`, which can be included where necessary:\n\n include Opscode::Aws::Ec2\n\nThis is needed in any providers in the cookbook. Along with some helper methods used in the providers, it sets up a class variable, `ec2` that is used along with the access and secret access keys\n\nResources and Providers\n=======================\n\nThis cookbook provides two resources and corresponding providers.\n\n`ebs_volume.rb`\n-------------\n\nManage Elastic Block Store (EBS) volumes with this resource.\n\nActions:\n\n* `create` - create a new volume.\n* `attach` - attach the specified volume.\n* `detach` - detach the specified volume.\n* `snapshot` - create a snapshot of the volume.\n* `prune` - prune snapshots.\n\nAttribute Parameters:\n\n* `aws_secret_access_key`, `aws_access_key` - passed to `Opscode::AWS:Ec2` to authenticate, required.\n* `size` - size of the volume in gigabytes.\n* `snapshot_id` - snapshot to build EBS volume from.\n* most_recent_snapshot - use the most recent snapshot when creating a volume from an existing volume (defaults to false)\n* `availability_zone` - EC2 region, and is normally automatically detected.\n* `device` - local block device to attach the volume to, e.g. `/dev/sdi` but no default value, required.\n* `volume_id` - specify an ID to attach, cannot be used with action `:create` because AWS assigns new volume IDs\n* `timeout` - connection timeout for EC2 API.\n* `snapshots_to_keep` - used with action `:prune` for number of snapshots to maintain.\n* `description` - used to set the description of an EBS snapshot\n* `volume_type` - standard or iops\n* `piops` - number of Provisioned IOPS to provision, must be > 100\n\n`ebs_raid.rb`\n-------------\n\nManage Elastic Block Store (EBS) raid devices with this resource.\n\nAttribute Parameters: \n\n* `mount_point` - where to mount the RAID volume\n* `disk_count` - number of EBS volumes to raid\n* `disk_size` - size of EBS volumes to raid\n* `level` - RAID level (default 10)\n* `filesystem` - filesystem to format raid array (default ext4)\n* `snapshots` - array of EBS snapshots to restore. Snapshots must be taken using an ec2 consistent snapshot tool, and tagged with a number that indicates how many devices are in the array being backed up (e.g. \"Logs Backup [0-4]\" for a four-volume raid array snapshot)\n* `disk_type` - standard or iops\n* `disk_piops` - number of Provisioned IOPS to provision per disk, must be > 100\n\n`elastic_ip.rb`\n-------------\n\nActions:\n\n* `associate` - associate the IP.\n* `disassociate` - disassociate the IP.\n\nAttribute Parameters:\n\n* `aws_secret_access_key`, `aws_access_key` - passed to `Opscode::AWS:Ec2` to authenticate, required.\n* `ip` - the IP address.\n* `timeout` - connection timeout for EC2 API.\n\n`elastic_lb.rb`\n-------------\n\nActions:\n\n* `register` - Add this instance to the LB\n* `deregister` - Remove this instance from the LB\n\nAttribute Parameters:\n\n* `aws_secret_access_key`, `aws_access_key` - passed to `Opscode::AWS:Ec2` to authenticate, required.\n* `name` - the name of the LB, required.\n\n`resource_tag.rb`\n------------------\n\nActions:\n\n* `add` - Add tags to a resource.\n* `update` - Add or modify existing tags on a resource -- this is the default action.\n* `remove` - Remove tags from a resource, but only if the specified values match the existing ones.\n* `force_remove` - Remove tags from a resource, regardless of their values.\n\nAttribute Parameters\n\n* `aws_secret_access_key`, `aws_access_key` - passed to `Opscode::AWS:Ec2` to authenticate, required.\n* `tags` - a hash of key value pairs to be used as resource tags, (e.g. `{ \"Name\" => \"foo\", \"Environment\" => node.chef_environment }`,) required.\n* `resource_id` - resources whose tags will be modified. The value may be a single ID as a string or multiple IDs in an array. If no `resource_id` is specified the name attribute will be used.\n\nUsage\n=====\n\nThe following examples assume that the recommended data bag item has been created and that the following has been included at the top of the recipe where they are used.\n\n include_recipe \"aws\"\n aws = data_bag_item(\"aws\", \"main\")\n\naws_ebs_volume\n--------------\n\nThe resource only handles manipulating the EBS volume, additional resources need to be created in the recipe to manage the attached volume as a filesystem or logical volume.\n\n aws_ebs_volume \"db_ebs_volume\" do\n aws_access_key aws['aws_access_key_id']\n aws_secret_access_key aws['aws_secret_access_key']\n size 50\n device \"/dev/sdi\"\n action [ :create, :attach ]\n end\n\nThis will create a 50G volume, attach it to the instance as `/dev/sdi`.\n\n aws_ebs_volume \"db_ebs_volume_from_snapshot\" do\n aws_access_key aws['aws_access_key_id']\n aws_secret_access_key aws['aws_secret_access_key']\n size 50\n device \"/dev/sdi\"\n snapshot_id \"snap-ABCDEFGH\"\n action [ :create, :attach ]\n end\n\nThis will create a new 50G volume from the snapshot ID provided and attach it as `/dev/sdi`.\n\naws_elastic_ip\n--------------\n\nThe `elastic_ip` resource provider does not support allocating new IPs. This must be done before running a recipe that uses the resource. After allocating a new Elastic IP, we recommend storing it in a databag and loading the item in the recipe.\n\nDatabag structure:\n\n % knife data bag show aws eip_load_balancer_production\n {\n \"id\": \"eip_load_balancer_production\",\n \"public_ip\": \"YOUR_ALLOCATED_IP\"\n }\n\nThen to set up the Elastic IP on a system:\n\n ip_info = data_bag_item(\"aws\", \"eip_load_balancer_production\")\n\n aws_elastic_ip \"eip_load_balancer_production\" do\n aws_access_key aws['aws_access_key_id']\n aws_secret_access_key aws['aws_secret_access_key']\n ip ip_info['public_ip']\n action :associate\n end\n\nThis will use the loaded `aws` and `ip_info` databags to pass the required values into the resource to configure. Note that when associating an Elastic IP to an instance, connectivity to the instance will be lost because the public IP address is changed. You will need to reconnect to the instance with the new IP.\n\nYou can also store this in a role as an attribute or assign to the node directly, if preferred.\n\naws_elastic_lb\n---------\n\n`elastic_lb` opererates similar to `elastic_ip'. Make sure that you've created the ELB and enabled your instances' availability zones prior to using this provider.\n\nFor example, to register the node in the 'QA' ELB:\n aws_elastic_lb \"elb_qa\" do\n aws_access_key aws['aws_access_key_id']\n aws_secret_access_key aws['aws_secret_access_key']\n name \"QA\"\n action :register\n end\n\naws_resource_tag\n----------------\n\n`resource_tag` can be used to manipulate the tags assigned to one or more AWS resources, i.e. ec2 instances, ebs volumes or ebs volume snapshots.\n\nAssigining tags to a node to reflect it's role and environment:\n\n aws_resource_tag node['ec2']['instance_id'] do\n aws_access_key aws['aws_access_key_id']\n aws_secret_access_key aws['aws_secret_access_key']\n tags({\"Name\" => \"www.example.com app server\",\n \"Environment\" => node.chef_environment})\n action :update\n end\n\nAssigning a set of tags to multiple resources, e.g. ebs volumes in a disk set:\n\n aws_resource_tag 'my awesome raid set' do\n aws_access_key aws['aws_access_key_id']\n aws_secret_access_key aws['aws_secret_access_key']\n resource_id [ \"vol-d0518cb2\", \"vol-fad31a9a\", \"vol-fb106a9f\", \"vol-74ed3b14\" ]\n tags({\"Name\" => \"My awesome RAID disk set\",\n \"Environment\" => node.chef_environment})\n end\n\n\nLicense and Author\n==================\n\n* Author:: Chris Walters (<cw@opscode.com>)\n* Author:: AJ Christensen (<aj@opscode.com>)\n* Author:: Justin Huff (<jjhuff@mspin.net>)\n\nCopyright 2009-2010, Opscode, Inc.\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",
|
|
"maintainer": "Opscode, Inc.",
|
|
"maintainer_email": "cookbooks@opscode.com",
|
|
"license": "Apache 2.0",
|
|
"platforms": {
|
|
},
|
|
"dependencies": {
|
|
},
|
|
"recommendations": {
|
|
},
|
|
"suggestions": {
|
|
},
|
|
"conflicting": {
|
|
},
|
|
"providing": {
|
|
},
|
|
"replacing": {
|
|
},
|
|
"attributes": {
|
|
},
|
|
"groupings": {
|
|
},
|
|
"recipes": {
|
|
"aws": "Installs the right_aws gem during compile time"
|
|
},
|
|
"version": "0.101.0"
|
|
} |