feat(servicecatalog): add CloudFormation Parameter constraint#15770
feat(servicecatalog): add CloudFormation Parameter constraint#15770mergify[bot] merged 19 commits intoaws:masterfrom
Conversation
Add ability to configure parameter options for when launching a product. Co-authored-by: Dillon Ponzo <dponzo18@gmail.com>
|
Want to specifically call out how we call the Also scoping down the types for the Cfn Conditions proved more cumbersome than just using the condition interface and adding documentation about what intrinsic functions you can use. |
skinny85
left a comment
There was a problem hiding this comment.
Want to specifically call out how we call the
formatRulesinassociation-manager.tsto make sure that that approach is cdk friendly. Seemed like a clean way to do it in typescript but please let us know if there is another avenue that you think is better.
I think it's fine... what specifically were you worried about?
Also scoping down the types for the Cfn Conditions proved more cumbersome than just using the condition interface and adding documentation about what intrinsic functions you can use.
Can you expand why was it cumbersome? I still would like to see this change implemented, so that specifying the wrong function will be a compile-time error.
packages/@aws-cdk/aws-servicecatalog/lib/private/association-manager.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/private/association-manager.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/private/association-manager.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/private/association-manager.ts
Outdated
Show resolved
Hide resolved
| // Add dependsOn to force proper order in deployment. | ||
| constraint.addDependsOn(association.cfnPortfolioProductAssociation); | ||
| } else { | ||
| throw new Error(`Provisioning rule ${assertion.ruleName} already configured on association ${this.prettyPrintAssociation(portfolio, product)}`); |
There was a problem hiding this comment.
There's some thought to making this override the previous Rule, instead of erroring out.
Maybe an option in constrainProvisioningParameters?
There was a problem hiding this comment.
This is here because in CFN templates you would have all the provisioning rules listed in the same construct, so you can't have overlapping names which are the keys in the map. I broke it apart here like the event notifications, since one would probably only ever add 1-2 rules per product, but I think we still would rather keep unique names in case we need to shift back to that mode of adding all rules in one construct, which would be less of a breaking change if we enforce unique names now. But I don't think someone would want to override rules, usually they would do that with the condition.
I meant it was going to be cumbersome to fit in this PR. We have been looking at how to modify the interface in |
Fortunately, you made this PR small enough that I don't think adding the changes in Please include these in this PR. |
skinny85
left a comment
There was a problem hiding this comment.
Looks good overall, but please include the changes mentioned in #15770 (comment) to make providing the functions to the assertions compile-time safe.
packages/@aws-cdk/aws-servicecatalog/lib/private/association-manager.ts
Outdated
Show resolved
Hide resolved
| ids.forEach(val => sha256.update(val)); | ||
| return sha256.digest('hex').slice(0, 12); | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
not sure what/how this snuck in.
There was a problem hiding this comment.
didn't see what change was but I think this is removed now
bffb25f to
c927a18
Compare
|
I am still not sure if this is correct way for implementing the stronger typed assertions, I am still not sure if this is correct, it almost looks like the already existing Edit: Actually I am not sure what exactly the issue was, I think |
| * Interface to specify certain functions as rule-specifc. | ||
| * These functions can only be used in ``Rules`` section of template. | ||
| */ | ||
| export interface ICfnRuleConditionExpression extends ICfnConditionExpression { |
71d4a3f to
28c6369
Compare
|
I might've requested review too early, I thought build failed after making |
091631a to
a586aa8
Compare
skinny85
left a comment
There was a problem hiding this comment.
Looks great! A few minor notes.
| ids.forEach(val => sha256.update(val)); | ||
| return sha256.digest('hex').slice(0, 12); | ||
| } | ||
| } No newline at end of file |
f64a78a to
32a7200
Compare
8e73ae6 to
8cc8d28
Compare
b9d6d15 to
f3887ba
Compare
|
Okay, I tried Codebuild with and without the changes in |
Like I suspected, you need to revert the changes to |
|
|
||
| ### CloudFormation parameters constraint | ||
|
|
||
| CloudFormation parameters constraints allow you to configure the that are available to end users when they launch a product via defined rules. |
There was a problem hiding this comment.
Missing word?
| CloudFormation parameters constraints allow you to configure the that are available to end users when they launch a product via defined rules. | |
| CloudFormation parameters constraints allow you to configure the values that are available to end users when they launch a product via defined rules. |
|
|
||
| class FnConditionBase extends Intrinsic implements ICfnConditionExpression { | ||
| class FnConditionBase extends Intrinsic implements ICfnRuleConditionExpression { | ||
| readonly disambiguator = true; |
There was a problem hiding this comment.
Maybe an empty line after this line?
There was a problem hiding this comment.
will track for next PR.
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Add ability to configure parameter options for when launching a product.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
Co-authored-by: Dillon Ponzo dponzo18@gmail.com