Skip to content

Instantly share code, notes, and snippets.

@chrisblackwell
Created April 4, 2017 18:33
Show Gist options
  • Save chrisblackwell/fd982462065b0d03ae054ba6500e7ef3 to your computer and use it in GitHub Desktop.
Save chrisblackwell/fd982462065b0d03ae054ba6500e7ef3 to your computer and use it in GitHub Desktop.
Create a Route53 domain entry using the AWS SDK
<?php
$s3 = Route53Client::factory(array(
'credentials' => [
'key' => env('AWS_KEY'),
'secret' => env('AWS_SECRET'),
],
'region' => env('AWS_REGION'),
'version' => 'latest',
));
$hostedZone = $s3->createHostedZone(array(
// Name is required
'Name' => 'domain.tld',
// CallerReference is required
'CallerReference' => 'domain-tld' . time(),
'HostedZoneConfig' => array(
'Comment' => 'Some useful comment',
),
'DelegationSetId' => getenv('ROUTE_53_DELEGATION'),
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment