Class: Putpaws::Provision::Resources::Cluster
- Inherits:
-
Base
- Object
- Base
- Putpaws::Provision::Resources::Cluster
show all
- Defined in:
- lib/putpaws/provision/resources/cluster.rb
Instance Attribute Summary
Attributes inherited from Base
#clients, #config, #state
Instance Method Summary
collapse
Methods inherited from Base
#changed?, #ensure!, #initialize, #kind, #plan, #update!
Instance Method Details
#create! ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/putpaws/provision/resources/cluster.rb', line 16
def create!
res = clients.ecs.create_cluster(
cluster_name: name,
tags: [MANAGED_TAG]
)
{cluster_arn: res.cluster.cluster_arn, cluster_name: name}
end
|
#current ⇒ Object
11
12
13
14
|
# File 'lib/putpaws/provision/resources/cluster.rb', line 11
def current
res = clients.ecs.describe_clusters(clusters: [name])
res.clusters.detect{|c| c.status == 'ACTIVE'}
end
|
#name ⇒ Object
7
8
9
|
# File 'lib/putpaws/provision/resources/cluster.rb', line 7
def name
config.cluster_name
end
|
#outputs(current) ⇒ Object
24
25
26
|
# File 'lib/putpaws/provision/resources/cluster.rb', line 24
def outputs(current)
{cluster_arn: current.cluster_arn, cluster_name: name}
end
|