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::Fargate

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Fargate

Configuration value under :fargate

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :desired_count (Integer)

    number of desired copies of running tasks, default to 2

  • :public (Boolean)

    when `true` (default) Application Load Balancer will be internet-facing

  • :domain_name (String)

    domain name for the service, e.g. api.example.com

  • :domain_zone (String)

    route53 hosted zone for the domain, e.g. “example.com.”.

  • :service_name (String)

    name for the Fargate service

  • :memory (Integer)

    default to 512 (MB)

  • :cpu (Integer)

    default to 256 (units)

  • :envs (Hash)

    environment variable pairs for the container used by this Fargate task

  • :container_name (String)

    defaults to `FargateTaskContainer`

  • :container_port (Integer)

    defaults to 80

  • :certificate (String)

    certificate arn. Certificate Manager certificate to associate with the load balancer. Setting this option will set the load balancer port to 443.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/aws-rails-provisioner/fargate.rb', line 37

def initialize(options = {})
  # code gen only
  @has_db = !!options[:has_db]

  @service_name = options[:service_name]
  @desired_count = options[:desired_count] || 2
  @public = !!options[:public]
  @domain_name = options[:domain_name]
  @domain_zone = options[:domain_zone]
  @certificate = options[:certificate]

  @memory = options[:memory] || 512
  @cpu = options[:cpu] || 256
  @envs = Aws::RailsProvisioner::Utils.to_pairs(options[:envs]) if options[:envs]
  @container_port = options[:container_port] || 80
  @container_name = options[:container_name] || 'FargateTaskContainer'
end

Instance Attribute Details

#certificateString (readonly)

Returns:

  • (String)


75
76
77
# File 'lib/aws-rails-provisioner/fargate.rb', line 75

def certificate
  @certificate
end

#container_nameString (readonly)

Returns:

  • (String)


90
91
92
# File 'lib/aws-rails-provisioner/fargate.rb', line 90

def container_name
  @container_name
end

#container_portInteger (readonly)

Returns:

  • (Integer)


87
88
89
# File 'lib/aws-rails-provisioner/fargate.rb', line 87

def container_port
  @container_port
end

#cpuInteger (readonly)

Returns:

  • (Integer)


84
85
86
# File 'lib/aws-rails-provisioner/fargate.rb', line 84

def cpu
  @cpu
end

#desired_countInteger (readonly)

Returns:

  • (Integer)


60
61
62
# File 'lib/aws-rails-provisioner/fargate.rb', line 60

def desired_count
  @desired_count
end

#domain_nameString (readonly)

Returns:

  • (String)


69
70
71
# File 'lib/aws-rails-provisioner/fargate.rb', line 69

def domain_name
  @domain_name
end

#domain_zoneString (readonly)

Returns:

  • (String)


72
73
74
# File 'lib/aws-rails-provisioner/fargate.rb', line 72

def domain_zone
  @domain_zone
end

#envsArray (readonly)

Returns:

  • (Array)


78
79
80
# File 'lib/aws-rails-provisioner/fargate.rb', line 78

def envs
  @envs
end

#memoryInteger (readonly)

Returns:

  • (Integer)


81
82
83
# File 'lib/aws-rails-provisioner/fargate.rb', line 81

def memory
  @memory
end

#publicBoolean (readonly)

Returns:

  • (Boolean)


66
67
68
# File 'lib/aws-rails-provisioner/fargate.rb', line 66

def public
  @public
end

#service_nameString (readonly)

Returns:

  • (String)


63
64
65
# File 'lib/aws-rails-provisioner/fargate.rb', line 63

def service_name
  @service_name
end