Skip to content

Commit

Permalink
Prepend AppRegistry application name with static name
Browse files Browse the repository at this point in the history
Stack name is used in naming AppRegistry application and attribute group; which must not begin with aws.
The change adds support for stack names starting with aws-*
  • Loading branch information
gsingh04 committed Feb 3, 2023
1 parent 53d3108 commit 0c988bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class CommonResources extends Construct {
const applicationType = "AWS-Solutions";

const application = new appreg.Application(stack, "AppRegistry", {
applicationName: Fn.join("-", [Aws.STACK_NAME, Aws.REGION, Aws.ACCOUNT_ID]),
applicationName: Fn.join("-", ["AppRegistry", Aws.STACK_NAME, Aws.REGION, Aws.ACCOUNT_ID]),
description: `Service Catalog application to track and manage all your resources for the solution ${props.applicationName}`,
});
application.associateStack(stack);
Expand All @@ -104,7 +104,7 @@ export class CommonResources extends Construct {
Tags.of(application).add("Solutions:ApplicationType", applicationType);

const attributeGroup = new appreg.AttributeGroup(stack, "DefaultApplicationAttributes", {
attributeGroupName: Aws.STACK_NAME,
attributeGroupName: `AppRegistry-${Aws.STACK_NAME}`,
description: "Attribute group for solution information",
attributes: {
applicationType,
Expand Down
11 changes: 10 additions & 1 deletion source/constructs/test/__snapshots__/constructs.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
"Fn::Join": [
"-",
[
"AppRegistry",
{
"Ref": "AWS::StackName",
},
Expand Down Expand Up @@ -1825,7 +1826,15 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
},
"Description": "Attribute group for solution information",
"Name": {
"Ref": "AWS::StackName",
"Fn::Join": [
"",
[
"AppRegistry-",
{
"Ref": "AWS::StackName",
},
],
],
},
"Tags": {
"SolutionId": "S0ABC",
Expand Down

0 comments on commit 0c988bb

Please sign in to comment.