[Fetch Migration] CDK bugfix and other minor updates#387
Closed
kartg wants to merge 3 commits intoopensearch-project:mainfrom
Closed
[Fetch Migration] CDK bugfix and other minor updates#387kartg wants to merge 3 commits intoopensearch-project:mainfrom
kartg wants to merge 3 commits intoopensearch-project:mainfrom
Conversation
…r endpoint in Fetch Migration stack
This is required instead of StringParameter.valueForStringParameter because the latter returns a token that is only resolved at deployment time. Since the value of the target cluster endpoint is substituted into the Data Prepper pipeline file prior to the deployment, it incorrectly wrote a string representation of the Token object - "${Token[TOKEN.123]}". Using StringParameter.valueFromLookup looks up the value immediately, so now the substitution occurs correctly.
Signed-off-by: Kartik Ganesh <gkart@amazon.com>
Signed-off-by: Kartik Ganesh <gkart@amazon.com>
…ntation Signed-off-by: Kartik Ganesh <gkart@amazon.com>
Codecov Report
@@ Coverage Diff @@
## main #387 +/- ##
=========================================
Coverage 64.23% 64.23%
Complexity 726 726
=========================================
Files 82 82
Lines 3277 3277
Branches 306 306
=========================================
Hits 2105 2105
Misses 983 983
Partials 189 189
Flags with carried forward coverage won't be shown. Click here to find out more. |
lewijacn
reviewed
Nov 3, 2023
|
|
||
| // Import required values | ||
| const targetClusterEndpoint = StringParameter.valueForStringParameter(this, `/migration/${props.stage}/${props.defaultDeployId}/osClusterEndpoint`) | ||
| const targetClusterEndpoint = StringParameter.valueFromLookup(this, `/migration/${props.stage}/${props.defaultDeployId}/osClusterEndpoint`) |
Contributor
There was a problem hiding this comment.
I don't think this makes sense. Value from lookup requires that the value be there at synthesis time. If there is anyway we can retrieve this from the Migration Console it seems preferable
Member
Author
|
Moving to draft PR based on this comment |
3 tasks
Member
Author
|
Closing in favor of #398 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Fetch Migration stack now uses
StringParameter.valueFromLookupto resolve the target cluster endpoint from Parameter Store. This is required instead of theStringParameter.valueForStringParameterthat was previously used because valueForStringParameter returns aTokenthat is only resolved at deployment time.This PR also includes two other minor updates:
Since the value of the target cluster endpoint is substituted into the pipeline template file prior to deployment time, a string representation of the Token object (eg.
${Token[TOKEN.123]}) was being written instead of the actual endpoint URI. Using valueFromLookup looks up the value immediately, so the substitution occurs correctly with the bugfix.Issues Resolved
N/A
Testing
Bug identified while using CDK. Bugfix verified by re-deploying CDK and verifying that the correct value is now used.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.