Open clethrill opened 5 years ago
@HyperBrain Is my set up correct or is this an issue with serverless-aws-alias?
All the resources must be unique per stage/alias. As I can see, you've already deployed the main stage with sls deploy
or sls deploy --stage your-stage
, so that you have created all the resources and now you cannot deploy the copies.
Try to create unique names like:
Resources:
ApiGatewayAuthorizer${stage}${alias}:
...
CognitoUserPool${stage}${alias}:
As I remember, variables are not supported for Resources, so you can try serverless-plugin-ifelse
plugin.
I have a serverless.yml that looks like
cognito-resource.yml looks like
and when I run
sls deploy --alias my_name
I get the error:An error occurred: ApiGatewayAuthorizermy_name - Authorizer name must be unique. Authorizer cognito-authorizer already exists in this RestApi. (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException; Request ID: 79c6f96b-855e-44d1-8e96-3862bc3577bf).