Module: Ufo::AwsServices
- Extended by:
- Memoist
- Includes:
- Concerns
- Included in:
- Ecr::Auth, Ecr::Cleaner, CLI::Base, CLI::Ps, Cfn::Base, Cfn::Stack::Builder::Resources::TaskDefinition::Reconstructor, Cfn::Stack::Status, Docker::State::S3, Info, LogGroup, S3::AwsSetup, S3::Bucket, S3::Bucket, S3::Rollback, TaskDefinition::Helpers::Ssm::Fetcher, TaskDefinition::Helpers::StackOutput, TaskDefinition::Helpers::Vpc
- Defined in:
- lib/ufo/aws_services.rb,
lib/ufo/aws_services/concerns.rb
Defined Under Namespace
Modules: Concerns
Instance Method Summary collapse
- #acm ⇒ Object
- #applicationautoscaling ⇒ Object
-
#aws_options ⇒ Object
Override the AWS retry settings with AWS clients.
- #cfn ⇒ Object
- #cloudwatchlogs ⇒ Object
- #ec2 ⇒ Object
- #ecr ⇒ Object
- #ecs ⇒ Object
- #elb ⇒ Object
- #s3 ⇒ Object
-
#ssm_client ⇒ Object
ssm is a helper method.
-
#waf_client ⇒ Object
waf is a helper method.
Methods included from Concerns
#find_stack, #find_stack_resources, #stack_resources, #status, #task_definition_arns
Instance Method Details
#acm ⇒ Object
20 21 22 |
# File 'lib/ufo/aws_services.rb', line 20 def acm Aws::ACM::Client.new() end |
#applicationautoscaling ⇒ Object
25 26 27 |
# File 'lib/ufo/aws_services.rb', line 25 def applicationautoscaling Aws::ApplicationAutoScaling::Client.new() end |
#aws_options ⇒ Object
Override the AWS retry settings with AWS clients.
The aws-sdk-core has exponential backup with this formula:
2 ** c.retries * c.config.retry_base_delay
Source:
https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb
So the max delay will be 2 ** 7 * 0.6 = 76.8s
Only scoping this to deploy because dont want to affect people’s application that use the aws sdk.
There is also additional rate backoff logic elsewhere, since this is only scoped to deploys.
Useful links:
https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb
https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html
96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/ufo/aws_services.rb', line 96 def = { retry_limit: 7, # default: 3 retry_base_delay: 0.6, # default: 0.3 } .merge!( log_level: :debug, logger: Logger.new($stdout), ) if ENV['UFO_DEBUG_AWS_SDK'] end |
#cfn ⇒ Object
30 31 32 |
# File 'lib/ufo/aws_services.rb', line 30 def cfn Aws::CloudFormation::Client.new() end |
#cloudwatchlogs ⇒ Object
35 36 37 |
# File 'lib/ufo/aws_services.rb', line 35 def cloudwatchlogs Aws::CloudWatchLogs::Client.new() end |
#ec2 ⇒ Object
40 41 42 |
# File 'lib/ufo/aws_services.rb', line 40 def ec2 Aws::EC2::Client.new() end |
#ecr ⇒ Object
45 46 47 |
# File 'lib/ufo/aws_services.rb', line 45 def ecr Aws::ECR::Client.new() end |
#ecs ⇒ Object
50 51 52 |
# File 'lib/ufo/aws_services.rb', line 50 def ecs Aws::ECS::Client.new() end |
#elb ⇒ Object
55 56 57 |
# File 'lib/ufo/aws_services.rb', line 55 def elb Aws::ElasticLoadBalancingV2::Client.new() end |
#s3 ⇒ Object
60 61 62 |
# File 'lib/ufo/aws_services.rb', line 60 def s3 Aws::S3::Client.new() end |
#ssm_client ⇒ Object
ssm is a helper method
66 67 68 |
# File 'lib/ufo/aws_services.rb', line 66 def ssm_client Aws::SSM::Client.new() end |
#waf_client ⇒ Object
waf is a helper method
72 73 74 |
# File 'lib/ufo/aws_services.rb', line 72 def waf_client Aws::WAFV2::Client.new() end |