Class: Jets::CLI::Concurrency::Unset

Inherits:
Set
  • Object
show all
Defined in:
lib/jets/cli/concurrency/unset.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Set

#set_provisioned_concurrency

Methods inherited from Get

#initialize, #provisioned_concurrency, #reserved_concurrency

Methods inherited from Base

#initialize, #paginate, #paging_params, rescue_api_error

Methods included from Util::Logging

#log

Methods included from AwsServices

#apigateway, #aws_options, #cfn, #codebuild, #dynamodb, #lambda_client, #logs, #s3, #s3_resource, #sns, #sqs, #ssm, #sts, #wafv2

Methods included from AwsServices::StackStatus

#output_value, #stack_exists?

Methods included from AwsServices::GlobalMemoist

included, #reset_cache!

Methods included from Api

#api, #api_key

Constructor Details

This class inherits a constructor from Jets::CLI::Concurrency::Get

Instance Method Details

#runObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/jets/cli/concurrency/unset.rb', line 3

def run
  sure? "Will unset the concurrency settings for #{@lambda_function.name}"
  puts "Unsetting concurrency settings for #{@lambda_function.name}"

  if @options[:reserved]
    @lambda_function.reserved_concurrency = nil
    puts "Removed reserved concurrency"
    puts "Will scale to your AWS account unreserved limit. Currently: #{.unreserved_concurrent_executions}"
  end

  if @options[:provisioned]
    success = set_provisioned_concurrency(0)
    puts "Removed provisioned concurrency" if success
  end

  Jets::CLI::Tip.show(:concurrency_change)
end