Skip to content

Commit 8726998

Browse files
committed
CloudFront is global, the region is fixed
1 parent 95067c8 commit 8726998

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

config/cloudfront-url-signer.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717
*/
1818
'key_pair_id' => env('CLOUDFRONT_KEY_PAIR_ID', ''),
1919

20-
/*
21-
* AWS region to connect to.
22-
*/
23-
'region' => env('AWS_DEFAULT_REGION', 'us-west-2'),
24-
2520
/*
2621
* CloudFront API version, by default it uses the latest available.
2722
*/

src/CloudFrontUrlSignerServiceProvider.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,7 @@ class CloudFrontUrlSignerServiceProvider extends ServiceProvider
1313
*/
1414
public function boot()
1515
{
16-
$this->setupConfig($this->app);
17-
}
18-
19-
/**
20-
* Setup the config.
21-
*
22-
* @param \Illuminate\Contracts\Foundation\Application $app
23-
*/
24-
protected function setupConfig(Application $app)
25-
{
26-
$source = realpath(__DIR__ . '/../config/cloudfront-url-signer.php');
27-
$this->publishes([$source => config_path('cloudfront-url-signer.php')], 'config');
28-
$this->mergeConfigFrom($source, 'cloudfront-url-signer');
16+
$this->publishes([__DIR__ . '/../config/cloudfront-url-signer.php' => config_path('cloudfront-url-signer.php')], 'config');
2917
}
3018

3119
/**
@@ -39,7 +27,9 @@ public function register()
3927
$config = config('cloudfront-url-signer');
4028

4129
$cloudFrontClient = new CloudFrontClient([
42-
'region' => $config['region'],
30+
// CloudFront is global, us-east-1 region must be used
31+
// See https://docs.aws.amazon.com/general/latest/gr/rande.html?shortFooter=true#cf_region
32+
'region' => 'us-east-1',
4333
'version' => $config['version']
4434
]);
4535

0 commit comments

Comments
 (0)