Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding AWS CFN Trait: cfnDefaultValue #1285

Merged
merged 13 commits into from
Jul 14, 2022
Merged

Conversation

rnihithp
Copy link
Contributor

@rnihithp rnihithp commented Jun 22, 2022

Added a new trait for cfnDefaultValue.

cfnDefaultValue: Trait to indicate the property that's the default value.

Commit 1: adding trait definition for cfnDefaultValue
Commit 2: adding trait definition for cfnRootResourceID
Commit 3: defining validator for cfnRootResourceID
Commit 4: defining test for cfnDefaultValue - test passes
Commit 5: checkstyle
Commit 6: checkstyle
Commit 7: tests fixed, cfnRootResourceID trait/selector/validation updated
Commit 8: cfnRootResourceID validation fixed
Commit 9: removed cfnRootResourceID trait from PR

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rnihithp rnihithp requested a review from a team as a code owner June 22, 2022 14:14
@rnihithp rnihithp changed the title Adding AWS CFN Traits: cfnDefaultValue and cfnRootResourceID for Breeze M1 Adding AWS CFN Traits: cfnDefaultValue and cfnRootResourceID Jun 22, 2022
@rnihithp rnihithp changed the title Adding AWS CFN Traits: cfnDefaultValue and cfnRootResourceID Adding AWS CFN Traits: cfnDefaultValue Jul 7, 2022
@rnihithp rnihithp changed the title Adding AWS CFN Traits: cfnDefaultValue Adding AWS CFN Trait: cfnDefaultValue Jul 7, 2022
@rnihithp rnihithp changed the base branch from main to idl-2.0 July 13, 2022 23:10
@rnihithp rnihithp changed the base branch from idl-2.0 to main July 14, 2022 19:07
@rnihithp rnihithp changed the base branch from main to idl-2.0 July 14, 2022 19:07
Copy link
Contributor Author

@rnihithp rnihithp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These requests have been addressed in subsequent commits

@DavidOgunsAWS DavidOgunsAWS merged commit 2879601 into smithy-lang:idl-2.0 Jul 14, 2022

Given the following example, because the ``fooAlias``
member is annotated with ``cfnDefaultValue``, it can be derived
that the ``fooAlias`` member has a default value for this resource.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the significance of the trait though? I don't understand how it's used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mainly for use in drift detection. What this trait does is indicate that the cfn property generated from the member has a default value. For ex if we have this :

@output
structure GetFooResponse {
    ....
    @cfnDefaultValue
    timeout: Integer
    ....
 }

We don't need the actual default value to be passed into the trait in this case. The main behavior we need with this trait is the ability to annotate a member as default so we know the specific members/properties that must match for drift detection.

mtdowling pushed a commit that referenced this pull request Aug 10, 2022
* cfnDefaultValue trait definition added
mtdowling pushed a commit that referenced this pull request Aug 10, 2022
* cfnDefaultValue trait definition added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants