-
Notifications
You must be signed in to change notification settings - Fork 221
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
Conversation
smithy-aws-cloudformation-traits/src/main/resources/META-INF/smithy/aws.cloudformation.smithy
Outdated
Show resolved
Hide resolved
smithy-aws-cloudformation-traits/src/main/resources/META-INF/smithy/aws.cloudformation.smithy
Outdated
Show resolved
Hide resolved
...n/java/software/amazon/smithy/aws/cloudformation/traits/CfnRootResourceIdTraitValidator.java
Outdated
Show resolved
Hide resolved
...n/java/software/amazon/smithy/aws/cloudformation/traits/CfnRootResourceIdTraitValidator.java
Outdated
Show resolved
Hide resolved
...s/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnRootResourceIdTrait.java
Outdated
Show resolved
Hide resolved
...n/java/software/amazon/smithy/aws/cloudformation/traits/CfnRootResourceIdTraitValidator.java
Outdated
Show resolved
Hide resolved
smithy-aws-cloudformation-traits/src/main/resources/META-INF/smithy/aws.cloudformation.smithy
Outdated
Show resolved
Hide resolved
smithy-aws-cloudformation-traits/src/main/resources/META-INF/smithy/aws.cloudformation.smithy
Outdated
Show resolved
Hide resolved
...n/java/software/amazon/smithy/aws/cloudformation/traits/CfnRootResourceIdTraitValidator.java
Outdated
Show resolved
Hide resolved
...n/java/software/amazon/smithy/aws/cloudformation/traits/CfnRootResourceIdTraitValidator.java
Outdated
Show resolved
Hide resolved
...aits/src/test/resources/software/amazon/smithy/aws/cloudformation/traits/test-service.smithy
Outdated
Show resolved
Hide resolved
smithy-aws-cloudformation-traits/src/main/resources/META-INF/smithy/aws.cloudformation.smithy
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
|
||
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
* cfnDefaultValue trait definition added
* cfnDefaultValue trait definition added
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.