forked from Interencheres/dynamicroute53
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for Private DNS. Ensuring we only use official Amazon …
…tools. 1) This commit removes quite a lot of code and cleans up a lot. Now we only use official Amazon toolsets, and the code is much cleaner and easier to read. 2) This commit also adds support for private hosted zones - For use in a VPC. When a private DNS is specified, we will create an A record with the instances internal IPV4 address. If it is not specified, we will create a CNAME record with the instances public hostname as before. Squashed commit of the following: commit 805691ec4794bde4fc9524732ca52af50474589c Author: TJ Biddle <[email protected]> Date: Tue Dec 2 13:13:35 2014 -0500 Adding README. commit a6fe8f7a2f4ce33572ecbf232b606e22c5547cca Author: TJ Biddle <[email protected]> Date: Tue Dec 2 12:55:29 2014 -0500 Adding support for private DNS commit 4d78898a6ff1f9cfd67e72c0977314462208dc17 Author: TJ Biddle <[email protected]> Date: Tue Dec 2 11:22:10 2014 -0500 Work in progress.
- Loading branch information
TJ Biddle
committed
Dec 2, 2014
1 parent
8c8495e
commit a67997a
Showing
13 changed files
with
175 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name 'tjbiddle-dynamicroute53' | ||
version '0.0.1' | ||
version '1.0.0' | ||
source 'UNKNOWN' | ||
author 'tjbiddle' | ||
license 'MIT' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
Dynamic Route53 Puppet Module adds the ability for an Amazon EC2 instance to add itself to Route53 DNS when it boots, as well as remove itself when it is shut down. | ||
|
||
It's DNS name is defined by the 'Name' tag set on the instance. | ||
|
||
It has the ability to both work with private DNS as well as public - simply by adjusting the `private_dns` parameter in the class. | ||
|
||
When `private_dns` is specified it will add an A record with it's internal IP as the value, if it is not specified it will default to public DNS and will add it's public hostname as a CNAME record. | ||
|
||
The package installs official Amazon packages only: `cloud-utils` system package provided by Amazon, as well as `awscli` pip Python package also provided by Amazon. | ||
|
||
The script currently does not have any fault tollerance - so ensure all variables are defined properly both in the class as well in Amazon. | ||
|
||
The following IAM policies should be created - we recommend creating a separate user for security reasons: | ||
|
||
Ability to describe tags: | ||
|
||
{ | ||
"Statement": [ | ||
{ | ||
"Sid": "Stmt1358183399710", | ||
"Action": [ | ||
"ec2:DescribeTags" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"*" | ||
] | ||
} | ||
] | ||
} | ||
|
||
Ability to edit your Route53 Hosted Zone | ||
*Be sure to replace YOUR_HOSTED_ZONE_ID_HERE with your Hosted Zone ID* | ||
|
||
{ | ||
"Statement":[ | ||
{ | ||
"Action":[ | ||
"route53:ChangeResourceRecordSets", | ||
"route53:GetHostedZone", | ||
"route53:ListResourceRecordSets" | ||
], | ||
"Effect":"Allow", | ||
"Resource":[ | ||
"arn:aws:route53:::hostedzone/YOUR_HOSTED_ZONE_ID_HERE" | ||
] | ||
}, | ||
{ | ||
"Action":[ | ||
"route53:ListHostedZones" | ||
], | ||
"Effect":"Allow", | ||
"Resource":[ | ||
"*" | ||
] | ||
} | ||
] | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,19 @@ | ||
class dynamicroute53::packages { | ||
|
||
apt::ppa { 'ppa:webupd8team/java': } | ||
|
||
package { 'openjdk-6-jdk': | ||
ensure => purged | ||
} | ||
|
||
package { 'openjdk-6-jre': | ||
ensure => purged | ||
} | ||
package { 'openjdk-7-jdk': | ||
ensure => purged | ||
} | ||
package { 'openjdk-7-jre': | ||
ensure => purged | ||
} | ||
|
||
file { '/var/local/oracle-java7.preseed': | ||
ensure => present, | ||
source => 'puppet:///modules/dynamicroute53/oracle-java7.preseed' | ||
} | ||
|
||
# !!! By installing this package - you agree to Oracle's license. | ||
package { 'oracle-java7-installer': | ||
ensure => installed, | ||
responsefile => '/var/local/oracle-java7.preseed', | ||
require => [ | ||
Apt::Ppa['ppa:webupd8team/java'], | ||
Package['openjdk-6-jdk'], | ||
Package['openjdk-6-jre'], | ||
Package['openjdk-7-jdk'], | ||
Package['openjdk-7-jre'] | ||
] | ||
} | ||
|
||
if ! defined(Package['python-pip']) { | ||
package { 'python-pip': | ||
ensure => installed, | ||
} | ||
} | ||
|
||
package { 'cli53': | ||
ensure => installed, | ||
require => Package['python-pip'], | ||
provider => pip, | ||
package { 'awscli': | ||
ensure => installed, | ||
require => Package['python-pip'], | ||
provider => pip, | ||
} | ||
|
||
if ! defined(Package['unzip']) { | ||
package { 'unzip': | ||
ensure => installed, | ||
} | ||
package { 'cloud-utils': | ||
ensure => installed | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,3 @@ | ||
# Set access and secret key of a user that | ||
#only has access to the following AWS objects/privileges: | ||
#"ec2:DescribeTags" | ||
#"route53:ChangeResourceRecordSets", | ||
#"route53:GetHostedZone", | ||
#"route53:ListResourceRecordSets" | ||
#"route53:ListHostedZones" | ||
|
||
AWS_ACCESS_KEY_ID="<%= scope.lookupvar('dynamicroute53::aws_access_id') %>" | ||
AWS_SECRET_ACCESS_KEY="<%= scope.lookupvar('dynamicroute53::aws_secret_key') %>" | ||
ZONE="<%= scope.lookupvar('dynamicroute53::domain') %>" | ||
TTL="<%= scope.lookupvar('dynamicroute53::ttl') %>" | ||
|
||
[default] | ||
output = text | ||
region = <%= scope.lookupvar('dynamicroute53::region') %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[default] | ||
aws_access_key_id = <%= scope.lookupvar('dynamicroute53::aws_access_id') %> | ||
aws_secret_access_key = <%= scope.lookupvar('dynamicroute53::aws_secret_key') %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.