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

amazon_dns (2) Versions 0.2.3

Manage Amazon Route 53 DNS system

Policyfile
Berkshelf
Knife
cookbook 'amazon_dns', '~> 0.2.3', :supermarket
cookbook 'amazon_dns', '~> 0.2.3'
knife supermarket install amazon_dns
knife supermarket download amazon_dns
README
Dependencies
Changelog
Quality 17%

amazon_dns

Provides a set of LWRPs to manage Amazon Route 53 entries.

This works as a drop-in replacement for the official route53 cookbook, but adds a few features.

Platforms

Tested on Ubuntu 12.04 and Debian 6.0.6.

Requirements

Chef 11

Examples

# Create a zone for example.com
amazon_dns_zone "example.com" do
  aws_access_key_id     "ASDASDASDASD"
  aws_secret_access_key "GSDFGSDFDFGF"
end


# Add subdomain1 to example.com
amazon_dns_record "subdomain1" do
  value "192.168.1.1"
  domain "example.com"
  aws_access_key_id     "ASDASDASDASD"
  aws_secret_access_key "GSDFGSDFDFGF"
end

# Let's add a CNAME record
amazon_dns_record "mail" do
  value "ghs.google.com"
  domain "example.com"
  type "CNAME"
  ttl 86400
  aws_access_key_id     "ASDASDASDASD"
  aws_secret_access_key "GSDFGSDFDFGF"
end

# Create an MX record after specifing credentials via node attribute
node.set[:amazon_dns][:aws_access_key_id] = "ASDASDASDASD"
node.set[:amazon_dns][:aws_secret_access_key] = "GSDFGSDFDFGF"

amazon_dns_record "example.com" do
  domain "example.com"
  type "MX"
  value "1 aspmx.l.google.com"
end

# Instead of replacing the value of a record, we can add to it.
# Here, we create an NS record (if it doesn't exist), or add to the existing value (if it does exist).
amazon_dns_record "nsrecord" do
  domain "example.com"
  addvalue "subdomain1.example.com."
  type "NS"
  aws_access_key_id     "ASDASDASDASD"
  aws_secret_access_key "GSDFGSDFDFGF"
end

# Add another value to our NS record, after this the value will be:
# subdomain1.example.com.
# subdomain2.example.com.
amazon_dns_record "nsrecord" do
  domain "example.com"
  addvalue "subdomain2.example.com."
  type "NS"
  aws_access_key_id     "ASDASDASDASD"
  aws_secret_access_key "GSDFGSDFDFGF"
end

Differences from Route53 cookbook

  • Ability to add zones
  • No need to specify zone_id, amazon_dns will look it up for you
  • Alias record support
  • Ability to add to an existing record without overwriting it (addvalue)

Authorization

You can either set the node attributes node[:amazon_dns][:aws_access_key_id] and node[:amazon_dns][:aws_secret_access_key], or provide the same values with every resource call.
See examples above.

Alias records

Alias records are A or AAAA records that point to S3 Website Endpoints, Elastic Load Balancers or Route 53 record sets in the same zone.
To utilize alias records, set the alias_target attribute of the amazon_dns_record resource to a hash containing the keys :dns_name for the endpoint, and :hosted_zone_id for the hosted zone id.

Recipes

amazon_dns::default

Installs the fog gem, which is needed for the LWRPs.

Attributes

Attribute Description Type Default
aws_access_key_id Access key ID, in case you don't want to specify it every time you call a resource String
aws_secret_access_key Secret access key, in case you don't want to specify it every time you call a resource String

Resources / Providers

amazon_dns_zone

Creates a new Route53 zone.

Attributes

Attribute Description Type Default
name name of the zone / domain String name
comment Optional comment, will show up in the web interface String ""
aws_access_key_id Your AWS access key ID String
aws_secret_access_key Your AWS secret access key String

Actions

Name Description Default
create Create the zone yes

amazon_dns_record

Attributes

Attribute Description Type Default
name Name of the dns entry, can be "subdomain" or "subdomain.example.com" String name
domain Name of the domain to add the entry to (set this or zone_id) String
zone_id Zone_id of the zone to add the entry to (set this or domain) String
value Value for the DNS record. Not needed for alias records String, Array
addvalue Add this to the existing value (or create new with this value). Cannot be used with "value" String, Array
alias_target Targets for alias records. Hash that needs they keys :dns_name and :hosted_zone_id Hash
type DNS record type String A
ttl Time to live Integer, String 3600
weight For weighted record sets Integer, String
aws_access_key_id Your AWS access key ID String
aws_secret_access_key Your AWS secret access key String

Actions

Name Description Default
create_or_update Create or update the record yes

0.2.3 (2015-10-6)

  • "addvalue" feature that allows adding to a records value instead of overwriting it. Thanks @keen99

Collaborator Number Metric
            

0.2.3 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.2.3 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

0.2.3 failed this metric

FC064: Ensure issues_url is set in metadata: amazon_dns/metadata.rb:1
FC065: Ensure source_url is set in metadata: amazon_dns/metadata.rb:1
FC066: Ensure chef_version is set in metadata: amazon_dns/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

0.2.3 passed this metric

Testing File Metric
            

0.2.3 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.2.3 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number