Skip to content

Commit

Permalink
Update marketplace integration
Browse files Browse the repository at this point in the history
The changes to move to SAM broke the marketplace integration. This
commit should fix them by making the marketplace SNS topic available in
the config object. Also includes some housecleaning (removing unecessary
bits of package.json, cleaning up README markdown syntax).
  • Loading branch information
echo-bravo-yahoo authored and MynockSpit committed Oct 16, 2018
1 parent 92539b4 commit 406f84d
Show file tree
Hide file tree
Showing 6 changed files with 626 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -101,13 +101,13 @@ Deleting developer portal should be as easy as deleting the cloudformation stack

**NOTE**: These instructions are now out of date!

You can sell your SaaS product through [AWS Marketplace] (https://aws.amazon.com/marketplace/management/tour/) and have the developer portal manage the subscription/unsubscription workflows. API Gateway will automatically provide authorization and metering for your product and subscribers will be automatically billed through AWS Marketplace.
You can sell your SaaS product through [AWS Marketplace](https://aws.amazon.com/marketplace/management/tour/) and have the developer portal manage the subscription/unsubscription workflows. API Gateway will automatically provide authorization and metering for your product and subscribers will be automatically billed through AWS Marketplace.

Overview:

1) Create a Usage Plan in API Gateway

2) Create a SaaS Product in [AWS Marketplace] (https://aws.amazon.com/marketplace/management/tour/):
2) Create a SaaS Product in [AWS Marketplace](https://aws.amazon.com/marketplace/management/tour/):

The redirect URL should be in the format:
https://YOUR_DEVELOPER_PORTAL_API_ID.execute-api.[REGION].amazonaws.com/prod/marketplace-confirm/[USAGE_PLAN_ID]
Expand Down
7 changes: 4 additions & 3 deletions cloudformation/template.yaml
Expand Up @@ -24,9 +24,9 @@ Parameters:
Description: Provide a token different from the last deployment's token to re-upload the dev portal site's static assets. You can provide a timestamp or GUID on each deployment to always re-upload the assets.
Default: defaultRebuildToken

MarketplaceSubscriptionTopicName:
MarketplaceSubscriptionTopicProductCode:
Type: String
Description: The marketplace SNS topic for subscription/unsubscription events
Description: The marketplace SNS topic suffix for subscription/unsubscription events
Default: "DevPortalMarketplaceSubscriptionTopic"

CognitoIdentityPoolName:
Expand Down Expand Up @@ -526,7 +526,7 @@ Resources:
SourceArn: !Join
- ''
- - 'arn:aws:sns:us-east-1:287250355862:aws-mp-subscription-notification-'
- !Ref MarketplaceSubscriptionTopicName
- !Ref MarketplaceSubscriptionTopicProductCode

LambdaSNSExecutionTestPermission:
Type: AWS::Lambda::Permission
Expand Down Expand Up @@ -715,6 +715,7 @@ Resources:
IdentityPoolId: !Ref CognitoIdentityPool
UserPoolId: !Ref CognitoUserPool
UserPoolClientId: !Ref CognitoUserPoolClient
MarketplaceSuffix: !Ref MarketplaceSubscriptionTopicProductCode
RebuildToken: !Ref StaticAssetRebuildToken

Outputs:
Expand Down
230 changes: 230 additions & 0 deletions lambdas/backend/catalog/PestStore-prod-swagger-apigateway.json
@@ -0,0 +1,230 @@
{
"swagger": "2.0",
"info": {
"version": "2018-09-21T22:32:04Z",
"title": "PestStore"
},
"host": "9qfvnvfyz9.execute-api.us-west-2.amazonaws.com",
"basePath": "/prod",
"schemes": [
"https"
],
"paths": {
"/arachnids": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "200 response",
"schema": {
"$ref": "#/definitions/Empty"
}
}
},
"x-amazon-apigateway-integration": {
"responses": {
"default": {
"statusCode": "200"
}
},
"requestTemplates": {
"application/json": "{\"statusCode\": 200}"
},
"passthroughBehavior": "when_no_match",
"type": "mock"
}
}
},
"/bugs/insects": {
"delete": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "200 response",
"schema": {
"$ref": "#/definitions/Empty"
}
}
},
"x-amazon-apigateway-integration": {
"responses": {
"default": {
"statusCode": "200"
}
},
"requestTemplates": {
"application/json": "{\"statusCode\": 200}"
},
"passthroughBehavior": "when_no_match",
"type": "mock"
}
}
},
"/slitherers/snakes": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "200 response",
"schema": {
"$ref": "#/definitions/Empty"
}
}
},
"x-amazon-apigateway-integration": {
"responses": {
"default": {
"statusCode": "200"
}
},
"requestTemplates": {
"application/json": "{\"statusCode\": 200}"
},
"passthroughBehavior": "when_no_match",
"type": "mock"
}
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "200 response",
"schema": {
"$ref": "#/definitions/Empty"
}
}
},
"x-amazon-apigateway-integration": {
"responses": {
"default": {
"statusCode": "200"
}
},
"requestTemplates": {
"application/json": "{\"statusCode\": 200}"
},
"passthroughBehavior": "when_no_match",
"type": "mock"
}
}
},
"/slitherers/worms": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "200 response",
"schema": {
"$ref": "#/definitions/Empty"
}
}
},
"x-amazon-apigateway-integration": {
"responses": {
"default": {
"statusCode": "200"
}
},
"requestTemplates": {
"application/json": "{\"statusCode\": 200}"
},
"passthroughBehavior": "when_no_match",
"type": "mock"
}
},
"head": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "200 response",
"schema": {
"$ref": "#/definitions/Empty"
}
}
},
"x-amazon-apigateway-integration": {
"responses": {
"default": {
"statusCode": "200"
}
},
"requestTemplates": {
"application/json": "{\"statusCode\": 200}"
},
"passthroughBehavior": "when_no_match",
"type": "mock"
}
}
},
"/{proxy+}": {
"x-amazon-apigateway-any-method": {
"produces": [
"application/json"
],
"parameters": [
{
"name": "proxy",
"in": "path",
"required": true,
"type": "string"
}
],
"responses": {},
"x-amazon-apigateway-integration": {
"uri": "https://google.com/{proxy}",
"responses": {
"default": {
"statusCode": "200"
}
},
"requestParameters": {
"integration.request.path.proxy": "method.request.path.proxy"
},
"passthroughBehavior": "when_no_match",
"httpMethod": "ANY",
"cacheNamespace": "t35v6l",
"cacheKeyParameters": [
"method.request.path.proxy"
],
"type": "http_proxy"
}
}
}
},
"definitions": {
"Empty": {
"type": "object",
"title": "Empty Schema"
}
}
}

0 comments on commit 406f84d

Please sign in to comment.