Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

sls remove deletes BasePathMapping of a serverless stage different from the one specified in config #251

Closed
pramttl opened this issue Sep 24, 2019 · 1 comment 路 Fixed by #620

Comments

@pramttl
Copy link

pramttl commented Sep 24, 2019

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Bug Report

Running sls remove on one serverless stage seems to affect the BasePathMappings of another stage even if stage is specified in the customDomain config.

Example:
sls remove --stage <xyz> where != prod also affects/changes the BasePathMapping on --stage prod

Command Run
sls remove --stage staging

Domain Manager Configuration

custom:
  customDomain:
    domainName: prod.redacted.com
    basePath: ''
    stage: prod
    certificateName: "*.redacted.com"
    createRoute53Record: true

Outcome

Cloudtrail log during sls remove --stage staging run, suggestsDeleteBasePathMapping action was performed by sls remove, unfortunately didn't get a hold of the output and am unable to run the command again to avoid potential production issues.

{
   "eventVersion": "1.05",
   "userIdentity": {
       "type": "AssumedRole",
       "principalId": "<REDACTED>",
       "arn": "arn:aws:sts::<REDACTED>:assumed-role/DeployAdmin/<REDACTED>",
       "accountId": "<REDACTED>",
       "accessKeyId": "<REDACTED>",
       "sessionContext": {
           "sessionIssuer": {
               "type": "Role",
               "principalId": "<REDACTED>",
               "arn": "arn:aws:iam::<REDACTED>:role/DeployAdmin",
               "accountId": "<REDACTED>",
               "userName": "ServerlessAdmin"
           },
           "webIdFederationData": {},
           "attributes": {
               "mfaAuthenticated": "true",
               "creationDate": "2019-09-24T17:20:17Z"
           }
       }
   },
   "eventTime": "2019-09-24T17:48:15Z",
   "eventSource": "apigateway.amazonaws.com",
   "eventName": "DeleteBasePathMapping",
   "awsRegion": "us-east-1",
   "sourceIPAddress": "<REDACTED>,
   "userAgent": "aws-sdk-nodejs/2.531.0 darwin/v10.16.3 promise",
   "requestParameters": {
       "domainName": "prod.redacted.com",
       "basePath": "(none)",
       "template": false
   },
   "responseElements": null,
   "requestID": "<REDACTED>",
   "eventID": "<REDACTED>,
   "readOnly": false,
   "eventType": "AwsApiCall",
   "recipientAccountId": "<REDACTED>"
}

Versions

  • Domain Manager version(s): v3.3.0
  • Node/npm version: [e.g. Node 10.16.3/npm 6.9.0]
  • Serverless Version: 1.52.x
  • Lambda Code [e.g. Javascript, Python, Java]

Possible (Temporary) Solution

Running sls deploy --stage staging again fixed the issue (re generated the missing BasePathMapping for --stage prod). However, this is not an ideal solution because ideally deploy/remove on a non prod stage/stack, should not affect prod stack.

@pramttl pramttl added the bug label Sep 24, 2019
@CoolersCoder
Copy link

Face the same issue, when we run sls remove -s dev, it will ask your remove all mapping for the domain. we suppose to remove the mapping which we create before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants