Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,28 @@ describe('CFNOutputResolver', () => {
'Fn::GetAtt': ['SNSRole', 'Arn'],
},
},
HostedUIDomain: {
Description: 'HostedUIDomain',
Value: {
'Fn::If': [
'ShouldNotCreateEnvResources',
'HostedUIDomainLogicalId',
{
'Fn::Join': [
'-',
[
{
Ref: 'hostedUIDomainName',
},
{
Ref: 'env',
},
],
],
},
],
},
},
},
Resources: {
MyS3Bucket: {
Expand Down Expand Up @@ -182,6 +204,10 @@ describe('CFNOutputResolver', () => {
Description: 'role arn',
Value: 'arn:aws:iam::12345:role/sns12345-dev',
},
HostedUIDomain: {
Description: 'HostedUIDomain',
Value: 'my-hosted-UI-domain',
},
},
Resources: {
MyS3Bucket: {
Expand Down Expand Up @@ -321,6 +347,10 @@ describe('CFNOutputResolver', () => {
OutputKey: 'CreatedSNSRole',
OutputValue: 'arn:aws:iam::12345:role/sns12345-dev',
},
{
OutputKey: 'HostedUIDomain',
OutputValue: 'my-hosted-UI-domain',
},
],
),
).toEqual(expectedTemplate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class CfnOutputResolver {
stackTemplateResourcesString = stackTemplateResourcesString.replaceAll(outputRegexp, `"${stackOutputValue}"`);
} else if (GET_ATT in value && Array.isArray(value[GET_ATT])) {
logicalResourceId = value[GET_ATT][0];
} else {
return;
}
assert(logicalResourceId);

Expand Down
5 changes: 5 additions & 0 deletions packages/amplify-migration/src/command-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,11 @@ export async function revertGen2Migration(fromStack: string, toStack: string) {
const usageData = await getUsageDataMetric(envName);
if (success) {
printer.print(format.success(`Moved resources back to Gen1 stack successfully.`));
const movingGen1BackendFiles = ora(`Moving your Gen1 backend files to ${format.highlight(AMPLIFY_DIR)}`).start();
// Move gen1 amplify from .amplify/migration/amplify to amplify
await fs.rm(AMPLIFY_DIR, { force: true, recursive: true });
await fs.rename(`${MIGRATION_DIR}/amplify`, AMPLIFY_DIR);
movingGen1BackendFiles.succeed(`Moved your Gen1 backend files to ${format.highlight(AMPLIFY_DIR)}`);
await usageData.emitSuccess();
} else {
await usageData.emitError(new Error('Failed to run revert command'));
Expand Down
Loading