serverless / serverless/serverless

Serverless remove doesn't delete iam role

Open
#7,456 1 comment 0 reactions 1 assignee View on GitHub

@yerida is already working on this.

Since Mar 19, 2020.

question
Dominant language
JavaScript
Stars
46.9k
Forks
5.7k
Avg merge
10h 7m
Merged PRs (30d)
57

Description

Bug Report

Description

I deploy a simple API via serverless with a custom log in serverless.yml. When I use 'serverless remove' to remove the API, I find the IAM role is not deleted. Not sure it is designed as expacted.
serverless version 1.6X

  1. What did you do?
  2. What happened?
    When I run 'serverless remove' successfully, I still can find an IAM role from AWS console 'arn:aws:iam::XXX:role/serverlesstest-hello-dev-us-east-1-apiGatewayLogsRole',
  3. What should've happened?
    The IAM role is not deleted.
  4. What's the content of your serverless.yml file?
service: serverlesstest-hello

provider:
  name: aws
  runtime: nodejs10.x
  region: us-east-1
  stage: dev
  timeout: 30
  logs:
    restApi:
      format: '{"request_id":"$context.requestId","@env":"$context.stage","@gateway_id":"$context.apiId","method":"$context.httpMethod","path":"$context.resourcePath","api_key_id":"$context.identity.apiKeyId","status":"$context.status","xray_id":"$context.xrayTraceId","full_path":"$context.path","principal_id":"$context.authorizer.principalId","extended_request_id":"$context.extendedRequestId","caller":"$context.identity.caller","source_ip":"$context.identity.sourceIp","user":"$context.identity.user","user_agent":"$context.identity.userAgent","aws_endpoint_request_id":"$context.awsEndpointRequestId","resource_id":"$context.resourceId","request_time":"$context.requestTime","request_time_epoch":"$context.requestTimeEpoch","domain_name":"$context.domainName","authorizer_integration_latency":"$context.authorizer.integrationLatency","integration_latency":"$context.integrationLatency","integration_status":"$context.integrationStatus","response_latency":"$context.responseLatency","response_length":"$context.responseLength","error_message":"$context.error.message","error_response_type":"$context.error.responseType","error_validation_error":"$context.error.validationErrorString"}'
      level: INFO

functions:
  helloWorld:
    handler: handler.helloWorld
    events:
      - http:
          path: hello-world
          method: get
          cors: true
  1. What's the output you get when you use the SLS_DEBUG=* environment variable (e.g. SLS_DEBUG=* serverless deploy)

Similar or dependent issues:

  • #12345

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.