Skip to content

Commit

Permalink
feat: support five new regions in CLI (aws-amplify#8094)
Browse files Browse the repository at this point in the history
* feat: support five new regions in CLI

This commit updates the CLI to support five new regions:

- us-west-1
- eu-west-3
- eu-north-1
- me-south-1
- sa-east-1
  • Loading branch information
cjihrig authored and marcvberg committed Oct 13, 2021
1 parent 4386f53 commit 15deba8
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 3 deletions.
5 changes: 5 additions & 0 deletions packages/amplify-e2e-core/src/configure/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,21 @@ const defaultSettings = {
export const amplifyRegions = [
'us-east-1',
'us-east-2',
'us-west-1',
'us-west-2',
'eu-north-1',
'eu-west-1',
'eu-west-2',
'eu-west-3',
'eu-central-1',
'ap-northeast-1',
'ap-northeast-2',
'ap-southeast-1',
'ap-southeast-2',
'ap-south-1',
'ca-central-1',
'me-south-1',
'sa-east-1',
];

const configurationOptions = ['Project information', 'AWS Profile setting', 'Advanced: Container-based deployments'];
Expand Down
2 changes: 2 additions & 0 deletions packages/amplify-e2e-core/src/utils/pinpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ const serviceRegionMap = {
'ap-southeast-2': 'us-west-2',
'ap-northeast-1': 'us-west-2',
'eu-central-1': 'eu-central-1',
'eu-north-1': 'eu-central-1',
'eu-west-1': 'eu-west-1',
'eu-west-2': 'eu-west-1',
'eu-west-3': 'eu-west-1',
'me-south-1': 'ap-south-1',
};

export async function pinpointAppExist(pinpointProjectId: string): Promise<boolean> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export function setMappings(scope: Construct): CfnMapping {
'us-gov-east-1': {
layerRegion: 'arn:aws-us-gov:lambda:us-gov-east-1:138526772879:layer:AWSLambda-Python-AWS-SDK:1',
},
'me-south-1': {
layerRegion: 'arn:aws:lambda:me-south-1:507411403535:layer:AWSLambda-Python-AWS-SDK:1',
},
},
});
}
Original file line number Diff line number Diff line change
@@ -1,106 +1,141 @@
const Translate = {
'us-east-1': 'us-east-1',
'us-east-2': 'us-east-1',
'us-west-1': 'us-west-1',
'us-west-2': 'us-west-2',
'ca-central-1': 'ca-central-1',
'eu-west-1': 'eu-west-1',
'eu-west-2': 'eu-west-1',
'eu-west-3': 'eu-west-3',
'eu-central-1': 'eu-central-1',
'eu-north-1': 'eu-north-1',
'ap-northeast-1': 'ap-northeast-1',
'ap-northeast-2': 'ap-northeast-2',
'ap-southeast-1': 'ap-southeast-1',
'ap-southeast-2': 'ap-southeast-1',
'ap-south-1': 'ap-south-1',
'me-south-1': 'ap-south-1',
'sa-east-1': 'us-east-1',
};

const Polly = {
'us-east-1': 'us-east-1',
'us-east-2': 'us-east-2',
'us-west-1': 'us-west-1',
'us-west-2': 'us-west-2',
'ca-central-1': 'ca-central-1',
'eu-west-1': 'eu-west-1',
'eu-west-2': 'eu-west-2',
'eu-west-3': 'eu-west-3',
'eu-central-1': 'eu-central-1',
'eu-north-1': 'eu-north-1',
'ap-northeast-1': 'ap-northeast-1',
'ap-northeast-2': 'ap-northeast-2',
'ap-southeast-1': 'ap-southeast-1',
'ap-southeast-2': 'ap-southeast-2',
'ap-south-1': 'ap-south-1',
'me-south-1': 'me-south-1',
'sa-east-1': 'sa-east-1',
};

const Transcribe = {
'us-east-1': 'us-east-1',
'us-east-2': 'us-east-2',
'us-west-1': 'us-west-1',
'us-west-2': 'us-west-2',
'ca-central-1': 'ca-central-1',
'eu-west-1': 'eu-west-1',
'eu-west-2': 'eu-west-2',
'eu-west-3': 'eu-west-3',
'eu-central-1': 'eu-central-1',
'eu-north-1': 'eu-central-1',
'ap-northeast-1': 'ap-northeast-2',
'ap-northeast-2': 'ap-northeast-2',
'ap-southeast-1': 'ap-southeast-1',
'ap-southeast-2': 'ap-southeast-2',
'ap-south-1': 'ap-south-1',
'me-south-1': 'me-south-1',
'sa-east-1': 'sa-east-1',
};

const Rekognition = {
'us-east-1': 'us-east-1',
'us-east-2': 'us-east-2',
'us-west-1': 'us-west-1',
'us-west-2': 'us-west-2',
'ca-central-1': 'us-east-1',
'eu-west-1': 'eu-west-1',
'eu-west-2': 'eu-west-2',
'eu-west-3': 'eu-west-1',
'eu-central-1': 'eu-central-1',
'eu-north-1': 'eu-central-1',
'ap-northeast-1': 'ap-northeast-1',
'ap-northeast-2': 'ap-northeast-2',
'ap-southeast-1': 'ap-southeast-1',
'ap-southeast-2': 'ap-southeast-2',
'ap-south-1': 'ap-south-1',
'me-south-1': 'ap-south-1',
'sa-east-1': 'us-east-1',
};

const RekognitionAndTextract = {
'us-east-1': 'us-east-1',
'us-east-2': 'us-east-2',
'us-west-1': 'us-west-1',
'us-west-2': 'us-west-2',
'ca-central-1': 'us-east-1',
'eu-west-1': 'eu-west-1',
'eu-west-2': 'us-east-1',
'eu-west-3': 'eu-west-1',
'eu-central-1': 'us-east-1',
'eu-north-1': 'eu-central-1',
'ap-northeast-1': 'us-east-1',
'ap-northeast-2': 'us-east-1',
'ap-southeast-1': 'us-east-1',
'ap-southeast-2': 'us-east-1',
'ap-south-1': 'us-east-1',
'me-south-1': 'ap-south-1',
'sa-east-1': 'us-east-1',
};

const Comprehend = {
'us-east-1': 'us-east-1',
'us-east-2': 'us-east-2',
'us-west-1': 'us-west-2',
'us-west-2': 'us-west-2',
'ca-central-1': 'ca-central-1',
'eu-west-1': 'eu-west-1',
'eu-west-2': 'eu-west-2',
'eu-west-3': 'eu-west-1',
'eu-central-1': 'eu-central-1',
'eu-north-1': 'eu-central-1',
'ap-northeast-1': 'us-east-1',
'ap-northeast-2': 'us-east-1',
'ap-southeast-1': 'ap-southeast-1',
'ap-southeast-2': 'ap-southeast-2',
'ap-south-1': 'us-east-1',
'me-south-1': 'ap-south-1',
'sa-east-1': 'us-east-1',
};

const SageMaker = {
'us-east-1': 'us-east-1',
'us-east-2': 'us-east-2',
'us-west-1': 'us-west-1',
'us-west-2': 'us-west-2',
'ca-central-1': 'ca-central-1',
'eu-west-1': 'eu-west-1',
'eu-west-2': 'eu-west-2',
'eu-west-3': 'eu-west-3',
'eu-central-1': 'eu-central-1',
'eu-north-1': 'eu-north-1',
'ap-northeast-1': 'ap-northeast-1',
'ap-northeast-2': 'ap-northeast-2',
'ap-southeast-1': 'ap-southeast-1',
'ap-southeast-2': 'ap-southeast-2',
'ap-south-1': 'ap-south-1',
'me-south-1': 'me-south-1',
'sa-east-1': 'sa-east-1',
};

module.exports = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@
const regionMappings = {
'us-east-1': 'US East (N. Virginia)',
'us-east-2': 'US East (Ohio)',
'us-west-1': 'US West (N. California)',
'us-west-2': 'US West (Oregon)',
'eu-north-1': 'EU (Stockholm)',
'eu-west-1': 'EU (Ireland)',
'eu-west-2': 'EU (London)',
'eu-west-3': 'EU (Paris)',
'eu-central-1': 'EU (Frankfurt)',
'ap-northeast-1': 'Asia Pacific (Tokyo)',
'ap-northeast-2': 'Asia Pacific (Seoul)',
'ap-southeast-1': 'Asia Pacific (Singapore)',
'ap-southeast-2': 'Asia Pacific (Sydney)',
'ap-south-1': 'Asia Pacific (Mumbai)',
'ca-central-1': 'Canada (Central)',
'me-south-1': 'Middle East (Bahrain)',
'sa-east-1': 'South America (São Paulo)',
};

module.exports = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ const serviceRegionMap = {
'ap-southeast-2': 'ap-southeast-2',
'ap-northeast-1': 'ap-northeast-1',
'eu-central-1': 'eu-central-1',
'eu-north-1': 'eu-central-1',
'eu-west-1': 'eu-west-1',
'eu-west-2': 'eu-west-2',
'eu-west-3': 'eu-west-1',
'me-south-1': 'ap-south-1',
};

class Lex {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ const serviceRegionMap = {
'ap-southeast-2': 'us-west-2',
'ap-northeast-1': 'us-west-2',
'eu-central-1': 'eu-central-1',
'eu-north-1': 'eu-central-1',
'eu-west-1': 'eu-west-1',
'eu-west-2': 'eu-west-1',
'eu-west-3': 'eu-west-1',
'me-south-1': 'ap-south-1',
};

async function getConfiguredPinpointClient(context, category, action, envName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ export const adminBackendMap: {
amplifyAdminUrl: 'https://eu-central-1.admin.amplifyapp.com',
appStateUrl: 'https://atz311uyx5.execute-api.eu-central-1.amazonaws.com/wave4Prod',
},
'eu-north-1': {
amplifyAdminUrl: 'https://eu-north-1.admin.amplifyapp.com',
appStateUrl: 'https://vzj0xabgsa.execute-api.eu-north-1.amazonaws.com/wave5Prod',
},
'eu-west-1': {
amplifyAdminUrl: 'https://eu-west-1.admin.amplifyapp.com',
appStateUrl: 'https://8dbn4hxfme.execute-api.eu-west-1.amazonaws.com/wave3Prod',
Expand All @@ -169,6 +173,18 @@ export const adminBackendMap: {
amplifyAdminUrl: 'https://eu-west-2.admin.amplifyapp.com',
appStateUrl: 'https://apafhnmqme.execute-api.eu-west-2.amazonaws.com/wave1Prod',
},
'eu-west-3': {
amplifyAdminUrl: 'https://eu-west-3.admin.amplifyapp.com',
appStateUrl: 'https://1en4kjhdm6.execute-api.eu-west-3.amazonaws.com/wave5Prod',
},
'me-south-1': {
amplifyAdminUrl: 'https://me-south-1.admin.amplifyapp.com',
appStateUrl: 'https://40mq9z67ij.execute-api.me-south-1.amazonaws.com/wave5Prod',
},
'sa-east-1': {
amplifyAdminUrl: 'https://sa-east-1.admin.amplifyapp.com',
appStateUrl: 'https://7t34hu5t8i.execute-api.sa-east-1.amazonaws.com/wave5Prod',
},
'us-east-1': {
amplifyAdminUrl: 'https://us-east-1.admin.amplifyapp.com',
appStateUrl: 'https://e7auv6no3g.execute-api.us-east-1.amazonaws.com/wave3Prod',
Expand All @@ -177,6 +193,10 @@ export const adminBackendMap: {
amplifyAdminUrl: 'https://us-east-2.admin.amplifyapp.com',
appStateUrl: 'https://x1wkkmql32.execute-api.us-east-2.amazonaws.com/wave2Prod',
},
'us-west-1': {
amplifyAdminUrl: 'https://us-west-1.admin.amplifyapp.com',
appStateUrl: 'https://djj8zh4ii1.execute-api.us-west-1.amazonaws.com/wave5Prod',
},
'us-west-2': {
amplifyAdminUrl: 'https://us-west-2.admin.amplifyapp.com',
appStateUrl: 'https://3ne6skqg0g.execute-api.us-west-2.amazonaws.com/wave4Prod',
Expand Down
8 changes: 5 additions & 3 deletions packages/graphql-elasticsearch-transformer/src/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ export class ResourceFactory {
[ResourceConstants.RESOURCES.ElasticsearchDataSourceLogicalID]: this.makeElasticsearchDataSource(),
[ResourceConstants.RESOURCES.ElasticsearchDomainLogicalID]: this.makeElasticsearchDomain(),
[ResourceConstants.RESOURCES.ElasticsearchStreamingLambdaIAMRoleLogicalID]: this.makeStreamingLambdaIAMRole(),
[ResourceConstants.RESOURCES.ElasticsearchStreamingLambdaFunctionLogicalID]: this.makeDynamoDBStreamingFunction(
isProjectUsingDataStore,
),
[ResourceConstants.RESOURCES.ElasticsearchStreamingLambdaFunctionLogicalID]:
this.makeDynamoDBStreamingFunction(isProjectUsingDataStore),
},
Mappings: this.getLayerMapping(),
Outputs: {
Expand Down Expand Up @@ -219,6 +218,9 @@ export class ResourceFactory {
'us-gov-east-1': {
layerRegion: 'arn:aws-us-gov:lambda:us-gov-east-1:138526772879:layer:AWSLambda-Python-AWS-SDK:1',
},
'me-south-1': {
layerRegion: 'arn:aws:lambda:me-south-1:507411403535:layer:AWSLambda-Python-AWS-SDK:1',
},
},
};
}
Expand Down

0 comments on commit 15deba8

Please sign in to comment.