Advertisement
Guest User

Untitled

a guest
Dec 27th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 12.91 KB | None | 0 0
  1. AWSTemplateFormatVersion: '2010-09-09'
  2. Transform: AWS::Serverless-2016-10-31
  3. Description: 'Signup'
  4.  
  5. Parameters:
  6.   SalesforceUrl:
  7.     Type: String
  8.   SalesforceUsername:
  9.     Type: String
  10.   SalesforcePassword:
  11.     Type: String
  12.   DocusignIntegratorKey:
  13.     Type: String
  14.   DocusignEmail:
  15.     Type: String
  16.   DocusignUrl:
  17.     Type: String
  18.   DocusignPassword:
  19.     Type: String
  20.  
  21. Resources:
  22.   DocusignPostNotification:
  23.     Properties:
  24.       Description: "Send notifications from Docusign service"
  25.       Environment:
  26.         Variables:
  27.           QuotationTable: SignUpQuotation
  28.           SalesforceUrl: !Ref SalesforceUrl
  29.           SalesforceUsername: !Ref SalesforceUsername
  30.           SalesforcePassword: !Ref SalesforcePassword
  31.       Events:
  32.         DocusignGetNotificationApi:
  33.           Properties:
  34.             Method: get
  35.             Path: /docusign/notification
  36.           Type: Api
  37.         DocusignPostNotificationApi:
  38.           Properties:
  39.             Method: post
  40.             Path: /docusign/notification
  41.           Type: Api
  42.       Handler: Api/docusign-post-notification.handler
  43.       Policies: AmazonDynamoDBFullAccess
  44.       Runtime: nodejs6.10
  45.       Timeout: 5
  46.     Type: "AWS::Serverless::Function"
  47.   SalesforceGetInstall:
  48.     Properties:
  49.       Description: "Get installation informations"
  50.       Environment:
  51.         Variables:
  52.           QuotationTable: SignUpQuotation
  53.           SalesforceUrl: !Ref SalesforceUrl
  54.           SalesforceUsername: !Ref SalesforceUsername
  55.           SalesforcePassword: !Ref SalesforcePassword
  56.       Events:
  57.         SalesforceGetInstallApi:
  58.           Properties:
  59.             Method: get
  60.             Path: /salesforce/install
  61.           Type: Api
  62.       Handler: Api/salesforce-get-install.handler
  63.       Policies: AmazonDynamoDBFullAccess
  64.       Runtime: nodejs6.10
  65.       Timeout: 5
  66.     Type: "AWS::Serverless::Function"
  67.   SalesforceGetOpportunities:
  68.     Properties:
  69.       Description: "Get list of opportunities from Salesforce"
  70.       Environment:
  71.         Variables:
  72.           QuotationTable: SignUpQuotation
  73.           SalesforceUrl: !Ref SalesforceUrl
  74.           SalesforceUsername: !Ref SalesforceUsername
  75.           SalesforcePassword: !Ref SalesforcePassword
  76.       Events:
  77.         SalesforceGetOpportunitiesApi:
  78.           Properties:
  79.             Method: get
  80.             Path: /salesforce/opportunities
  81.           Type: Api
  82.       Handler: Api/salesforce-get-opportunities.handler
  83.       Policies: AmazonDynamoDBFullAccess
  84.       Runtime: nodejs6.10
  85.       Timeout: 5
  86.     Type: "AWS::Serverless::Function"
  87.   SalesforceGetProducts:
  88.     Properties:
  89.       Description: "Get product list from Salesforce"
  90.       Environment:
  91.         Variables:
  92.           QuotationTable: SignUpQuotation
  93.           SalesforceUrl: !Ref SalesforceUrl
  94.           SalesforceUsername: !Ref SalesforceUsername
  95.           SalesforcePassword: !Ref SalesforcePassword
  96.       Events:
  97.         SalesforceGetProductsApi:
  98.           Properties:
  99.             Method: get
  100.             Path: /salesforce/products
  101.           Type: Api
  102.       Handler: Api/salesforce-get-products.handler
  103.       Policies: AmazonDynamoDBFullAccess
  104.       Runtime: nodejs6.10
  105.       Timeout: 5
  106.     Type: "AWS::Serverless::Function"
  107.   SalesforcePostOpportunities:
  108.     Properties:
  109.       Description: "Create an opportunity to Salesforce"
  110.       Environment:
  111.         Variables:
  112.           QuotationTable: SignUpQuotation
  113.           SalesforceUrl: !Ref SalesforceUrl
  114.           SalesforceUsername: !Ref SalesforceUsername
  115.           SalesforcePassword: !Ref SalesforcePassword
  116.       Events:
  117.         SalesforcePostOpportunitiesApi:
  118.           Properties:
  119.             Method: post
  120.             Path: /salesforce/opportunities
  121.           Type: Api
  122.       Handler: Api/salesforce-post-opportunities.handler
  123.       Policies: AmazonDynamoDBFullAccess
  124.       Runtime: nodejs6.10
  125.       Timeout: 5
  126.     Type: "AWS::Serverless::Function"
  127.   SalesforcePostShippingAdress:
  128.     Properties:
  129.       Description: "Create shipping address on salesforce"
  130.       Environment:
  131.         Variables:
  132.           QuotationTable: SignUpQuotation
  133.           SalesforceUrl: !Ref SalesforceUrl
  134.           SalesforceUsername: !Ref SalesforceUsername
  135.           SalesforcePassword: !Ref SalesforcePassword
  136.       Events:
  137.         SalesforcePostShippingAdressApi:
  138.           Properties:
  139.             Method: post
  140.             Path: /salesforce/shippingaddress
  141.           Type: Api
  142.       Handler: Api/salesforce-post-shipping-adress.handler
  143.       Policies: AmazonDynamoDBFullAccess
  144.       Runtime: nodejs6.10
  145.       Timeout: 5
  146.     Type: "AWS::Serverless::Function"
  147.   SalesforcePutInstall:
  148.     Properties:
  149.       Description: "Update install details"
  150.       Environment:
  151.         Variables:
  152.           QuotationTable: SignUpQuotation
  153.           SalesforceUrl: !Ref SalesforceUrl
  154.           SalesforceUsername: !Ref SalesforceUsername
  155.           SalesforcePassword: !Ref SalesforcePassword
  156.       Events:
  157.         SalesforcePutInstallApi:
  158.           Properties:
  159.             Method: put
  160.             Path: /salesforce/install
  161.           Type: Api
  162.       Handler: Api/salesforce-put-install.handler
  163.       Policies: AmazonDynamoDBFullAccess
  164.       Runtime: nodejs6.10
  165.       Timeout: 5
  166.     Type: "AWS::Serverless::Function"
  167.   SignupGetOpportunity:
  168.     Properties:
  169.       Description: "Get a single opportunity from Salesforce"
  170.       Environment:
  171.         Variables:
  172.           QuotationTable: SignUpQuotation
  173.           SalesforceUrl: !Ref SalesforceUrl
  174.           SalesforceUsername: !Ref SalesforceUsername
  175.           SalesforcePassword: !Ref SalesforcePassword
  176.       Events:
  177.         SalesforceGetOpportunityApi:
  178.           Type: Api
  179.           Properties:
  180.             Method: get
  181.             Path: /salesforce/opportunity
  182.       Handler: Api/signup-get-opportunity.handler
  183.       Policies: AmazonDynamoDBFullAccess
  184.       Runtime: nodejs6.10
  185.       Timeout: 5
  186.     Type: "AWS::Serverless::Function"
  187.   SignupGetQuotation:
  188.     Properties:
  189.       Description: "Get existing quotation from Salesforce"
  190.       Environment:
  191.         Variables:
  192.           QuotationTable: SignUpQuotation
  193.           SalesforceUrl: !Ref SalesforceUrl
  194.           SalesforceUsername: !Ref SalesforceUsername
  195.           SalesforcePassword: !Ref SalesforcePassword
  196.       Events:
  197.         SignupGetQuotationApi:
  198.           Properties:
  199.             Method: get
  200.             Path: /salesforce/quotation
  201.           Type: Api
  202.         SignupGetQuotationByOpportunityApi:
  203.           Properties:
  204.             Method: get
  205.             Path: /salesforce/quotation/by-opportunity
  206.           Type: Api
  207.       Handler: Api/signup-get-quotation.handler
  208.       Policies: AmazonDynamoDBFullAccess
  209.       Runtime: nodejs6.10
  210.       Timeout: 5
  211.     Type: "AWS::Serverless::Function"
  212.   SignupPostQuotation:
  213.     Properties:
  214.       Description: "Post quotation to Salesforce"
  215.       Environment:
  216.         Variables:
  217.           QuotationTable: SignUpQuotation
  218.           SalesforceUrl: !Ref SalesforceUrl
  219.           SalesforceUsername: !Ref SalesforceUsername
  220.           SalesforcePassword: !Ref SalesforcePassword
  221.           DocusignIntegratorKey: !Ref DocusignIntagratorKey
  222.           DocusignEmail: !Ref DocusignEmail
  223.           DocusignUrl: !Ref DocusignUrl
  224.           DocusignPassword: !Ref DocusignPassword
  225.       Events:
  226.         SignupPostQuotationApi:
  227.           Properties:
  228.             Method: post
  229.             Path: /salesforce/quotation
  230.           Type: Api
  231.       Handler: Api/signup-quotation.handler
  232.       Policies: AmazonDynamoDBFullAccess
  233.       Runtime: nodejs6.10
  234.       Timeout: 180
  235.     Type: "AWS::Serverless::Function"
  236.   SignupPostPayments:
  237.     Properties:
  238.       Description: "Post payments to Salesforce"
  239.       Environment:
  240.         Variables:
  241.           QuotationTable: SignUpQuotation
  242.           SalesforceUrl: !Ref SalesforceUrl
  243.           SalesforceUsername: !Ref SalesforceUsername
  244.           SalesforcePassword: !Ref SalesforcePassword
  245.       Events:
  246.         SignupPostPaymentsApi:
  247.           Properties:
  248.             Method: post
  249.             Path: /salesforce/payments
  250.           Type: Api
  251.       Handler: Api/signup-post-payments.handler
  252.       Policies: AmazonDynamoDBFullAccess
  253.       Runtime: nodejs6.10
  254.       Timeout: 5
  255.     Type: "AWS::Serverless::Function"
  256.   SlimpayGetPayment:
  257.     Properties:
  258.       Description: "Retrieve payment from Salesforce"
  259.       Environment:
  260.         Variables:
  261.           QuotationTable: SignUpQuotation
  262.           SalesforceUrl: !Ref SalesforceUrl
  263.           SalesforceUsername: !Ref SalesforceUsername
  264.           SalesforcePassword: !Ref SalesforcePassword
  265.       Events:
  266.         SlimpayGetPaymentApi:
  267.           Properties:
  268.             Method: get
  269.             Path: /salesforce/payment
  270.           Type: Api
  271.       Handler: Api/slimpay-get-payment.handler
  272.       Policies: AmazonDynamoDBFullAccess
  273.       Runtime: nodejs6.10
  274.       Timeout: 5
  275.     Type: "AWS::Serverless::Function"
  276.   SlimpayGetPaymentNotification:
  277.     Properties:
  278.       Description: "Get notification for payment status"
  279.       Environment:
  280.         Variables:
  281.           QuotationTable: SignUpQuotation
  282.           SalesforceUrl: !Ref SalesforceUrl
  283.           SalesforceUsername: !Ref SalesforceUsername
  284.           SalesforcePassword: !Ref SalesforcePassword
  285.       Events:
  286.         SlimpayGetPaymentNotificationApi:
  287.           Properties:
  288.             Method: get
  289.             Path: /salesforce/payment/notification
  290.           Type: Api
  291.         SlimpayPostPaymentNotificationApi:
  292.           Properties:
  293.             Method: post
  294.             Path: /salesforce/payment/notification
  295.           Type: Api
  296.       Handler: Api/slimpay-get-payment-notification.handler
  297.       Policies: AmazonDynamoDBFullAccess
  298.       Runtime: nodejs6.10
  299.       Timeout: 5
  300.     Type: "AWS::Serverless::Function"
  301.   SlimpayGetSepa:
  302.     Properties:
  303.       Description: "Get Sepa from Slimpay service"
  304.       Environment:
  305.         Variables:
  306.           QuotationTable: SignUpQuotation
  307.           SalesforceUrl: !Ref SalesforceUrl
  308.           SalesforceUsername: !Ref SalesforceUsername
  309.           SalesforcePassword: !Ref SalesforcePassword
  310.       Events:
  311.         SlimpayGetSepaApi:
  312.           Properties:
  313.             Method: get
  314.             Path: /salesforce/sepa
  315.           Type: Api
  316.       Handler: Api/slimpay-get-sepa.handler
  317.       Policies: AmazonDynamoDBFullAccess
  318.       Runtime: nodejs6.10
  319.       Timeout: 5
  320.     Type: "AWS::Serverless::Function"
  321.  
  322.   #CORS
  323.   CORSFunction:
  324.     Type: "AWS::Serverless::Function"
  325.     Properties:
  326.       Description: "Allow CORS"
  327.       Events:
  328.         SalesforceGetOpportunitiesCORSApi:
  329.           Type: Api
  330.           Properties:
  331.             Method: options
  332.             Path: /salesforce/opportunities
  333.         SalesforcePutInstallCORSApi:
  334.           Type: Api
  335.           Properties:
  336.             Method: options
  337.             Path: /salesforce/install
  338.         SignupPostQuotationCORSApi:
  339.           Type: Api
  340.           Properties:
  341.             Method: options
  342.             Path: /salesforce/quotation
  343.         SignupPostPaymentsCORSApi:
  344.           Type: Api
  345.           Properties:
  346.             Method: options
  347.             Path: /salesforce/payments
  348.       Handler: Api/cors.handler
  349.       Runtime: nodejs6.10
  350.       Timeout: 3
  351.  
  352.   SignUpQuotation:
  353.     Type: AWS::DynamoDB::Table
  354.     Properties:
  355.       AttributeDefinitions:
  356.         - AttributeName: QuotationID
  357.           AttributeType: S
  358.         - AttributeName: SlimpaySepaID
  359.           AttributeType: S
  360.         - AttributeName: SlimpayID
  361.           AttributeType: S
  362.         - AttributeName: EnvelopeID
  363.           AttributeType: S
  364.         - AttributeName: OpportunityID
  365.           AttributeType: S
  366.       KeySchema:
  367.         - AttributeName: QuotationID
  368.           KeyType: HASH
  369.       ProvisionedThroughput:
  370.         ReadCapacityUnits: 5
  371.         WriteCapacityUnits: 5
  372.       GlobalSecondaryIndexes:
  373.         - IndexName: "SlimpaySepaID"
  374.           KeySchema:
  375.             - AttributeName: "SlimpaySepaID"
  376.               KeyType: "HASH"
  377.           ProvisionedThroughput:
  378.             ReadCapacityUnits: 2
  379.             WriteCapacityUnits: 5
  380.           Projection:
  381.             ProjectionType: "ALL"
  382.         - IndexName: "SlimpayID"
  383.           KeySchema:
  384.             - AttributeName: "SlimpayID"
  385.               KeyType: "HASH"
  386.           ProvisionedThroughput:
  387.             ReadCapacityUnits: 2
  388.             WriteCapacityUnits: 5
  389.           Projection:
  390.             ProjectionType: "ALL"
  391.         - IndexName: "EnvelopeID"
  392.           KeySchema:
  393.             - AttributeName: "EnvelopeID"
  394.               KeyType: "HASH"
  395.           ProvisionedThroughput:
  396.             ReadCapacityUnits: 2
  397.             WriteCapacityUnits: 5
  398.           Projection:
  399.             ProjectionType: "ALL"
  400.         - IndexName: "OpportunityID"
  401.           KeySchema:
  402.             - AttributeName: "OpportunityID"
  403.               KeyType: "HASH"
  404.           ProvisionedThroughput:
  405.             ReadCapacityUnits: 2
  406.             WriteCapacityUnits: 5
  407.           Projection:
  408.             ProjectionType: "ALL"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement