Commit 70710ed
PoeppingT
Fix bug in updating repository for services with non-CloudFormation-compatible names.
When a new AppConfig is published with additional services, multiple
parts of a workflow kick off.
1. Settings Service fires an event to the Onboarding service to update
the stack.
2. Onboarding service updates the core stack with the updated AppConfig
(updating created infrastructure for configured services).
3. As part of the update-stack kicked off by the Onboarding service, the
app-services-ecr-macro kicks in to alter the template according to
that new AppConfig because CloudFormation executes the template
update.
4. core-stack-listener function automatically listens to updates on that
stack, waiting for ECR repositories to be marked as CREATE_COMPLETE.
When that happens, core-stack-listener pulls the service name from
that resource and fires an event to Settings to update
the configured ECR repository for that service.
Before this commit, there was a bug in the interaction between the
core-stack-listener and the app-services-ecr-macro. The
core-stack-listener was expecting the CloudFormation resource name of
the ECR repository to represent the real service name as stored in the
Settings service, while the app-services-ecr-macro had made changes to
that same name to ensure the resource matched CloudFormation
restrictions ([a-zA-Z0-9]+). The Settings service only enforces that
service names conform to SSM ParameterStore restrictions ([a-zA-Z0-9\.-_]+).
Luckily, the app-services-ecr-macro was already creating a Tag for the
ECR resource containing the service name. So this commit alters the
core-stack-listener to:
1. have permissions to list tags for ECR resources matching the
repository name patterns that will be created by the core stack
2. resolves the service name for a given repository by reading the tag,
rather than the resource name (falling back to resource name if no
tag was found) before sending the event to Settings
In manual testing this has been shown to fix the issue.1 parent 965e4d2 commit 70710ed
File tree
3 files changed
+59
-10
lines changed- functions/core-stack-listener
- src/main/java/com/amazon/aws/partners/saasfactory/saasboost
- resources
3 files changed
+59
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
129 | 144 | | |
130 | 145 | | |
131 | 146 | | |
Lines changed: 38 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| |||
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
61 | 74 | | |
62 | 75 | | |
63 | 76 | | |
| |||
81 | 94 | | |
82 | 95 | | |
83 | 96 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
89 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
90 | 107 | | |
91 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
92 | 121 | | |
93 | 122 | | |
94 | | - | |
95 | | - | |
| 123 | + | |
| 124 | + | |
96 | 125 | | |
97 | 126 | | |
98 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
537 | 542 | | |
538 | 543 | | |
539 | 544 | | |
| |||
0 commit comments