Lab3/server/saas-sam-stack.yaml [1:140]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Simple CRUD web service. State is stored in a DynamoDB table.
Resources:
  ProductGetFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: product-manager.get
      Layers: 
        - !Ref DependencyLayer
      Runtime: nodejs10.x
      Timeout: 5
      Policies: 
        - AmazonDynamoDBReadOnlyAccess
        - AmazonS3FullAccess
      Environment:
        Variables:
          LogsBucketName: !Join ['-', ['serverless-saas-layers-logs-tenant', !Ref "AWS::AccountId"]] 
          MetricsBucketName: !Join ['-', ['serverless-saas-layers-metrics-tenant', !Ref "AWS::AccountId"]] 
      Events:
        GetResource:
          Type: Api
          Properties:
            Path: /product/{resourceId}
            Method: get
  ProductPutFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: product-manager.put
      Layers: 
        - !Ref DependencyLayer
      Runtime: nodejs10.x
      Timeout: 5
      Policies: 
        - AmazonDynamoDBFullAccess
        - AmazonS3FullAccess
      Environment:
        Variables:
          LogsBucketName: !Join ['-', ['serverless-saas-layers-logs-tenant', !Ref "AWS::AccountId"]]  
          MetricsBucketName: !Join ['-', ['serverless-saas-layers-metrics-tenant', !Ref "AWS::AccountId"]] 
      Events:
        PutResource:
          Type: Api
          Properties:
            Path: /product/{resourceId}
            Method: put
  ProductDeleteFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: product-manager.delete
      Layers: 
        - !Ref DependencyLayer
      Runtime: nodejs10.x
      Timeout: 5
      Policies: 
        - AmazonDynamoDBFullAccess
        - AmazonS3FullAccess
      Environment:
        Variables:
          LogsBucketName: !Join ['-', ['serverless-saas-layers-logs-tenant', !Ref "AWS::AccountId"]] 
          MetricsBucketName: !Join ['-', ['serverless-saas-layers-metrics-tenant', !Ref "AWS::AccountId"]] 
      Events:
        DeleteResource:
          Type: Api
          Properties:
            Path: /product/{resourceId}
            Method: delete
  OrderGetFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: order-manager.get
      Layers: 
        - !Ref DependencyLayer
      Runtime: nodejs10.x
      Timeout: 5
      Policies: 
        - AmazonDynamoDBReadOnlyAccess
        - AmazonS3FullAccess
      Environment:
        Variables:
          LogsBucketName: !Join ['-', ['serverless-saas-layers-logs-tenant', !Ref "AWS::AccountId"]] 
          MetricsBucketName: !Join ['-', ['serverless-saas-layers-metrics-tenant', !Ref "AWS::AccountId"]] 
      Events:
        GetResource:
          Type: Api
          Properties:
            Path: /order/{resourceId}
            Method: get
  OrderPutFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: order-manager.put
      Layers: 
        - !Ref DependencyLayer
      Runtime: nodejs10.x
      Timeout: 5
      Policies: 
        - AmazonDynamoDBFullAccess
        - AmazonS3FullAccess
      Environment:
        Variables:
          LogsBucketName: !Join ['-', ['serverless-saas-layers-logs-tenant', !Ref "AWS::AccountId"]] 
          MetricsBucketName: !Join ['-', ['serverless-saas-layers-metrics-tenant', !Ref "AWS::AccountId"]] 
      Events:
        PutResource:
          Type: Api
          Properties:
            Path: /order/{resourceId}
            Method: put
  OrderDeleteFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: order-manager.delete
      Layers: 
        - !Ref DependencyLayer
      Runtime: nodejs10.x
      Timeout: 5
      Policies: 
        - AmazonDynamoDBFullAccess
        - AmazonS3FullAccess
      Environment:
        Variables:
          LogsBucketName: !Join ['-', ['serverless-saas-layers-logs-tenant', !Ref "AWS::AccountId"]] 
          MetricsBucketName: !Join ['-', ['serverless-saas-layers-metrics-tenant', !Ref "AWS::AccountId"]] 
      Events:
        DeleteResource:
          Type: Api
          Properties:
            Path: /order/{resourceId}
            Method: delete
  DependencyLayer:
        Type: AWS::Serverless::LayerVersion
        Properties:
            LayerName: sam-app-dependencies
            Description: Dependencies for centralized services
            ContentUri: layers/
            CompatibleRuntimes:
              - nodejs10.x
            LicenseInfo: 'MIT'
            RetentionPolicy: Retain
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



Solution/Lab3/server/saas-sam-stack.yaml [1:140]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Simple CRUD web service. State is stored in a DynamoDB table.
Resources:
  ProductGetFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: product-manager.get
      Layers: 
        - !Ref DependencyLayer
      Runtime: nodejs10.x
      Timeout: 5
      Policies: 
        - AmazonDynamoDBReadOnlyAccess
        - AmazonS3FullAccess
      Environment:
        Variables:
          LogsBucketName: !Join ['-', ['serverless-saas-layers-logs-tenant', !Ref "AWS::AccountId"]] 
          MetricsBucketName: !Join ['-', ['serverless-saas-layers-metrics-tenant', !Ref "AWS::AccountId"]] 
      Events:
        GetResource:
          Type: Api
          Properties:
            Path: /product/{resourceId}
            Method: get
  ProductPutFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: product-manager.put
      Layers: 
        - !Ref DependencyLayer
      Runtime: nodejs10.x
      Timeout: 5
      Policies: 
        - AmazonDynamoDBFullAccess
        - AmazonS3FullAccess
      Environment:
        Variables:
          LogsBucketName: !Join ['-', ['serverless-saas-layers-logs-tenant', !Ref "AWS::AccountId"]]  
          MetricsBucketName: !Join ['-', ['serverless-saas-layers-metrics-tenant', !Ref "AWS::AccountId"]] 
      Events:
        PutResource:
          Type: Api
          Properties:
            Path: /product/{resourceId}
            Method: put
  ProductDeleteFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: product-manager.delete
      Layers: 
        - !Ref DependencyLayer
      Runtime: nodejs10.x
      Timeout: 5
      Policies: 
        - AmazonDynamoDBFullAccess
        - AmazonS3FullAccess
      Environment:
        Variables:
          LogsBucketName: !Join ['-', ['serverless-saas-layers-logs-tenant', !Ref "AWS::AccountId"]] 
          MetricsBucketName: !Join ['-', ['serverless-saas-layers-metrics-tenant', !Ref "AWS::AccountId"]] 
      Events:
        DeleteResource:
          Type: Api
          Properties:
            Path: /product/{resourceId}
            Method: delete
  OrderGetFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: order-manager.get
      Layers: 
        - !Ref DependencyLayer
      Runtime: nodejs10.x
      Timeout: 5
      Policies: 
        - AmazonDynamoDBReadOnlyAccess
        - AmazonS3FullAccess
      Environment:
        Variables:
          LogsBucketName: !Join ['-', ['serverless-saas-layers-logs-tenant', !Ref "AWS::AccountId"]] 
          MetricsBucketName: !Join ['-', ['serverless-saas-layers-metrics-tenant', !Ref "AWS::AccountId"]] 
      Events:
        GetResource:
          Type: Api
          Properties:
            Path: /order/{resourceId}
            Method: get
  OrderPutFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: order-manager.put
      Layers: 
        - !Ref DependencyLayer
      Runtime: nodejs10.x
      Timeout: 5
      Policies: 
        - AmazonDynamoDBFullAccess
        - AmazonS3FullAccess
      Environment:
        Variables:
          LogsBucketName: !Join ['-', ['serverless-saas-layers-logs-tenant', !Ref "AWS::AccountId"]] 
          MetricsBucketName: !Join ['-', ['serverless-saas-layers-metrics-tenant', !Ref "AWS::AccountId"]] 
      Events:
        PutResource:
          Type: Api
          Properties:
            Path: /order/{resourceId}
            Method: put
  OrderDeleteFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: order-manager.delete
      Layers: 
        - !Ref DependencyLayer
      Runtime: nodejs10.x
      Timeout: 5
      Policies: 
        - AmazonDynamoDBFullAccess
        - AmazonS3FullAccess
      Environment:
        Variables:
          LogsBucketName: !Join ['-', ['serverless-saas-layers-logs-tenant', !Ref "AWS::AccountId"]] 
          MetricsBucketName: !Join ['-', ['serverless-saas-layers-metrics-tenant', !Ref "AWS::AccountId"]] 
      Events:
        DeleteResource:
          Type: Api
          Properties:
            Path: /order/{resourceId}
            Method: delete
  DependencyLayer:
        Type: AWS::Serverless::LayerVersion
        Properties:
            LayerName: sam-app-dependencies
            Description: Dependencies for centralized services
            ContentUri: layers/
            CompatibleRuntimes:
              - nodejs10.x
            LicenseInfo: 'MIT'
            RetentionPolicy: Retain
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



