Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

aws-rds (7) Versions 1.0.1

Provides libraries, resources and providers to configure and manage Amazon Relational Database Service (Amazon RDS) with the EC2 API

Policyfile
Berkshelf
Knife
cookbook 'aws-rds', '= 1.0.1', :supermarket
cookbook 'aws-rds', '= 1.0.1'
knife supermarket install aws-rds
knife supermarket download aws-rds
README
Dependencies
Quality -%

AWS RDS cookbook

This cookbook provides libraries, resources and providers to configure and manage Amazon Relational Database Service (Amazon RDS) with the EC2 API.

Requirements

Requires Chef 0.7.10 or higher for Lightweight Resource and Provider support. Chef 0.8+ is recommended.

An Amazon Web Services account is required. The Access Key and Secret Access Key are used to authenticate with AWS.

Resources/Providers

The aws_rds LWRP manages a RDS instance

Actions

  • :create: creates a new RDS instance

Attribute Parameters

  • allocated_storage: required - (Integer) The amount of storage (in gigabytes) to be initially allocated for the database instance.
  • auto_minor_version_upgrade: (Boolean) Indicates that minor engine upgrades will be applied automatically to the DB Instance during the maintenance window. Default: true
  • availability_zone: (String) The EC2 Availability Zone that the database instance will be created in.
  • backup_retention_period: (Integer) The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.
  • character_set_name: (String) For supported engines, indicates that the DB Instance should be associated with the specified CharacterSet.
  • db_instance_class: required - (String) The compute and memory capacity of the DB Instance.
  • db_name: (String) The name of the database to create when the DB Instance is created. If this parameter is not specified, no database is created in the DB Instance.
  • db_parameter_group_name: (String) The name of the database parameter group to associate with this DB instance. If this argument is omitted, the default DBParameterGroup for the specified engine will be used.
  • db_security_groups: (Array) A list of DB Security Groups to associate with this DB Instance.
  • db_subnet_group_name: (String) A DB Subnet Group to associate with this DB Instance. If there is no DB Subnet Group, then it is a non-VPC DB instance.
  • engine: required - (String) The name of the database engine to be used for this instance.
  • engine_version: (String) The version number of the database engine to use. Example: 5.1.42
  • iops: (Integer) The amount of provisioned input/output operations per second to be initially allocated for the database instance. Constraints: Must be an integer Type: Integer
  • license_model: (String) License model information for this DB Instance. Valid values: license-included | bring-your-own-license | general-public-license
  • master_user_password: required - (String) The password for the master DB Instance user.
  • master_username: required - (String) The name of master user for the client DB Instance.
  • multi_az: (Boolean) Specifies if the DB Instance is a Multi-AZ deployment. You cannot set the AvailabilityZone parameter if the MultiAZ parameter is set to true .
  • option_group_name: (String) Indicates that the DB Instance should be associated with the specified option group.
  • port: (Integer) The port number on which the database accepts connections.
  • preferred_backup_window: (String) The daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod.
  • preferred_maintenance_window: (String) The weekly time range (in UTC) during which system maintenance can occur.
  • publicly_accessible: (Boolean) Specifies the accessibility options for the DB Instance. A value of true specifies an Internet-facing instance with a publicly resolvable DNS name, which resolves to a public IP address. A value of false specifies an internal instance with a DNS name that resolves to a private IP address. Default: The default behavior varies depending on whether a VPC has been requested or not. The following list shows the default behavior in each case.
  • - Default VPC: true
  • - VPC: false If no DB subnet group has been specified as part of the request and the PubliclyAccessible value has not been set, the DB instance will be publicly accessible. If a specific DB subnet group has been specified as part of the request and the PubliclyAccessible value has not been set, the DB instance will be private.
  • vpc_security_group_ids: (Array) A list of Ec2 Vpc Security Groups to associate with this DB Instance. Default: The default Ec2 Vpc Security Group for the DB Subnet group's Vpc.

Usage

In metadata.rb you should declare a dependency on this cookbook. For example:

depends 'aws_rds'

A recipe using this LWRP may look like this:

db_info = {
  name:     'myappdb',
  username: 'test_user',
  password: 'test-password'
}

# Creates an instance with id 'myappdb'

aws_rds db_info[:name] do
  aws_access_key        'YOUR_AWS_ACCESS_KEY'
  aws_secret_access_key 'YOUR_AWS_SECRET'
  engine                'postgres'
  db_instance_class     'db.t1.micro'
  allocated_storage     5
  master_username       db_info[:username]
  master_user_password  db_info[:password]
end

# Instance information will be available in the node object `node[:aws_rds]['myappdb']`
# Since this attribute is set during the `execution` phase of the cookbook,
# you'll need to use Lazy Attribute Evaluation to set the template variable during `execute` phase using `lazy` block

template "/tmp/database.yml" do
  variables lazy {
    {
      host:     node[:aws_rds][db_info[:name]][:endpoint_address],
      adapter:  'postgresql',
      encoding: 'unicode',
      database: db_info[:name],
      username: db_info[:username],
      password: db_info[:password]
    }
  }
end

For a more detailed example. See https://github.com/gosuri/rails-app-cookbook for a complete application using this cookbook

Attributes

  • aws_rds['aws_sdk_version']: aws-sdk RubyGem version. Default 1.11.1

Recipes

default.rb

The default recipe installs the aws-sdk RubyGem, which this cookbook requires in order to work with the EC2 API. Make sure that the aws_rds recipe is in the node or role run_list before any resources from this cookbook are used.

"run_list": [
  "recipe[aws_sdk]"
]

The gem_package is created as a Ruby Object and thus installed during the Compile Phase of the Chef run.

Author

Author:: Greg Osuri (gosuri@gmail.com)

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

No quality metric results found