From 906368b5b2c585e377058881862aa4acbce64d5d Mon Sep 17 00:00:00 2001 From: Shreya Gangishetty Date: Tue, 25 Feb 2020 10:00:17 -0800 Subject: [PATCH 1/7] docs: add referable properties of sam resources --- versions/2016-10-31.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/versions/2016-10-31.md b/versions/2016-10-31.md index 62ebc6661..d09ca6db5 100644 --- a/versions/2016-10-31.md +++ b/versions/2016-10-31.md @@ -16,6 +16,7 @@ The AWS Serverless Application Model (SAM) is licensed under [The Apache License * [Event source types](#event-source-types) * [Property types](#property-types) * [Data types](#data-types) + * [Referable properties of SAM resources](#referable-properties-of-sam-resources) ## Introduction @@ -1240,3 +1241,33 @@ Domain: EvaluateTargetHealth: Boolean # optional | default value is false DistributionDomainName: String # OPTIONAL if the EndpointConfiguration is EDGE | Default points to Api Gateway Distribution | Domain name of a [cloudfront distribution](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html) ``` + +### Referable properties of SAM resources +- [AWS::Serverless::Function](#referable-properties-of-serverless-function) +- [AWS::Serverless::Api](#referable-properties-of-serverless-RestApi) +- [AWS::Serverless::HttpApi](#referable-properties-of-serverless-HttpApi) + +#### Referable properties of Serverless Function +Property Name | Reference | LogicalId | Description +---|:---:|---|--- +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 +DestinationTopic | `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 +DestinationQueue | `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 + +#### Referable properties of Serverless RestApi + +Property Name | Reference | LogicalId | Description +---|:---:|---|--- +Stage | `restapi-logical-id`.Stage | `restapi-logical-id`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 +Deployment | `restapi-logical-id`.Deployment | `restapi-logical-id`Deployment`sha` | SAM generates `AWS::ApiGateway::Deployment` 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`.Deployment +DomainName | `restapi-logical-id`.DomainName | `domain-logical-id` | `AWS::ApiGateway::DomainName` resource can be referenced by using the resource logical id or `restapi-logical-id`.DomainName when `DomainName` resource is defined in `Domain` property of `AWS::Serverless::Api` +UsagePlan | `restapi-logical-id`.UsagePlan | `restapi-logical-id`UsagePlan | SAM generates UsagePlan, UsagePlanKey and ApiKey resources when `UsagePlan` property is set. UsagePlan resource can be referenced in intrinsic function using the resource logical id or `restapi-logical-id`.UsagePlan +UsagePlanKey | `restapi-logical-id`.UsagePlanKey |`restapi-logical-id`UsagePlanKey | SAM generates UsagePlan, UsagePlanKey and ApiKey resources when `UsagePlan` property is set. UsagePlanKey resource can be referenced in intrinsic function using the resource logical id or `restapi-logical-id`.UsagePlanKey +ApiKey | `restapi-logical-id`.ApiKey |`restapi-logical-id`ApiKey | SAM generates UsagePlan, UsagePlanKey and ApiKey resources when `UsagePlan` property is set. ApiKey resource can be referenced in intrinsic function using the resource logical id or `restapi-logical-id`.ApiKey + +#### Referable properties of Serverless HttpApi + +Property Name | Reference | LogicalId | Description +---|:---:|---|--- +Stage | `httpapi-logical-id`.Stage | `httpapi-logical-id`ApiGatewayDefaultStage or `httpapi-logical-id`Stage | SAM generates `AWS::ApiGatewayV2::Stage` resource with `httpapi-logical-id`ApiGatewayDefaultStage logical id if `StageName` property is not defined. If an explicit `StageName` property is defined them SAM generates `AWS::ApiGatewayV2::Stage` resource with `httpapi-logical-id`Stage logicalId. This resource can be referenced in intrinsic functions using `httpapi-logical-id`.Stage \ No newline at end of file From cddb69e7a3b101e4f4678cbde29ecfc6bc757998 Mon Sep 17 00:00:00 2001 From: Shreya Gangishetty Date: Tue, 25 Feb 2020 14:17:21 -0800 Subject: [PATCH 2/7] docs: fix httpapi stage logical id --- versions/2016-10-31.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/2016-10-31.md b/versions/2016-10-31.md index d09ca6db5..592269e0f 100644 --- a/versions/2016-10-31.md +++ b/versions/2016-10-31.md @@ -1270,4 +1270,4 @@ ApiKey | `restapi-logical-id`.ApiKey |`restapi-logical-id`ApiKey | SAM generates Property Name | Reference | LogicalId | Description ---|:---:|---|--- -Stage | `httpapi-logical-id`.Stage | `httpapi-logical-id`ApiGatewayDefaultStage or `httpapi-logical-id`Stage | SAM generates `AWS::ApiGatewayV2::Stage` resource with `httpapi-logical-id`ApiGatewayDefaultStage logical id if `StageName` property is not defined. If an explicit `StageName` property is defined them SAM generates `AWS::ApiGatewayV2::Stage` resource with `httpapi-logical-id`Stage logicalId. This resource can be referenced in intrinsic functions using `httpapi-logical-id`.Stage \ No newline at end of file +StageName | `httpapi-logical-id`.Stage | `httpapi-logical-id`ApiGatewayDefaultStage or `httpapi-logical-id` `StageName`Stage | SAM generates `AWS::ApiGatewayV2::Stage` resource with `httpapi-logical-id`ApiGatewayDefaultStage logical id if `StageName` property is not defined. If an explicit `StageName` property is defined them SAM generates `AWS::ApiGatewayV2::Stage` resource with `httpapi-logical-id` `StageName`Stage logicalId. This resource can be referenced in intrinsic functions using `httpapi-logical-id`.Stage \ No newline at end of file From 10db9c0032f7ed523afba4c0629ab3669648b8b2 Mon Sep 17 00:00:00 2001 From: Shreya Gangishetty Date: Tue, 25 Feb 2020 14:34:14 -0800 Subject: [PATCH 3/7] docs: fix destination property for sqs and sns --- versions/2016-10-31.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versions/2016-10-31.md b/versions/2016-10-31.md index 592269e0f..d28ec2389 100644 --- a/versions/2016-10-31.md +++ b/versions/2016-10-31.md @@ -1252,8 +1252,8 @@ Property Name | Reference | LogicalId | Description ---|:---:|---|--- 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 -DestinationTopic | `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 -DestinationQueue | `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 +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 #### Referable properties of Serverless RestApi From 0a8e5ecac2669079d6792c1c0f78d06a0b6ff02c Mon Sep 17 00:00:00 2001 From: Shreya Gangishetty Date: Wed, 26 Feb 2020 13:40:30 -0800 Subject: [PATCH 4/7] docs: stage logical id for api --- versions/2016-10-31.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/2016-10-31.md b/versions/2016-10-31.md index d28ec2389..c52497b79 100644 --- a/versions/2016-10-31.md +++ b/versions/2016-10-31.md @@ -1259,7 +1259,7 @@ Destination (for SQS Queue) | `function-logical-id`.DestinationQueue |`function- Property Name | Reference | LogicalId | Description ---|:---:|---|--- -Stage | `restapi-logical-id`.Stage | `restapi-logical-id`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 +StageName | `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 Deployment | `restapi-logical-id`.Deployment | `restapi-logical-id`Deployment`sha` | SAM generates `AWS::ApiGateway::Deployment` 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`.Deployment DomainName | `restapi-logical-id`.DomainName | `domain-logical-id` | `AWS::ApiGateway::DomainName` resource can be referenced by using the resource logical id or `restapi-logical-id`.DomainName when `DomainName` resource is defined in `Domain` property of `AWS::Serverless::Api` UsagePlan | `restapi-logical-id`.UsagePlan | `restapi-logical-id`UsagePlan | SAM generates UsagePlan, UsagePlanKey and ApiKey resources when `UsagePlan` property is set. UsagePlan resource can be referenced in intrinsic function using the resource logical id or `restapi-logical-id`.UsagePlan From a9a3678e9ebb84d24202f2ba4c6bab553add36cd Mon Sep 17 00:00:00 2001 From: Keeton Hodgson Date: Thu, 27 Feb 2020 10:52:45 -0800 Subject: [PATCH 5/7] Update 2016-10-31.md --- versions/2016-10-31.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versions/2016-10-31.md b/versions/2016-10-31.md index c52497b79..c3be3bba0 100644 --- a/versions/2016-10-31.md +++ b/versions/2016-10-31.md @@ -1259,7 +1259,7 @@ Destination (for SQS Queue) | `function-logical-id`.DestinationQueue |`function- Property Name | Reference | LogicalId | Description ---|:---:|---|--- -StageName | `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 +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 Deployment | `restapi-logical-id`.Deployment | `restapi-logical-id`Deployment`sha` | SAM generates `AWS::ApiGateway::Deployment` 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`.Deployment DomainName | `restapi-logical-id`.DomainName | `domain-logical-id` | `AWS::ApiGateway::DomainName` resource can be referenced by using the resource logical id or `restapi-logical-id`.DomainName when `DomainName` resource is defined in `Domain` property of `AWS::Serverless::Api` UsagePlan | `restapi-logical-id`.UsagePlan | `restapi-logical-id`UsagePlan | SAM generates UsagePlan, UsagePlanKey and ApiKey resources when `UsagePlan` property is set. UsagePlan resource can be referenced in intrinsic function using the resource logical id or `restapi-logical-id`.UsagePlan @@ -1270,4 +1270,4 @@ ApiKey | `restapi-logical-id`.ApiKey |`restapi-logical-id`ApiKey | SAM generates Property Name | Reference | LogicalId | Description ---|:---:|---|--- -StageName | `httpapi-logical-id`.Stage | `httpapi-logical-id`ApiGatewayDefaultStage or `httpapi-logical-id` `StageName`Stage | SAM generates `AWS::ApiGatewayV2::Stage` resource with `httpapi-logical-id`ApiGatewayDefaultStage logical id if `StageName` property is not defined. If an explicit `StageName` property is defined them SAM generates `AWS::ApiGatewayV2::Stage` resource with `httpapi-logical-id` `StageName`Stage logicalId. This resource can be referenced in intrinsic functions using `httpapi-logical-id`.Stage \ No newline at end of file +Stage | `httpapi-logical-id`.Stage | `httpapi-logical-id`ApiGatewayDefaultStage or `httpapi-logical-id` `StageName`Stage | SAM generates `AWS::ApiGatewayV2::Stage` resource with `httpapi-logical-id`ApiGatewayDefaultStage logical id if `StageName` property is not defined. If an explicit `StageName` property is defined them SAM generates `AWS::ApiGatewayV2::Stage` resource with `httpapi-logical-id` `StageName`Stage logicalId. This resource can be referenced in intrinsic functions using `httpapi-logical-id`.Stage From 4b1afc299bca6fe66cb34516403edefbc79ddb0e Mon Sep 17 00:00:00 2001 From: Shreya Gangishetty Date: Tue, 3 Mar 2020 11:16:06 -0800 Subject: [PATCH 6/7] update domainname for httpapi --- versions/2016-10-31.md | 1 + 1 file changed, 1 insertion(+) diff --git a/versions/2016-10-31.md b/versions/2016-10-31.md index c3be3bba0..d34106a07 100644 --- a/versions/2016-10-31.md +++ b/versions/2016-10-31.md @@ -1271,3 +1271,4 @@ ApiKey | `restapi-logical-id`.ApiKey |`restapi-logical-id`ApiKey | SAM generates Property Name | Reference | LogicalId | Description ---|:---:|---|--- Stage | `httpapi-logical-id`.Stage | `httpapi-logical-id`ApiGatewayDefaultStage or `httpapi-logical-id` `StageName`Stage | SAM generates `AWS::ApiGatewayV2::Stage` resource with `httpapi-logical-id`ApiGatewayDefaultStage logical id if `StageName` property is not defined. If an explicit `StageName` property is defined them SAM generates `AWS::ApiGatewayV2::Stage` resource with `httpapi-logical-id` `StageName`Stage logicalId. This resource can be referenced in intrinsic functions using `httpapi-logical-id`.Stage +DomainName | `httpapi-logical-id`.DomainName | `domain-logical-id` | `AWS::ApiGatewayV2::DomainName` resource can be referenced by using the resource logical id or `restapi-logical-id`.DomainName when `DomainName` resource is defined in `Domain` property of `AWS::Serverless::Api` \ No newline at end of file From b8cc833ce58543e562776085ed02d65e7d592a96 Mon Sep 17 00:00:00 2001 From: Shreya Gangishetty Date: Tue, 3 Mar 2020 14:08:51 -0800 Subject: [PATCH 7/7] fix: cr comments --- versions/2016-10-31.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versions/2016-10-31.md b/versions/2016-10-31.md index ba3bccb45..898b29da2 100644 --- a/versions/2016-10-31.md +++ b/versions/2016-10-31.md @@ -1285,8 +1285,8 @@ Property Name | Reference | LogicalId | Description ---|:---:|---|--- 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 +DestinationTopic | `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 +DestinationQueue | `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 #### Referable properties of Serverless RestApi