Skip to content

Getting TemplateURL must be a supported URL while doing "sls deploy --stage dev" in mac #237

@prasaddls

Description

@prasaddls

Here is my serverless.yml

service: sample-service

configValidationMode: error

custom:
  localstack:
    stages:
      - ${sls:stage}
    host: http://localhost
    edgePort: 4566 
    autostart: true 
    debug: true
    lambda:
      mountCode: True
  CRUD_TOPIC: '${self:service}-${sls:stage}-CRUD'
  MEDICAL_LICENSE_SERVICE_TOPIC_ARN:
    Fn::ImportValue: 'medical-license-service-${sls:stage}-TopicArn'
  DYNAMO_ERROR_TOPIC: '${self:service}-${sls:stage}-DYNAMO_ERROR'
  SNS_DLQ:
    Fn::ImportValue: 'shared-infrastructure-${sls:stage}-SNSDLQArn'
  SQS_DLQ:
    Fn::ImportValue: 'shared-infrastructure-${sls:stage}-SQSDLQArn'
  MQ_MASTER_KEY:
    Fn::ImportValue: 'shared-infrastructure-${sls:stage}-MQMasterKeyAlias'
  MQ_MASTER_KEY_ARN:
    Fn::ImportValue: 'shared-infrastructure-${sls:stage}-MQMasterKeyArn'
  deployBot: ${file(../../sharedConfig.yml):deployBot}

provider:
  name: aws
  runtime: go1.x
  region: us-east-1  # or your preferred region
  profile: sample_${sls:stage}
  versionFunctions: true
  memorySize: 1792
  tracing:
    lambda: true
  environment:
    AWS_NODEJS_CONNECTION_REUSE_ENABLED: 1
    CRUD_TOPIC_ARN:
      Ref: CrudSNSTopic
    DYNAMO_ERROR_TOPIC_ARN:
      Ref: DynamoErrorSNSTopic
    DYNAMODB_TABLE: ${self:service}-${sls:stage}
    FORCE_DYNAMO_INGESTION_ERROR: 'false' # force dynamo ingestion errors to test DLQ
    NODE_OPTIONS: --enable-source-maps
    SERVICE: ${self:service}
    STAGE: ${sls:stage}
    CUSTOM_HOST: http://localhost:4566

package:
  individually: true
  exclude:
    - ./**

functions:
  createEmployee:
    handler: bin/createEmployee
    timeout: 900
    package:
      include:
        - ./bin/createEmployee
  enrollEmployeeInJET:
    handler: bin/enrollEmployeeinJET
    timeout: 900
    package:
      include:
        - ./bin/enrollEmployeenJET
  getOneEmployee:
    handler: bin/getOneEmployee
    timeout: 900
    package:
      include:
        - ./bin/getOneEmployee
  getEmployeesByAddress:
    handler: bin/getEmployeeByAddress
    timeout: 900
    package:
      include:
        - ./bin/getEmployeeByAddress
  getEmployeesByGroup:
    handler: bin/getEmployeesByGroup
    timeout: 900
    package:
      include:
        - ./bin/getEmployeesByGroup
  
resources:
  Resources:
    DynamoDbTable:
      Type: 'AWS::DynamoDB::Table'
      DeletionPolicy: ${file(../../sharedConfig.yml):dbDeletionPolicy.${sls:stage}}
      Properties:
        AttributeDefinitions:
          - AttributeName: PartitionKey
            AttributeType: S
          - AttributeName: SortKey
            AttributeType: S
          - AttributeName: PSI2_Partition
            AttributeType: S
          - AttributeName: PSI2_Sort
            AttributeType: S
          - AttributeName: PSI3_Partition
            AttributeType: S
          - AttributeName: PSI3_Sort
            AttributeType: S
          - AttributeName: PSI4_Partition
            AttributeType: S
          - AttributeName: PSI4_Sort
            AttributeType: S
        BillingMode: PAY_PER_REQUEST
        KeySchema:
          - AttributeName: PartitionKey
            KeyType: HASH
          - AttributeName: SortKey
            KeyType: RANGE
        PointInTimeRecoverySpecification:
          PointInTimeRecoveryEnabled: ${file(../../sharedConfig.yml):dbPointInTimeRecoveryEnabled.${sls:stage}}
        SSESpecification:
          SSEEnabled: true
        StreamSpecification:
          StreamViewType: NEW_AND_OLD_IMAGES
        TableName: ${self:provider.environment.DYNAMODB_TABLE}
        TimeToLiveSpecification:
          AttributeName: ttl
          Enabled: true
        GlobalSecondaryIndexes:
          - IndexName: PSi1
            KeySchema:
              - AttributeName: SortKey
                KeyType: HASH
              - AttributeName: PartitionKey
                KeyType: RANGE
            Projection:
              ProjectionType: ALL
          - IndexName: PSi2
            KeySchema:
              - AttributeName: PSI2_Partition
                KeyType: HASH
              - AttributeName: PSI2_Sort
                KeyType: RANGE
            Projection:
              ProjectionType: ALL
          - IndexName: PSi3
            KeySchema:
              - AttributeName: PSI3_Partition
                KeyType: HASH
              - AttributeName: PSI3_Sort
                KeyType: RANGE
            Projection:
              ProjectionType: ALL
          - IndexName: PSi4
            KeySchema:
              - AttributeName: PSI4_Partition
                KeyType: HASH
              - AttributeName: PSI4_Sort
                KeyType: RANGE
            Projection:
              ProjectionType: ALL
    CrudSNSTopic:
      Type: 'AWS::SNS::Topic'
      Properties:
        DisplayName: ${self:custom.CRUD_TOPIC}
        KmsMasterKeyId: '${self:custom.MQ_MASTER_KEY}'
        TopicName: ${self:custom.CRUD_TOPIC}
    DynamoErrorSNSTopic:
      Type: 'AWS::SNS::Topic'
      Properties:
        DisplayName: ${self:custom.DYNAMO_ERROR_TOPIC}
        KmsMasterKeyId: '${self:custom.MQ_MASTER_KEY}'
        TopicName: ${self:custom.DYNAMO_ERROR_TOPIC}

  Outputs:
    EmployeeServiceCRUDTopic:
      Description: 'CRUD SNS Topic Arn'
      Export:
        Name: '${self:service}-${sls:stage}-CRUDTopicArn'
      Value:
        Ref: CrudSNSTopic

plugins:
  - serverless-localstack

I am getting the following error while trying to deploy: [ I am using docker compose and localstack as well]

Using custom endpoint for Lambda: http://localhost:4566/
Skipping reconfiguring of endpoints (already reconfigured)
Using custom endpoint for Lambda: http://localhost:4566/
Skipping reconfiguring of endpoints (already reconfigured)
Using custom endpoint for Lambda: http://localhost:4566/
Skipping reconfiguring of endpoints (already reconfigured)
Using custom endpoint for Lambda: http://localhost:4566/
Skipping reconfiguring of endpoints (already reconfigured)
Using custom endpoint for Lambda: http://localhost:4566/
Skipping reconfiguring of endpoints (already reconfigured)
Using custom endpoint for Lambda: http://localhost:4566/
Skipping reconfiguring of endpoints (already reconfigured)
Using custom endpoint for S3: http://localhost:4566/
Skipping reconfiguring of endpoints (already reconfigured)
Using custom endpoint for S3: http://localhost:4566/
Skipping reconfiguring of endpoints (already reconfigured)
Using custom endpoint for S3: http://localhost:4566/
Skipping reconfiguring of endpoints (already reconfigured)
Skipping template validation: Unsupported in Localstack
Using custom endpoint for CloudFormation: http://localhost:4566/
Skipping reconfiguring of endpoints (already reconfigured)
Using custom endpoint for CloudFormation: http://localhost:4566/
Overriding S3 templateUrl to http://localhost:4566/
Skipping reconfiguring of endpoints (already reconfigured)

✖ Stack Employee-service-dev failed to deploy (10s)
Environment: darwin, node 16.20.2, framework 3.27.0 (local) 3.38.0v (global), plugin 6.2.3, SDK 4.3.2
Credentials: Local, environment variables
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
TemplateURL must be a supported URL.

1 deprecation found: run 'serverless doctor' for more details 

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions