Skip to content

Commit

Permalink
AT-5519: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
rddimon committed Jan 14, 2022
1 parent 521bda4 commit f77c898
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [5.3.0] - 2021-12-20
## [5.4.0] - 2021-01-20
- Added custom route53 profile options. Thank you @CodeVision ([393](https://github.com/amplify-education/serverless-domain-manager/pull/393))

## [5.3.0] - 2021-01-14
- Added support of Serverless version 3. Thank you @medikoo ([449](https://github.com/amplify-education/serverless-domain-manager/pull/449))
- Integration test refactoring

Expand Down
9 changes: 1 addition & 8 deletions src/aws/cloud-formation-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@ class CloudFormationWrapper {
* Gets rest API id from CloudFormation stack or nested stack
*/
public async getApiId(domain: DomainConfig, stackName: string): Promise<string> {
let logicalResourceId = "ApiGatewayRestApi";
if (domain.apiType === Globals.apiTypes.http) {
logicalResourceId = "HttpApi";
}
if (domain.apiType === Globals.apiTypes.websocket) {
logicalResourceId = "WebsocketsApi";
}

const logicalResourceId = Globals.CFResourceIds[domain.apiType];
let response;
try {
// trying to get information for specified stack name
Expand Down
9 changes: 8 additions & 1 deletion src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ export default class Globals {
[Globals.apiTypes.websocket]: "websocketApiId",
};

// Cloud Formation Resource Ids
public static CFResourceIds = {
[Globals.apiTypes.http]: "HttpApi",
[Globals.apiTypes.rest]: "ApiGatewayRestApi",
[Globals.apiTypes.websocket]: "WebsocketsApi",
};

public static tlsVersions = {
tls_1_0: "TLS_1_0",
tls_1_2: "TLS_1_2",
Expand Down Expand Up @@ -92,7 +99,7 @@ export default class Globals {
*/

public static printDomainSummary(domain: DomainConfig): void {
Globals.cliLog( chalk.yellow.underline("Summary:"), chalk.yellow("Distribution Domain Name"));
Globals.cliLog(chalk.yellow.underline("Summary:"), chalk.yellow("Distribution Domain Name"));
Globals.cliLog("", ` Domain Name: ${domain.givenDomainName}`);
Globals.cliLog("", ` Target Domain: ${domain.domainInfo.domainName}`);
Globals.cliLog("", ` Hosted Zone Id: ${domain.domainInfo.hostedZoneId}`);
Expand Down

0 comments on commit f77c898

Please sign in to comment.