Class: Stax::Generators::FargateGenerator
- Inherits:
-
Base
- Object
- Base
- Stax::Generators::FargateGenerator
- Defined in:
- lib/generators/fargate/fargate_generator.rb
Instance Attribute Summary collapse
-
#stack ⇒ Object
Returns the value of attribute stack.
-
#subnetids ⇒ Object
Returns the value of attribute subnetids.
-
#vpc ⇒ Object
Returns the value of attribute vpc.
-
#vpcid ⇒ Object
Returns the value of attribute vpcid.
Instance Method Summary collapse
Instance Attribute Details
#stack ⇒ Object
Returns the value of attribute stack.
10 11 12 |
# File 'lib/generators/fargate/fargate_generator.rb', line 10 def stack @stack end |
#subnetids ⇒ Object
Returns the value of attribute subnetids.
10 11 12 |
# File 'lib/generators/fargate/fargate_generator.rb', line 10 def subnetids @subnetids end |
#vpc ⇒ Object
Returns the value of attribute vpc.
10 11 12 |
# File 'lib/generators/fargate/fargate_generator.rb', line 10 def vpc @vpc end |
#vpcid ⇒ Object
Returns the value of attribute vpcid.
10 11 12 |
# File 'lib/generators/fargate/fargate_generator.rb', line 10 def vpcid @vpcid end |
Instance Method Details
#add_templates ⇒ Object
27 28 29 |
# File 'lib/generators/fargate/fargate_generator.rb', line 27 def add_templates directory '.', 'cf' end |
#add_to_staxfile ⇒ Object
23 24 25 |
# File 'lib/generators/fargate/fargate_generator.rb', line 23 def add_to_staxfile append_to_file 'Staxfile', "stack :#{stack}, import: :#{vpc}, include: %w[Ecs Alb Logs]\n" end |
#ask_for_options ⇒ Object
16 17 18 19 20 21 |
# File 'lib/generators/fargate/fargate_generator.rb', line 16 def @stack = [:stack] || ask('stack to use or create?', default: 'app') @vpc = ask('vpc stack to connect?', default: 'vpc') @vpcid = ask("vpc export to import from stack #{vpc}?", default: 'VpcId') @subnetids = ask("subnet export to import from stack #{vpc}?", default: 'SubnetIds') end |
#check_args ⇒ Object
12 13 14 |
# File 'lib/generators/fargate/fargate_generator.rb', line 12 def check_args usage! unless args.empty? end |