AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Class: Aws::RailsProvisioner::CDKDeployer

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-rails-provisioner/cdk_deployer.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ CDKDeployer

Returns a new instance of CDKDeployer.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/aws-rails-provisioner/cdk_deployer.rb', line 6

def initialize(options = {})
  @cdk_dir = options[:cdk_dir]
  @services = options[:services]
  @stack_prefix = options[:stack_prefix]

  both = options[:fargate].nil? && options[:cicd].nil?
  @fargate_stack = both || !!options[:fargate]
  @pipeline_stack = both || !!options[:cicd]

  @init_stack_only = !!options[:init]

  @svc_name = options[:service_name]
  @profile = options[:profile]
end

Instance Method Details

#runObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/aws-rails-provisioner/cdk_deployer.rb', line 21

def run
  Dir.chdir(@cdk_dir) do
    `cdk bootstrap`
    deploy_init_stack
    unless @init_stack_only
      if @svc_name
        deploy_svc(@services[@svc_name].stack_prefix)
      else
        @services.each do |svc|
          deploy_svc(svc.stack_prefix)
        end
      end
    end
  end
end