Skip to content

Commit 5e0d189

Browse files
author
amazon-meaisiah
committed
Add new region key to allow deploying to alternate regions explicitly
1 parent ece3c43 commit 5e0d189

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

BUILDING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ This S3 bucket is used to hold all the build artifacts. Unlike everything else h
5757

5858
This is the name of the CloudFormation stack to create and deploy. As a CloudFormation stack name, it must be unique to your account.
5959

60+
### `region: string` (Required)
61+
62+
This is the name of the region to deploy the CloudFormation stack to.
63+
64+
Note: the edge lambda will always be created in us-east-1 regardless of the value of this.
65+
6066
### `siteAssetsBucket: string` (Required)
6167

6268
This S3 bucket holds the site's static assets to serve from the generated CloudFront distribution. As an S3 bucket, the name must be globally unique.

dev-portal/example-deployer.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
'use strict'
1717

1818
module.exports = {
19+
// Optional
20+
// region: 'us-west-1',
21+
1922
// Optional, but recommended if you have multiple active AWS CLI profiles.
2023
// awsSamCliProfile: 'your-profile',
2124

dev-portal/example-dev-deployer.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
const n = 0
1010

1111
module.exports = {
12+
// Optional
13+
// region: 'us-west-1',
14+
1215
buildAssetsBucket: 'YOUR_LAMBDA_ARTIFACTS_BUCKET_NAME',
1316

1417
// All of these are parametric over `n` so that if you need to have multiple stacks deployed

scripts/internal/deploy-template.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = async () => {
1010

1111
const {
1212
stackName,
13+
region,
1314
buildAssetsBucket,
1415
siteAssetsBucket,
1516
apiAssetsBucket,
@@ -36,13 +37,15 @@ module.exports = async () => {
3637

3738
await exec('sam', [
3839
'package',
40+
'--region', region,
3941
'--template-file', samTemplate,
4042
'--output-template-file', packageConfig,
4143
'--s3-bucket', buildAssetsBucket,
4244
...(awsSamCliProfile ? ['--profile', awsSamCliProfile] : [])
4345
])
4446
await exec('sam', [
4547
'deploy',
48+
'--region', region,
4649
'--template-file', packageConfig,
4750
'--stack-name', stackName,
4851
'--capabilities', 'CAPABILITY_NAMED_IAM',

scripts/internal/get-deployer-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ exports.cognitoDomainName = getRequired('cognitoDomainName')
4242
// required (and defaulted) inputs
4343
exports.samTemplate = getOptionalPath('samTemplate', 'cloudformation/template.yaml')
4444
exports.packageConfig = getOptionalPath('packageConfig', 'cloudformation/packaged.yaml')
45+
exports.region = getOptional('region', 'us-east-1')
4546
exports.customersTableName = getOptional('customersTableName')
4647
exports.preLoginAccountsTableName = getOptional('preLoginAccountsTableName')
4748
exports.feedbackTableName = getOptional('feedbackTableName')

0 commit comments

Comments
 (0)