Skip to content

Conversation

ShreyaGangishetty
Copy link

Issue #, if available:

Description of changes:
Added documentation for referable properties in SAM.

Description of how you validated changes:

Checklist:

  • make pr passes
  • Update documentation

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

@keetonian
Copy link
Contributor

This is just for referencing other CloudFormation resources that SAM creates, correct? Thank you for including the properties that cause SAM to create these resources.

@codecov-io
Copy link

codecov-io commented Feb 25, 2020

Codecov Report

Merging #1468 into develop will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1468      +/-   ##
===========================================
+ Coverage    94.39%   94.39%   +<.01%     
===========================================
  Files           78       78              
  Lines         4709     4714       +5     
  Branches       944      948       +4     
===========================================
+ Hits          4445     4450       +5     
  Misses         121      121              
  Partials       143      143
Impacted Files Coverage Δ
samtranslator/model/api/api_generator.py 95.07% <0%> (+0.03%) ⬆️
samtranslator/model/eventsources/push.py 90.78% <0%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 58d1dc2...10db9c0. Read the comment docs.

@ShreyaGangishetty
Copy link
Author

This is just for referencing other CloudFormation resources that SAM creates, correct? Thank you for including the properties that cause SAM to create these resources.

Yes, this doc is for all referable properties(CFN resources) that SAM creates when SAM resources are defined in the template

@keetonian keetonian self-assigned this Feb 26, 2020
@alexw91
Copy link

alexw91 commented Feb 27, 2020

Codecov Report

Merging #1468 into develop will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1468   +/-   ##
========================================
  Coverage    94.39%   94.39%           
========================================
  Files           78       78           
  Lines         4709     4714    +5     
  Branches       944      948    +4     
========================================
+ Hits          4445     4450    +5     
  Misses         121      121           
  Partials       143      143           
Impacted Files Coverage Δ
samtranslator/model/api/api_generator.py 95.07% <0.00%> (+0.03%) ⬆️
samtranslator/model/eventsources/push.py 90.78% <0.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 58d1dc2...0a8e5ec. Read the comment docs.

@codecov-io
Copy link

Codecov Report

Merging #1468 into develop will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1468      +/-   ##
===========================================
+ Coverage    94.39%   94.39%   +<.01%     
===========================================
  Files           78       78              
  Lines         4709     4714       +5     
  Branches       944      948       +4     
===========================================
+ Hits          4445     4450       +5     
  Misses         121      121              
  Partials       143      143
Impacted Files Coverage Δ
samtranslator/model/api/api_generator.py 95.07% <0%> (+0.03%) ⬆️
samtranslator/model/eventsources/push.py 90.78% <0%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 58d1dc2...0a8e5ec. Read the comment docs.


Property Name | Reference | LogicalId | Description
---|:---:|---|---
Stage | `restapi-logical-id`.Stage | `restapi-logical-id` `StageName`Stage | SAM generates `AWS::ApiGateway::Stage` resource when `AWS::Serverless::Api` resource is defined. This resource can be referenced in intrinsic function using the resource logical id or `restapi-logical-id`.Stage
Copy link
Contributor

Choose a reason for hiding this comment

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

Approving, as I believe the information here is correct. However, there is another case for the logical id of the stage, and that is when SAM can't resolve the actual stage name (because it's using intrinsics that SAM can't read).

@alexw91
Copy link

alexw91 commented Feb 27, 2020

Codecov Report

Merging #1468 into develop will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1468   +/-   ##
========================================
  Coverage    94.39%   94.39%           
========================================
  Files           78       78           
  Lines         4709     4714    +5     
  Branches       944      948    +4     
========================================
+ Hits          4445     4450    +5     
  Misses         121      121           
  Partials       143      143           
Impacted Files Coverage Δ
samtranslator/model/sam_resources.py 94.06% <0.00%> (ø) ⬆️
samtranslator/model/api/api_generator.py 95.07% <0.00%> (+0.03%) ⬆️
samtranslator/model/eventsources/push.py 90.78% <0.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 58d1dc2...a9a3678. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Mar 3, 2020

Codecov Report

Merging #1468 into develop will not change coverage.
The diff coverage is 82.65%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1468   +/-   ##
========================================
  Coverage    94.15%   94.15%           
========================================
  Files           78       78           
  Lines         4789     4789           
  Branches       967      967           
========================================
  Hits          4509     4509           
  Misses         130      130           
  Partials       150      150
Impacted Files Coverage Δ
samtranslator/plugins/globals/globals.py 99.05% <ø> (ø) ⬆️
samtranslator/model/eventsources/push.py 90.78% <100%> (ø) ⬆️
samtranslator/model/api/api_generator.py 95.07% <100%> (ø) ⬆️
...el/preferences/deployment_preference_collection.py 91.35% <100%> (ø) ⬆️
samtranslator/__init__.py 100% <100%> (ø) ⬆️
samtranslator/model/intrinsics.py 95.83% <100%> (ø) ⬆️
samtranslator/model/sam_resources.py 94.2% <100%> (ø) ⬆️
samtranslator/public/intrinsics.py 100% <100%> (ø) ⬆️
samtranslator/model/function_policies.py 100% <100%> (ø) ⬆️
samtranslator/model/api/http_api_generator.py 93.19% <68.96%> (ø) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b1afc2...f5f567b. Read the comment docs.

@alexw91
Copy link

alexw91 commented Mar 3, 2020

Codecov Report

Merging #1468 into develop will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1468   +/-   ##
========================================
  Coverage    94.15%   94.15%           
========================================
  Files           78       78           
  Lines         4789     4789           
  Branches       967      967           
========================================
  Hits          4509     4509           
  Misses         130      130           
  Partials       150      150           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5221fc...f5f567b. Read the comment docs.

Copy link
Contributor

@praneetap praneetap left a comment

Choose a reason for hiding this comment

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

This also reminded me to actually make the domainname referable! :D Thanks!

---|:---:|---|---
Alias | `function-logical-id`.Alias | `function-logical-id`Alias`alias-name` | SAM generates an `AWS::Lambda::Alias` resource when `AutoPublishAlias` property is set. This resource can be referenced in intrinsic functions by using the resource logical ID or `function-logical-id`.Alias
Version | `function-logical-id`.Version | `function-logical-id`Version`sha` | SAM generates an `AWS::Lambda::Version` resource when `AutoPublishAlias` property is set. This resource can be referenced in intrinsic functions by using the resource logical ID or `function-logical-id`.Version
Destination (for SNS Topic) | `function-logical-id`.DestinationTopic |`function-logical-id`EventInvokeConfig`OnSuccess/OnFailure`Topic| SAM auto creates an `AWS::SNS::Topic` resource when `Destination` property of `DestinationConfig` property in `EventInvokeConfig` property is not specified. This generated resource can be referenced by using `function-logical-id`.DestinationTopic
Copy link
Contributor

Choose a reason for hiding this comment

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

I would make the property name DestinationTopic

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, I will update

Alias | `function-logical-id`.Alias | `function-logical-id`Alias`alias-name` | SAM generates an `AWS::Lambda::Alias` resource when `AutoPublishAlias` property is set. This resource can be referenced in intrinsic functions by using the resource logical ID or `function-logical-id`.Alias
Version | `function-logical-id`.Version | `function-logical-id`Version`sha` | SAM generates an `AWS::Lambda::Version` resource when `AutoPublishAlias` property is set. This resource can be referenced in intrinsic functions by using the resource logical ID or `function-logical-id`.Version
Destination (for SNS Topic) | `function-logical-id`.DestinationTopic |`function-logical-id`EventInvokeConfig`OnSuccess/OnFailure`Topic| SAM auto creates an `AWS::SNS::Topic` resource when `Destination` property of `DestinationConfig` property in `EventInvokeConfig` property is not specified. This generated resource can be referenced by using `function-logical-id`.DestinationTopic
Destination (for SQS Queue) | `function-logical-id`.DestinationQueue |`function-logical-id`EventInvokeConfig`OnSuccess/OnFailure`Queue | SAM auto creates an `AWS::SQS::Queue` resource when `Destination` property of `DestinationConfig` property in `EventInvokeConfig` property is not specified. This generated resource can be referenced by using `function-logical-id`.DestinationQueue
Copy link
Contributor

Choose a reason for hiding this comment

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

PropertyName DestinationQueue

@codecov-io
Copy link

codecov-io commented Mar 3, 2020

Codecov Report

Merging #1468 into develop will not change coverage.
The diff coverage is 82.65%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1468   +/-   ##
========================================
  Coverage    94.15%   94.15%           
========================================
  Files           78       78           
  Lines         4789     4789           
  Branches       967      967           
========================================
  Hits          4509     4509           
  Misses         130      130           
  Partials       150      150
Impacted Files Coverage Δ
samtranslator/plugins/globals/globals.py 99.05% <ø> (ø) ⬆️
samtranslator/model/eventsources/push.py 90.78% <100%> (ø) ⬆️
samtranslator/model/api/api_generator.py 95.07% <100%> (ø) ⬆️
...el/preferences/deployment_preference_collection.py 91.35% <100%> (ø) ⬆️
samtranslator/__init__.py 100% <100%> (ø) ⬆️
samtranslator/model/intrinsics.py 95.83% <100%> (ø) ⬆️
samtranslator/model/sam_resources.py 94.2% <100%> (ø) ⬆️
samtranslator/public/intrinsics.py 100% <100%> (ø) ⬆️
samtranslator/model/function_policies.py 100% <100%> (ø) ⬆️
samtranslator/model/api/http_api_generator.py 93.19% <68.96%> (ø) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b1afc2...b8cc833. Read the comment docs.

@ShreyaGangishetty ShreyaGangishetty merged commit f928b4b into aws:develop Mar 3, 2020
ShreyaGangishetty pushed a commit to ShreyaGangishetty/serverless-application-model that referenced this pull request Mar 3, 2020

Property Name | Reference | LogicalId | Description
---|:---:|---|---
Stage | `restapi-logical-id`.Stage | `restapi-logical-id` `StageName`Stage | SAM generates `AWS::ApiGateway::Stage` resource when `AWS::Serverless::Api` resource is defined. This resource can be referenced in intrinsic function using the resource logical id or `restapi-logical-id`.Stage
Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I know, Stage LogicalId does not contain StageName, so it will be "restapi-logical-idStage". Please refer #259 (comment)

I'm not sure HTTPApi is same or not.

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.

6 participants