Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev-portal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dev-portal",
"homepage": "http://YOUR_CLIENT_BUCKET_NAME.s3-website-YOUR_PRIMARY_AWS_REGION.amazonaws.com/",
"homepage": "http://dmc-sun-api-gateway-developer-portal-web.s3-website-ap-southeast-2.amazonaws.com/",
"version": "0.1.0",
"private": true,
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions dev-portal/public/apigateway-js-sdk/apigClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ apigClientFactory.newClient = function (config) {
config.sessionToken = '';
}
if(config.region === undefined) {
config.region = 'YOUR_PRIMARY_AWS_REGION';
config.region = 'ap-southeast-2';
}
//If defaultContentType is not defined then default to application/json
if(config.defaultContentType === undefined) {
Expand All @@ -53,7 +53,7 @@ apigClientFactory.newClient = function (config) {
}

// extract endpoint and path from url
var invokeUrl = 'https://YOUR_API_GATEWAY_API_ID.execute-api.YOUR_PRIMARY_AWS_REGION.amazonaws.com/prod';
var invokeUrl = 'https://j20t6je166.execute-api.ap-southeast-2.amazonaws.com/prod';
var endpoint = /(^https?:\/\/[^\/]+)/g.exec(invokeUrl)[1];
var pathComponent = invokeUrl.substring(endpoint.length);

Expand Down
10 changes: 5 additions & 5 deletions dev-portal/src/services/aws.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import AWS from 'aws-sdk'
export const awsRegion = 'YOUR_PRIMARY_AWS_REGION'
export const cognitoRegion = 'YOUR_COGNITO_REGION'
export const cognitoUserPoolId = 'YOUR_COGNITO_USER_POOL_ID'
export const cognitoIdentityPoolId = 'YOUR_COGNITO_IDENTITY_POOL_ID'
export const cognitoClientId = 'YOUR_COGNITO_CLIENT_ID'
export const awsRegion = 'ap-southeast-2'
export const cognitoRegion = 'ap-southeast-2'
export const cognitoUserPoolId = 'ap-southeast-2_sZtrKeRmm'
export const cognitoIdentityPoolId = 'ap-southeast-2:5601faef-3999-4ded-8371-fd0f3b291a65'
export const cognitoClientId = '5acfm2154151lk01hbn244rdg7'

AWS.config.region = cognitoRegion
12 changes: 6 additions & 6 deletions lambdas/backend/dev-portal-express-proxy-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
swagger: 2.0
info:
version: 2016-09-02T22:37:24Z
title: YOUR_API_GATEWAY_API_NAME
title: Developer Portal
basePath: /prod
schemes:
- https
Expand All @@ -20,7 +20,7 @@ paths:
responses:
default:
statusCode: 200
uri: arn:aws:apigateway:YOUR_PRIMARY_AWS_REGION:lambda:path/2015-03-31/functions/arn:aws:lambda:YOUR_PRIMARY_AWS_REGION:YOUR_ACCOUNT_ID:function:${stageVariables.DevPortalFunctionName}/invocations
uri: arn:aws:apigateway:ap-southeast-2:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-2:637693983280:function:${stageVariables.DevPortalFunctionName}/invocations
passthroughBehavior: when_no_match
httpMethod: POST
type: aws_proxy
Expand Down Expand Up @@ -59,7 +59,7 @@ paths:
- application/json
responses: {}
x-amazon-apigateway-integration:
uri: arn:aws:apigateway:YOUR_PRIMARY_AWS_REGION:lambda:path/2015-03-31/functions/arn:aws:lambda:YOUR_PRIMARY_AWS_REGION:YOUR_ACCOUNT_ID:function:${stageVariables.DevPortalFunctionName}/invocations
uri: arn:aws:apigateway:ap-southeast-2:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-2:637693983280:function:${stageVariables.DevPortalFunctionName}/invocations
httpMethod: POST
type: aws_proxy
options:
Expand Down Expand Up @@ -97,7 +97,7 @@ paths:
- application/json
responses: {}
x-amazon-apigateway-integration:
uri: arn:aws:apigateway:YOUR_PRIMARY_AWS_REGION:lambda:path/2015-03-31/functions/arn:aws:lambda:YOUR_PRIMARY_AWS_REGION:YOUR_ACCOUNT_ID:function:${stageVariables.DevPortalFunctionName}/invocations
uri: arn:aws:apigateway:ap-southeast-2:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-2:637693983280:function:${stageVariables.DevPortalFunctionName}/invocations
httpMethod: POST
type: aws_proxy
options:
Expand Down Expand Up @@ -135,7 +135,7 @@ paths:
- application/json
responses: {}
x-amazon-apigateway-integration:
uri: arn:aws:apigateway:YOUR_PRIMARY_AWS_REGION:lambda:path/2015-03-31/functions/arn:aws:lambda:YOUR_PRIMARY_AWS_REGION:YOUR_ACCOUNT_ID:function:${stageVariables.DevPortalFunctionName}/invocations
uri: arn:aws:apigateway:ap-southeast-2:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-2:637693983280:function:${stageVariables.DevPortalFunctionName}/invocations
httpMethod: POST
type: aws_proxy
options:
Expand Down Expand Up @@ -180,7 +180,7 @@ paths:
type: string
responses: {}
x-amazon-apigateway-integration:
uri: arn:aws:apigateway:YOUR_PRIMARY_AWS_REGION:lambda:path/2015-03-31/functions/arn:aws:lambda:YOUR_PRIMARY_AWS_REGION:YOUR_ACCOUNT_ID:function:${stageVariables.DevPortalFunctionName}/invocations
uri: arn:aws:apigateway:ap-southeast-2:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-2:637693983280:function:${stageVariables.DevPortalFunctionName}/invocations
httpMethod: POST
type: aws_proxy
options:
Expand Down
2 changes: 1 addition & 1 deletion lambdas/backend/express-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const app = express()
const apigateway = new AWS.APIGateway()

// replace these to match your site URL. Note: Use TLS, not plain HTTP, for your production site!
const domain = 'YOUR_CLIENT_BUCKET_NAME.s3-website-YOUR_PRIMARY_AWS_REGION.amazonaws.com'
const domain = 'dmc-sun-api-gateway-developer-portal-web.s3-website-ap-southeast-2.amazonaws.com'
const baseUrl = `http://${domain}/`

app.use(cors())
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"description": "Example application for running a Serverless Developer Portal with API Gateway and Lambda",
"main": "lambda.js",
"config": {
"artifactsS3Bucket": "YOUR_ARTIFACTS_BUCKET_NAME",
"siteS3Bucket": "YOUR_CLIENT_BUCKET_NAME",
"accountId": "YOUR_ACCOUNT_ID",
"primaryAwsRegion": "YOUR_PRIMARY_AWS_REGION",
"cloudFormationStackName": "YOUR_CLOUDFORMATION_STACK_NAME",
"apiGatewayApiName": "YOUR_API_GATEWAY_API_NAME",
"artifactsS3Bucket": "dmc-sun-api-gateway-developer-portal",
"siteS3Bucket": "dmc-sun-api-gateway-developer-portal-web",
"accountId": "637693983280",
"primaryAwsRegion": "ap-southeast-2",
"cloudFormationStackName": "DeveloperPortal",
"apiGatewayApiName": "Developer Portal",
"customersTableName": "DevPortalCustomers",
"identityPoolName": "DevPortal",
"apiGatewayApiId": "YOUR_API_GATEWAY_API_ID",
"cognitoRegion": "YOUR_COGNITO_REGION",
"cognitoUserPoolId": "YOUR_COGNITO_USER_POOL_ID",
"cognitoClientId": "YOUR_COGNITO_CLIENT_ID",
"cognitoIdentityPoolId": "YOUR_COGNITO_IDENTITY_POOL_ID",
"apiGatewayApiId": "j20t6je166",
"cognitoRegion": "ap-southeast-2",
"cognitoUserPoolId": "ap-southeast-2_sZtrKeRmm",
"cognitoClientId": "5acfm2154151lk01hbn244rdg7",
"cognitoIdentityPoolId": "ap-southeast-2:5601faef-3999-4ded-8371-fd0f3b291a65",
"listenerLambdaFunctionName": "DevPortalSubscriptionListener",
"marketplaceSubscriptionTopic": "arn:aws:sns:us-east-1:287250355862:aws-mp-subscription-notification-PRODUCT_CODE"
},
Expand Down