-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Intriniscs Design Doc #1260
Intriniscs Design Doc #1260
Conversation
designs/intrinsics_design.md
Outdated
|
||
### AWS::AccountId | ||
|
||
This property will be resolved by running an aws command to figure out the configuration. If there is an error, a randomly such as non-authenticated, a randomly generated string will take its place. |
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.
Why? We have a default value already, why are we reaching out to the cloud for this?
designs/intrinsics_design.md
Outdated
|
||
### AWS::StackId | ||
|
||
Currently, there is no real way to figure this one out. It will be a randomly generated String |
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.
static to remain consistent with what we do now. Also we should just state here what the static values are.
You should do a pass through all of these Pseudo Parameters and apply this feedback to each.
designs/intrinsics_design.md
Outdated
|
||
## Implementing the Code | ||
|
||
This can be seperated into a Intrinsics resolver and a SymbolResolver. |
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.
I think an Intrinsics resolver is but should define what a SymbolResolver is and what it does.
designs/intrinsics_design.md
Outdated
|
||
## Integration into SAM-CLI | ||
|
||
This can be very easily plugged into the current SAM-CLI code. This needs to be run after the SamBaseTranslator runs in the ApiProvider. This will go through every property and check if it requires intrinsic resolution. |
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.
SamBaseTranslator
runs in any provider not just the ApiProvider.
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.
I was talking about how it can be integrated into the current codebase and where this can be added into the ApiProvider
* Customers can use tools such as AWS CDK to generate a template. The templates will have intrinsic properties. The customer can create their AWS CDK project with `cdk init app` and then generate their CloudFormation code using `cdk synth.`They can input their CloudFormation code to test it locally using the SAM CLI command. | ||
* Customers can author CloudFormation resources and test them locally by inputting their templates into sam local start-api. | ||
|
||
Once the user has their CloudFormation code, they will be running `sam local start-api --template /path/to/template.yaml` |
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.
Comment above still holds. This looks like it was from your other design and not sure how it relates to the intrinsic support.
|
||
This intrinsic function is very similar to the Fn::And function, but will check that at least one of the items in the last returns a truthy value. | ||
|
||
## Pseudo Parameters |
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.
Can we add what each of the Pseudo Parameters resolve to?
} | ||
``` | ||
|
||
* common_attribute_resolver: resolves common attributes that will be true across all |
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.
Is this used for helping resolve Fn::GetAtt
for all the 'common' attributes a resource could typically have?
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.
Yes
designs/intrinsics_design.md
Outdated
``` | ||
|
||
|
||
First pseudo types are checked. If item is present in the logical_id_translator it is returned. Otherwise, it falls back to the default_pseudo_resolver. Then the default_type_resolver is checked, which has common attributes and functions for each types. Then the common_attribute_resolver is run, which has functions that are common for each attribute. |
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.
All of this is for Pseudo Parameters? Pseudo parameters are all predefined. Seems like a lot of extra work that isn't needed.
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.
The paragraph might need to be clarified. The paragraph describes the flow of logic for resolving symbol table attributes.
designs/intrinsics_design.md
Outdated
processed_template[processed_key] = processed_resource | ||
``` | ||
|
||
If there is an error with the resource, the item will be ignored and processed. |
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 do you mean by error with the resource? Without understanding what you mean, it's hard to tell if this really should just ignore or bubble up the error to the customer.
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.
The idea was to not break any workflows for unresolved symbol table or reference errors. Currently, in SAM these properties are ignored and wouldn't cause any errors, so by ignoring the errors we are using the same functionality. This is true for refs that exist to cloud instances. To ignore the error, we just copy the resource as is.
I will update this in the description.
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.
LGTM
Issue #, if available:
Description of changes:
Checklist:
make pr
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.