{"size": 1478, "ext": "js", "max_stars_repo_path": "sharing-service/sls-resources.yml.js", "max_stars_repo_name": "lmammino/slic-starter", "max_stars_repo_stars_event_min_datetime": "2020-01-29T19:31:56.000Z", "max_stars_repo_stars_event_max_datetime": "2020-01-29T19:31:56.000Z", "max_issues_repo_path": "sharing-service/sls-resources.yml.js", "max_issues_repo_name": "lmammino/slic-starter", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "sharing-service/sls-resources.yml.js", "max_forks_repo_name": "lmammino/slic-starter", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.9803921569, "max_line_length": 131, "alphanum_fraction": 0.7036535859}
'use strict'
module.exports = () =>
  require('yamljs').parse(`
cognitoAuthorizer:
  Type: AWS::ApiGateway::Authorizer
  Properties:
    IdentitySource: method.request.header.Authorization
    Name: slic-user-pool-authorizer-sharing-service
    RestApiId:
      Ref: ApiGatewayRestApi
    Type: COGNITO_USER_POOLS
    ProviderARNs:
      - $\{ssm:/$\{self:provider.stage}/user-service/user-pool-arn}

# The service's generated API Gateway URL is only used when no domain is defined
sharingServiceUrlParameter:
  Type: AWS::SSM::Parameter
  Properties:
    Name: /$\{self:provider.stage}/sharing-service/url
    Type: String
    Value: 
      Fn::Join:
        - ''
        - ['https://', {'Ref': 'ApiGatewayRestApi'}, '.execute-api.$\{self:provider.region}.amazonaws.com/$\{self:provider.stage}']
${
  process.env.SLIC_NS_DOMAIN
    ? `
# Workaround for "Invalid stage identifier specified"
# See https://github.com/serverless/serverless/issues/4029
resApiGatewayDeployment:
  Type: AWS::ApiGateway::Deployment
  DependsOn: ApiGatewayMethodPost
  Properties:
    StageName: $\{self:provider.stage}
    RestApiId:
      Ref: ApiGatewayRestApi

apiCustomDomainPathMappings:
  Type: AWS::ApiGateway::BasePathMapping
  Properties:
    BasePath: 'share'
    RestApiId:
      Ref: ApiGatewayRestApi
    DomainName: api.$\{self:custom.domainPrefixes.$\{self:provider.stage}}$\{env:SLIC_NS_DOMAIN}
    Stage: $\{self:provider.stage}
  DependsOn: resApiGatewayDeployment

`
    : ''
}`)
