Method: CFnDK::Stack#initialize

Defined in:
lib/cfndk/stack.rb

#initialize(name, data, option, global_config, credentials) ⇒ Stack

Returns a new instance of Stack.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cfndk/stack.rb', line 4

def initialize(name, data, option, global_config, credentials)
  @global_config = global_config
  @name = name
  @template_file = data['template_file'] || ''
  @parameter_input = data['parameter_input'] || ''
  @capabilities = data['capabilities'] || []
  @depends = data['depends'] || []
  @region = data['region'] || @global_config.region
  @role_arn = @global_config.role_arn
  @package = data['package'] || @global_config.package
  @pre_command = data['pre_command'] || nil
  @post_command = data['post_command'] || nil
  @enabled = true
  @enabled = false if data['enabled'] === false 
  @timeout_in_minutes = data['timeout_in_minutes'] || @global_config.timeout_in_minutes
  @override_parameters = data['parameters'] || {}
  @option = option
  @client = Aws::CloudFormation::Client.new(credentials: credentials, region: @region)
  @s3_client = Aws::S3::Client.new(credentials: credentials, region: @region)
  @sts_client = Aws::STS::Client.new(credentials: credentials, region: @region)
  @tp = CFnDK::TemplatePackager.new(@template_file, @region, @package, @global_config, @s3_client, @sts_client)
end