kumogata-template 0.0.29 → 0.0.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/Gemfile.lock +13 -40
  4. data/README.md +34 -83
  5. data/bin/kumogata-template +2 -2
  6. data/kumogata-template.gemspec +4 -4
  7. data/lib/kumogata/template/autoscaling.rb +19 -0
  8. data/lib/kumogata/template/cloudwatch.rb +1 -9
  9. data/lib/kumogata/template/const.rb +22 -4
  10. data/lib/kumogata/template/ec2.rb +18 -8
  11. data/lib/kumogata/template/ecs.rb +34 -0
  12. data/lib/kumogata/template/elasticbeanstalk.rb +937 -3
  13. data/lib/kumogata/template/ext/kumogata.rb +64 -16
  14. data/lib/kumogata/template/helper.rb +146 -19
  15. data/lib/kumogata/template/iam.rb +2 -3
  16. data/lib/kumogata/template/lambda.rb +10 -1
  17. data/lib/kumogata/template/version.rb +1 -1
  18. data/template/_template.rb +20 -3
  19. data/template/alb-load-balancer.rb +8 -1
  20. data/template/autoscaling-launch-configuration.rb +2 -11
  21. data/template/autoscaling-scheduled-action.rb +2 -17
  22. data/template/ec2-instance.rb +5 -7
  23. data/template/ec2-network-acl-entry.rb +3 -1
  24. data/template/ec2-route.rb +3 -1
  25. data/template/ec2-security-group.rb +2 -0
  26. data/template/ec2-subnet.rb +2 -1
  27. data/template/ec2-vpc.rb +2 -1
  28. data/template/ecs-service.rb +4 -0
  29. data/template/ecs-task-definition.rb +6 -4
  30. data/template/elasticbeanstalk-application-version.rb +9 -4
  31. data/template/elasticbeanstalk-application.rb +4 -3
  32. data/template/elasticbeanstalk-configuration-template.rb +7 -2
  33. data/template/elasticbeanstalk-environment.rb +10 -10
  34. data/template/emr-cluster.rb +8 -3
  35. data/template/iam-instance-profile.rb +2 -0
  36. data/template/lambda-function.rb +8 -3
  37. data/template/mappings-ec2.rb +44 -44
  38. data/template/output-access-key.rb +7 -2
  39. data/template/output-alb.rb +16 -11
  40. data/template/output-arn.rb +6 -3
  41. data/template/output-autoscaling.rb +7 -2
  42. data/template/output-dynamodb.rb +7 -2
  43. data/template/output-ec2-subnet.rb +14 -0
  44. data/template/output-ec2.rb +13 -4
  45. data/template/output-elasticache.rb +23 -7
  46. data/template/output-elasticbeanstalk-environment.rb +8 -0
  47. data/template/output-elb.rb +13 -6
  48. data/template/output-emr.rb +8 -3
  49. data/template/output-iam-instance-profile.rb +7 -2
  50. data/template/output-iam-role.rb +7 -2
  51. data/template/output-name.rb +3 -1
  52. data/template/output-rds.rb +7 -3
  53. data/template/output-redshift.rb +7 -3
  54. data/template/output-s3.rb +11 -3
  55. data/template/output-security-group.rb +4 -1
  56. data/template/output-sqs.rb +4 -1
  57. data/template/output-topic.rb +8 -3
  58. data/template/output-vpc.rb +16 -4
  59. data/template/output.rb +3 -1
  60. data/template/rds-db-instance.rb +7 -0
  61. data/template/redshift-cluster.rb +2 -0
  62. data/template/sqs-queue.rb +14 -0
  63. data/test/abstract_unit.rb +31 -8
  64. data/test/elasticbeanstalk_test.rb +3 -3
  65. data/test/helper_test.rb +431 -0
  66. data/test/template/autoscaling-launch-configuration_test.rb +1 -4
  67. data/test/template/ec2-instance_test.rb +2 -2
  68. data/test/template/ec2-vpc_test.rb +2 -2
  69. data/test/template/ecs-task-definition_test.rb +13 -13
  70. data/test/template/elasticbeanstalk-application-version_test.rb +13 -3
  71. data/test/template/elasticbeanstalk-template_test.rb +1 -1
  72. data/test/template/iam-instance-profile_test.rb +20 -0
  73. data/test/template/lambda-function_test.rb +60 -4
  74. data/test/template/{output-az_test.rb → output-ec2-subet_test.rb} +7 -8
  75. data/test/template/output-elasticache_test.rb +18 -0
  76. data/test/template/output_test.rb +23 -0
  77. data/test/template/rds-db-instance_test.rb +1 -1
  78. metadata +22 -22
  79. data/lib/kumogata/template/ext/argument_parser.rb +0 -8
  80. data/template/output-az.rb +0 -6
@@ -10,7 +10,9 @@ cluster = _ref_string("cluster", args, "ecs cluster")
10
10
  deployment = _ecs_deployment(args)
11
11
  desired = _ref_string("desired_count", args, "ecs desired count")
12
12
  load_balancers = _ecs_load_balancers(args)
13
+ placement = _ecs_placement_service(args)
13
14
  role = args[:role] || ""
15
+ service_name = _real_name(args[:service_name] || "")
14
16
  task = _ref_string("task", args, "ecs task definition")
15
17
 
16
18
  _(name) do
@@ -20,7 +22,9 @@ _(name) do
20
22
  DeploymentConfiguration deployment unless deployment.empty?
21
23
  DesiredCount desired
22
24
  LoadBalancers load_balancers unless load_balancers.empty?
25
+ PlacementConstraints placement unless placement.empty?
23
26
  Role role unless role.empty?
27
+ ServiceName service_name unless service_name.empty?
24
28
  TaskDefinition task
25
29
  end
26
30
  end
@@ -6,19 +6,21 @@ require 'kumogata/template/helper'
6
6
  require 'kumogata/template/ecs'
7
7
 
8
8
  name = _resource_name(args[:name], "ecs task definition")
9
- definitions = _ecs_container_definitions(args)
9
+ volumes = _ecs_volumes(args)
10
10
  family = args[:family] || ""
11
11
  network = _valid_values(args[:network], %w( bridge host none ), "")
12
+ placement = _ecs_placement_definition(args)
12
13
  role = _ref_attr_string("role", "Arn", args, "role")
13
- volumes = _ecs_volumes(args)
14
+ definitions = _ecs_container_definitions(args)
14
15
 
15
16
  _(name) do
16
17
  Type "AWS::ECS::TaskDefinition"
17
18
  Properties do
18
- ContainerDefinitions definitions
19
+ Volumes volumes
19
20
  Family family unless family.empty?
20
21
  NetworkMode network unless network.empty?
22
+ PlacementConstraints placement unless placement.empty?
21
23
  TaskRoleArn role unless role.empty?
22
- Volumes volumes
24
+ ContainerDefinitions definitions
23
25
  end
24
26
  end
@@ -5,10 +5,15 @@
5
5
  require 'kumogata/template/helper'
6
6
 
7
7
  name = _resource_name(args[:name], "elasticbeanstalk application version")
8
- application = _ref_name("application", args)
9
- description = args[:description] || ""
10
- s3_bucket = _ref_string("s3_bucket", args, "bucket")
11
- s3_key = args[:s3_key]
8
+ application = _ref_string_default("application", args,
9
+ "elasticbeanstalk application", args[:name])
10
+ description = _ref_string("description", args)
11
+ s3_bucket = _join([
12
+ _ref_string("s3_bucket", args, "bucket"),
13
+ _region,
14
+ ],
15
+ "-")
16
+ s3_key = _ref_string("s3_key", args)
12
17
 
13
18
  _(name) do
14
19
  Type "AWS::ElasticBeanstalk::ApplicationVersion"
@@ -5,13 +5,14 @@
5
5
  require 'kumogata/template/helper'
6
6
 
7
7
  name = _resource_name(args[:name], "elasticbeanstalk application")
8
- application = _ref_name("application", args)
9
- description = args[:description] || ""
8
+ application = _ref_string("application", args)
9
+ application = args[:name] if application.empty?
10
+ description = _ref_string("description", args)
10
11
 
11
12
  _(name) do
12
13
  Type "AWS::ElasticBeanstalk::Application"
13
14
  Properties do
14
15
  ApplicationName application
15
- Destination description unless description.empty?
16
+ Description description unless description.empty?
16
17
  end
17
18
  end
@@ -8,7 +8,12 @@ require 'kumogata/template/elasticbeanstalk'
8
8
  name = _resource_name(args[:name], "elasticbeanstalk configuration template")
9
9
  application = _ref_string("application", args, "elasticbeanstalk application")
10
10
  description = args[:description] || ""
11
- option = _elasticbeanstalk_option(args[:option] || [])
11
+ options =
12
+ if args.key? :options
13
+ _elasticbeanstalk_options(args[:options])
14
+ else
15
+ ""
16
+ end
12
17
  environment = args[:environment] || ""
13
18
  solution = args[:solution] || ""
14
19
  configuration =
@@ -24,7 +29,7 @@ _(name) do
24
29
  ApplicationName application
25
30
  Description description unless description.empty?
26
31
  EnvironmentId environment unless environment.empty?
27
- OptionSettings option unless option.empty?
32
+ OptionSettings options unless options.empty?
28
33
  SolutionStackName solution unless solution.empty?
29
34
  SourceConfiguration configuration unless configuration.empty?
30
35
  end
@@ -7,24 +7,24 @@ require 'kumogata/template/elasticbeanstalk'
7
7
 
8
8
  name = _resource_name(args[:name], "elasticbeanstalk environment")
9
9
  application = _ref_string("application", args, "elasticbeanstalk application")
10
- cname = args[:cname] || ""
11
- description = args[:description] || ""
12
- environment = _ref_name("environment", args)
13
- option =
14
- if args.key? :option
15
- _elasticbeanstalk_option(args[:option])
10
+ cname = _ref_string("cname", args)
11
+ description = _ref_string("description", args)
12
+ environment = _ref_string("environment", args)
13
+ options =
14
+ if args.key? :options
15
+ _elasticbeanstalk_options(args[:options])
16
16
  else
17
17
  ""
18
18
  end
19
- solution = args[:solution] || ""
20
- template = args[:template] || ""
19
+ solution = _ref_string("solution", args)
20
+ template = _ref_string("template", args)
21
21
  tier =
22
22
  if args.key? :tier
23
23
  _elasticbeanstalk_tier(args[:tier])
24
24
  else
25
25
  ""
26
26
  end
27
- version = args[:version] || ""
27
+ version = _ref_string("version", args, "elasticbeanstalk application version")
28
28
  tags = _tags(args)
29
29
 
30
30
  _(name) do
@@ -34,7 +34,7 @@ _(name) do
34
34
  CNAMEPrefix cname unless cname.empty?
35
35
  Description description unless description.empty?
36
36
  EnvironmentName environment
37
- OptionSettings option unless option.empty?
37
+ OptionSettings options unless options.empty?
38
38
  SolutionStackName solution
39
39
  Tags tags
40
40
  TemplateName template unless template.empty?
@@ -1,5 +1,5 @@
1
1
  #
2
- # EMR Cluster resource
2
+ # EMR cluster resource
3
3
  # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-cluster.html
4
4
  #
5
5
  require 'kumogata/template/helper'
@@ -7,9 +7,14 @@ require 'kumogata/template/emr'
7
7
 
8
8
  name = _resource_name(args[:name], "emr cluster")
9
9
  applications = _emr_applications(args)
10
+ autoscaling =
11
+ if args.key? :autoscaling
12
+ args[:autoscaling] || "EMR_AutoScaling_DefaultRole"
13
+ else
14
+ ""
15
+ end
10
16
  bootstraps = _emr_bootstraps(args)
11
17
  configurations = _emr_configurations(args)
12
- ebs = _emr_ebs(args)
13
18
  instance = _emr_job_flow(args)
14
19
  job_flow_role = args[:job_flow_role] || "EMR_EC2_DefaultRole"
15
20
  log = args[:log] || ""
@@ -24,9 +29,9 @@ _(name) do
24
29
  Properties do
25
30
  #AdditionalInfo
26
31
  Applications applications unless applications.empty?
32
+ AutoScalingRole autoscaling unless autoscaling.empty?
27
33
  BootstrapActions bootstraps unless bootstraps.empty?
28
34
  Configurations configurations unless configurations.empty?
29
- EbsConfiguration ebs unless ebs.empty?
30
35
  Instances instance
31
36
  JobFlowRole String job_flow_role
32
37
  LogUri log unless log.empty?
@@ -7,11 +7,13 @@ require 'kumogata/template/helper'
7
7
  name = _resource_name(args[:name], "instance profile")
8
8
  path = args[:path] || "/"
9
9
  roles = _ref_array("roles", args, "role")
10
+ profile_name = _real_name(args[:profile_name] || "")
10
11
 
11
12
  _(name) do
12
13
  Type "AWS::IAM::InstanceProfile"
13
14
  Properties do
14
15
  Path path
15
16
  Roles roles
17
+ InstanceProfileName profile_name unless profile_name.empty?
16
18
  end
17
19
  end
@@ -7,19 +7,20 @@ require 'kumogata/template/lambda'
7
7
 
8
8
  name = _resource_name(args[:name], "lambda function")
9
9
  code = _lambda_function_code(args)
10
+ dead_letter = _lambda_dead_letter(args)
10
11
  description = args[:description] || ""
11
12
  environment = _lambda_function_environment(args)
12
13
  function_name = args[:function_name] || ""
13
14
  runtime = _valid_values(args[:runtime],
14
- %w( nodejs nodejs4.3 java8 python2.7 ), "python2.7")
15
+ %w( nodejs nodejs4.3 java8 python2.7 ), "nodejs")
15
16
  handler =
16
17
  if args.key? :handler
17
18
  args[:handler]
18
19
  else
19
20
  case runtime
20
- when /^nodejs.+/
21
+ when /^nodejs/
21
22
  "#{args[:function_name]}.handler"
22
- when /^python.+/
23
+ when /^python/
23
24
  "#{args[:function_name]}.lambda_handler"
24
25
  else
25
26
  args[:handler]
@@ -30,19 +31,23 @@ role = _ref_attr_string("role", "Arn", args, "role")
30
31
  role = _ref_string("role_arn", args, "role") if role.empty?
31
32
  timeout = args[:timeout] || 3
32
33
  vpc_config = _lambda_vpc_config(args)
34
+ tags = _tags(args)
33
35
 
34
36
  _(name) do
35
37
  Type "AWS::Lambda::Function"
36
38
  Properties do
37
39
  Code code
40
+ DeadLetterConfig dead_letter unless dead_letter.empty?
38
41
  Description description unless description.empty?
39
42
  Environment environment unless environment.empty?
40
43
  FunctionName function_name unless function_name.empty?
41
44
  Handler handler
45
+ #KmsKeyArn
42
46
  MemorySize memory_size
43
47
  Role role
44
48
  Runtime runtime
45
49
  Timeout timeout
46
50
  VpcConfig vpc_config unless vpc_config.empty?
51
+ Tags tags
47
52
  end
48
53
  end
@@ -14,22 +14,22 @@ end
14
14
  # Amazon Linux AMI (HVM / 64-bit)
15
15
  # https://aws.amazon.com/marketplace/pp/B00CIYTQTC/
16
16
  AWSRegionArch2AMIAmazonLinuxOfficial do
17
- # 2016.09
17
+ # 2017.03.0.20170417, released 04/19/2017
18
18
  image_id = {
19
- virginia: "0b33d91d",
20
- ohio: "c55673a0",
21
- california: "165a0876",
22
- oregon: "f173cc91",
23
- canada: "ebed508f",
24
- ireland: "70edb016",
25
- frankfurt: "af0fc0c0",
26
- london: "f1949e95",
27
- tokyo: "56d4ad31",
28
- seoul: "dac312b4",
29
- singapore: "dc9339bf",
30
- sydney: "1c47407f",
31
- mumbai: "f9daac96",
32
- saopaulo: "80086dec",
19
+ virginia: "c58c1dd3",
20
+ ohio: "4191b524",
21
+ california: "7a85a01a",
22
+ oregon: "4836a428",
23
+ canada: "0bd66a6f",
24
+ ireland: "01ccc867",
25
+ frankfurt: "b968bad6",
26
+ london: "b6daced2",
27
+ tokyo: "923d12f5",
28
+ seoul: "9d15c7f3",
29
+ singapore: "fc5ae39f",
30
+ sydney: "162c2575",
31
+ mumbai: "52c7b43d",
32
+ saopaulo: "37cfad5b",
33
33
  }
34
34
 
35
35
  AWS_REGION.each do |key, region|
@@ -43,22 +43,22 @@ end
43
43
  # https://wiki.centos.org/Cloud/AWS
44
44
  # https://aws.amazon.com/marketplace/pp/B00O7WM7QW/
45
45
  AWSRegionArch2AMICentos7Official do
46
- # 1602, released 02/26/2016
46
+ # 1704, released 05/15/2017
47
47
  image_id = {
48
- virginia: "6d1c2007",
49
- ohio: "6a2d760f",
50
- california: "af4333cf",
51
- oregon: "d2c924b2",
52
- canada: "af62d0cb",
53
- ireland: "7abd0209",
54
- frankfurt: "9bf712f4",
55
- london: "bb373ddf",
56
- tokyo: "eec1c380",
57
- seoul: "c74789a9",
58
- singapore: "f068a193",
59
- sydney: "fedafc9d",
60
- mumbai: "95cda6fa",
61
- saopaulo: "26b93b4a",
48
+ virginia: "46c1b650",
49
+ ohio: "18f8df7d",
50
+ california: "f5d7f195",
51
+ oregon: "f4533694",
52
+ canada: "28823e4c",
53
+ ireland: "061b1560",
54
+ frankfurt: "fa2df395",
55
+ london: "e05a4d84",
56
+ tokyo: "29d1e34e",
57
+ seoul: "08e93466",
58
+ singapore: "7d2eab1e",
59
+ sydney: "34171d57",
60
+ mumbai: "3c0e7353",
61
+ saopaulo: "b31a75df",
62
62
  }
63
63
 
64
64
  AWS_REGION.each do |key, region|
@@ -72,22 +72,22 @@ end
72
72
  # https://cloud-images.ubuntu.com/locator/ec2/
73
73
  # https://aws.amazon.com/marketplace/pp/B01JBL2M0O
74
74
  AWSRegionArch2AMIUbuntu16Official do
75
- # 16.04 LTS 20160907.1 hvm:ebs-ssd
75
+ # 20170411, released 04/11/2017
76
76
  image_id = {
77
- virginia: "3267bb24",
78
- ohio: "e5be9b80",
79
- california: "456f3125",
80
- oregon: "df25a6bf",
81
- canada: "", ## N/A
82
- ireland: "cdfed1ab",
83
- frankfurt: "f6dd0899",
84
- london: "bcc5d0d8",
85
- tokyo: "0c05506b",
86
- seoul: "fc38e892",
87
- singapore: "4a299829",
88
- sydney: "d02d2eb3",
77
+ virginia: "e4139df2",
78
+ ohio: "33ab8f56",
79
+ california: "30476250",
80
+ oregon: "17ba2a77",
81
+ canada: "9eee52fa",
82
+ ireland: "b5a893d3",
83
+ frankfurt: "1b4d9e74",
84
+ london: "4d3a2e29",
85
+ tokyo: "c9e3c0ae",
86
+ seoul: "3cda0852",
87
+ singapore: "6e74ca0d",
88
+ sydney: "92e8e6f1",
89
89
  mumbai: "", ## N/A
90
- saopaulo: "4cacca20",
90
+ saopaulo: "36187a5a",
91
91
  }
92
92
 
93
93
  AWS_REGION.each do |key, region|
@@ -1,6 +1,11 @@
1
1
  #
2
2
  # Output access key
3
3
  #
4
+ require 'kumogata/template/helper'
4
5
 
5
- _output "#{args[:name]} access key", ref_value: args[:name]
6
- _output "#{args[:name]} secret access key", ref_value: [ args[:name], "SecretAccessKey" ]
6
+ _output "#{args[:name]} access key",
7
+ ref_value: args[:name],
8
+ export: _export_string(args, "access key")
9
+ _output "#{args[:name]} secret access key",
10
+ ref_value: [ args[:name], "SecretAccessKey" ],
11
+ export: _export_string(args, "secret access key")
@@ -1,21 +1,26 @@
1
1
  #
2
2
  # Output alb
3
3
  #
4
+ require 'kumogata/template/helper'
4
5
 
5
6
  _output "#{args[:name]} load balancer",
6
- ref_value: "#{args[:name]} load balancer"
7
+ ref_value: "#{args[:name]} load balancer",
8
+ export: _export_string(args, "load balancer")
7
9
  _output "#{args[:name]} load balancer dns name",
8
- ref_value: [ "#{args[:name]} load balancer", "DNSName" ]
10
+ ref_value: [ "#{args[:name]} load balancer", "DNSName" ],
11
+ export: _export_string(args, "load balancer dns name")
9
12
  _output "#{args[:name]} load balancer canonical hosted zone id",
10
- ref_value: [ "#{args[:name]} load balancer", "CanonicalHostedZoneID" ] if args.key? :route53
13
+ ref_value: [ "#{args[:name]} load balancer", "CanonicalHostedZoneID" ],
14
+ export: _export_string(args, "load balancer canonical hosted zone id") if args.key? :route53
11
15
  _output "#{args[:name]} load balancer full name",
12
- ref_value: [ "#{args[:name]} load balancer", "LoadBalancerFullName" ]
16
+ ref_value: [ "#{args[:name]} load balancer", "LoadBalancerFullName" ],
17
+ export: _export_string(args, "load balancer full name")
13
18
  _output "#{args[:name]} load balancer name",
14
- ref_value: [ "#{args[:name]} load balancer", "LoadBalancerName" ]
19
+ ref_value: [ "#{args[:name]} load balancer", "LoadBalancerName" ],
20
+ export: _export_string(args, "load balancer name")
15
21
 
16
- if args.key? :security_groups
17
- args[:security_groups].times do |i|
18
- _output "#{args[:name]} load balancer security group #{i}",
19
- value: _select(i, _attr_string(args[:name], "SecurityGroups", "load balancer"))
20
- end
21
- end
22
+ args[:security_groups].times do |i|
23
+ _output "#{args[:name]} load balancer security group #{i}",
24
+ value: _select(i, _attr_string(args[:name], "SecurityGroups", "load balancer")),
25
+ export: _export_string(args, "load balancer security group #{i}")
26
+ end if args.key? :security_groups
@@ -1,6 +1,9 @@
1
1
  #
2
- # Output name + arn
2
+ # Output name and arn
3
3
  #
4
+ require 'kumogata/template/helper'
4
5
 
5
- _output "#{args[:name]} name", ref_value: args[:name]
6
- _output "#{args[:name]} arn", ref_value: [ args[:name], "Arn" ]
6
+ _output "#{args[:name]} name", ref_value: args[:name],
7
+ export: _export_string(args, "name")
8
+ _output "#{args[:name]} arn", ref_value: [ args[:name], "Arn" ],
9
+ export: _export_string(args, "arn")
@@ -1,6 +1,11 @@
1
1
  #
2
2
  # Output autoscaling
3
3
  #
4
+ require 'kumogata/template/helper'
4
5
 
5
- _output "#{args[:name]} autoscaling group", ref_value: "#{args[:name]} autoscaling group"
6
- _output "#{args[:name]} autoscaling launch configuration", ref_value: "#{args[:name]} autoscaling launch configuration"
6
+ _output "#{args[:name]} autoscaling group",
7
+ ref_value: "#{args[:name]} autoscaling group",
8
+ export: _export_string(args, "autoscaling group")
9
+ _output "#{args[:name]} autoscaling launch configuration",
10
+ ref_value: "#{args[:name]} autoscaling launch configuration",
11
+ export: _export_string(args, "autoscaling launch configuration")
@@ -1,6 +1,11 @@
1
1
  #
2
2
  # Output dynanmodb
3
3
  #
4
+ require 'kumogata/template/helper'
4
5
 
5
- _output "#{args[:name]} table", ref_value: "#{args[:name]} table"
6
- _output "#{args[:name]} table", ref_value: [ "#{args[:name]} table", "StreamArn" ] if args.key? :stream
6
+ _output "#{args[:name]} table",
7
+ ref_value: "#{args[:name]} table",
8
+ export: _export_string(args, "table")
9
+ _output "#{args[:name]} table",
10
+ ref_value: [ "#{args[:name]} table", "StreamArn" ],
11
+ export: _export_string(args, "stream arn") if args.key? :stream
@@ -0,0 +1,14 @@
1
+ #
2
+ # Output ec2 subnet
3
+ #
4
+ require 'kumogata/template/helper'
5
+
6
+ _output "#{args[:name]} subnet",
7
+ ref_value: "#{args[:name]} subnet",
8
+ export: _export_string(args, "subnet")
9
+ _output "#{args[:name]} subnet az",
10
+ ref_value: [ "#{args[:name]} subnet", "AvailabilityZone" ],
11
+ export: _export_string(args, "subnet az")
12
+ _output "#{args[:name]} subnet ipv6 cidr blocks",
13
+ ref_value: [ vpc, "Ipv6CidrBlocks" ],
14
+ export: _export_string(args, "subnet ipv6 cidr bocks") if args.key? :ipv6
@@ -1,10 +1,19 @@
1
1
  #
2
2
  # Output ec2
3
3
  #
4
+ require 'kumogata/template/helper'
4
5
 
5
6
  public_ip = args[:public_ip] || false
6
7
 
7
- _output "#{args[:name]} instance", ref_value: "#{args[:name]} instance"
8
- _output "#{args[:name]} instance az", ref_value: [ "#{args[:name]} instance", "AvailabilityZone" ]
9
- _output "#{args[:name]} instance public ip", ref_value: [ "#{args[:name]} instance", "PublicIp" ] if public_ip
10
- _output "#{args[:name]} instance private ip", ref_value: [ "#{args[:name]} instance", "PrivateIp" ]
8
+ _output "#{args[:name]} instance",
9
+ ref_value: "#{args[:name]} instance",
10
+ export: _export_string(args, "instance")
11
+ _output "#{args[:name]} instance az",
12
+ ref_value: [ "#{args[:name]} instance", "AvailabilityZone" ],
13
+ export: _export_string(args, "instance az")
14
+ _output "#{args[:name]} instance public ip",
15
+ ref_value: [ "#{args[:name]} instance", "PublicIp" ],
16
+ export: _export_string(args, "instance public ip") if public_ip
17
+ _output "#{args[:name]} instance private ip",
18
+ ref_value: [ "#{args[:name]} instance", "PrivateIp" ],
19
+ export: _export_string(args, "instance private ip")
@@ -9,22 +9,38 @@ engine = _valid_values(args[:engine], %w( memcached redis ), ELASTICACHE_DEFAULT
9
9
  if replication
10
10
  if engine == "redis"
11
11
  _output "#{args[:name]} cache replication group",
12
- ref_value: "#{args[:name]} cache replication group"
12
+ ref_value: "#{args[:name]} cache replication group",
13
+ export: _export_string(args, "cache replication group")
14
+
15
+ _output "#{args[:name]} cache replication group configuration address",
16
+ ref_value: [ "#{args[:name]} cache replication group", "ConfigurationEndPoint.Address" ],
17
+ export: _export_string(args, "cache replication group configuration end point address")
18
+ _output "#{args[:name]} cache replication group configuration port",
19
+ ref_value: [ "#{args[:name]} cache replication group", "ConfigurationEndPoint.Port" ],
20
+ export: _export_string(args, "cache replication group configuration end point port")
21
+
13
22
  _output "#{args[:name]} cache replication group primary address",
14
- ref_value: [ "#{args[:name]} cache replication group", "PrimaryEndPoint.Address" ]
23
+ ref_value: [ "#{args[:name]} cache replication group", "PrimaryEndPoint.Address" ],
24
+ export: _export_string(args, "cache replication group primary end point address")
15
25
  _output "#{args[:name]} cache replication group primary port",
16
- ref_value: [ "#{args[:name]} cache replication group", "PrimaryEndPoint.Port" ]
26
+ ref_value: [ "#{args[:name]} cache replication group", "PrimaryEndPoint.Port" ],
27
+ export: _export_string(args, "cache replication group primary end point port")
28
+
17
29
  _output "#{args[:name]} cache replication group read addresses",
18
- ref_value: [ "#{args[:name]} cache replication group", "ReadEndPoint.Addresses" ]
30
+ ref_value: [ "#{args[:name]} cache replication group", "ReadEndPoint.Addresses" ],
31
+ export: _export_string(args, "cache replication group read end point addresses")
19
32
  _output "#{args[:name]} cache replication group read ports",
20
- ref_value: [ "#{args[:name]} cache replication group", "ReadEndPoint.Ports" ]
33
+ ref_value: [ "#{args[:name]} cache replication group", "ReadEndPoint.Ports" ],
34
+ export: _export_string(args, "cache replication group read end point ports")
21
35
  end
22
36
  else
23
37
  _output "#{args[:name]} cache cluster", ref_value: "#{args[:name]} cache cluster"
24
38
  if engine == "memcached"
25
39
  _output "#{args[:name]} cache cluster address",
26
- ref_value: [ "#{args[:name]} cache cluster", "ConfigurationEndpoint.Address" ]
40
+ ref_value: [ "#{args[:name]} cache cluster", "ConfigurationEndpoint.Address" ],
41
+ export: _export_string(args, "cache replication group configuration endpoint address")
27
42
  _output "#{args[:name]} cache cluster port",
28
- ref_value: [ "#{args[:name]} cache cluster", "ConfigurationEndpoint.Port" ]
43
+ ref_value: [ "#{args[:name]} cache cluster", "ConfigurationEndpoint.Port" ],
44
+ export: _export_string(args, "cache replication group configuration endpoint port")
29
45
  end
30
46
  end
@@ -0,0 +1,8 @@
1
+ #
2
+ # Output elasticbeanstalk environment
3
+ #
4
+ require 'kumogata/template/helper'
5
+
6
+ _output "#{args[:name]} elasticbeanstalk environment endpoint",
7
+ ref_value: [ "#{args[:name]} elasticbeanstalk environment", "EndpointURL" ],
8
+ export: _export_string(args, "elasticbeanstalk environment endpoint")
@@ -1,16 +1,23 @@
1
1
  #
2
2
  # Output elb
3
3
  #
4
+ require 'kumogata/template/helper'
4
5
 
5
6
  _output "#{args[:name]} load balancer",
6
- ref_value: "#{args[:name]} load balancer"
7
+ ref_value: "#{args[:name]} load balancer",
8
+ export: _export_string(args, "load balancer")
7
9
  _output "#{args[:name]} load balancer canonical hosted zone name",
8
- ref_value: [ "#{args[:name]} load balancer", "CanonicalHostedZoneName" ] if args.key? :route53
10
+ ref_value: [ "#{args[:name]} load balancer", "CanonicalHostedZoneName" ],
11
+ export: _export_string(args, "load balancer canonical hosted zone name") if args.key? :route53
9
12
  _output "#{args[:name]} load balancer canonical hosted zone id",
10
- ref_value: [ "#{args[:name]} load balancer", "CanonicalHostedZoneID" ] if args.key? :route53
13
+ ref_value: [ "#{args[:name]} load balancer", "CanonicalHostedZoneID" ],
14
+ export: _export_string(args, "load balancer canonical hosted zone id") if args.key? :route53
11
15
  _output "#{args[:name]} load balancer dns name",
12
- ref_value: [ "#{args[:name]} load balancer", "DNSName" ]
16
+ ref_value: [ "#{args[:name]} load balancer", "DNSName" ],
17
+ export: _export_string(args, "load balancer dns name")
13
18
  _output "#{args[:name]} load balancer security group name",
14
- ref_value: [ "#{args[:name]} load balancer", "SourceSecurityGroup.GroupName" ]
19
+ ref_value: [ "#{args[:name]} load balancer", "SourceSecurityGroup.GroupName" ],
20
+ export: _export_string(args, "load balancer source security group group name")
15
21
  _output "#{args[:name]} load balancer security group owner",
16
- ref_value: [ "#{args[:name]} load balancer", "SourceSecurityGroup.OwnerAlias" ]
22
+ ref_value: [ "#{args[:name]} load balancer", "SourceSecurityGroup.OwnerAlias" ],
23
+ export: _export_string(args, "load balancer source security group owner alias")
@@ -1,6 +1,11 @@
1
1
  #
2
- # output emr
2
+ # Output emr
3
3
  #
4
+ require 'kumogata/template/helper'
4
5
 
5
- _output "#{args[:name]} emr cluster", ref_value: "#{args[:name]} emr cluster"
6
- _output "#{args[:name]} emr cluster master public dns", ref_value: [ "#{args[:name]} emr cluster", "MasterPublicDNS" ]
6
+ _output "#{args[:name]} emr cluster",
7
+ ref_value: "#{args[:name]} emr cluster",
8
+ export: _export_string(args, "erm cluster")
9
+ _output "#{args[:name]} emr cluster master public dns",
10
+ ref_value: [ "#{args[:name]} emr cluster", "MasterPublicDNS" ],
11
+ export: _export_string(args, "erm cluster master public dns")
@@ -1,6 +1,11 @@
1
1
  #
2
2
  # Output IAM instance profile
3
3
  #
4
+ require 'kumogata/template/helper'
4
5
 
5
- _output "#{args[:name]} instance profile", ref_value: "#{args[:name]} instance profile"
6
- _output "#{args[:name]} instance profile arn", ref_value: [ "#{args[:name]} instance profile", "Arn" ]
6
+ _output "#{args[:name]} instance profile",
7
+ ref_value: "#{args[:name]} instance profile",
8
+ export: _export_string(args, "instance profile")
9
+ _output "#{args[:name]} instance profile arn",
10
+ ref_value: [ "#{args[:name]} instance profile", "Arn" ],
11
+ export: _export_string(args, "profile arn")
@@ -1,6 +1,11 @@
1
1
  #
2
2
  # Output IAM role
3
3
  #
4
+ require 'kumogata/template/helper'
4
5
 
5
- _output "#{args[:name]} role", ref_value: "#{args[:name]} role"
6
- _output "#{args[:name]} role arn", ref_value: [ "#{args[:name]} role", "Arn" ]
6
+ _output "#{args[:name]} role",
7
+ ref_value: "#{args[:name]} role",
8
+ export: _export_string(args, "role")
9
+ _output "#{args[:name]} role arn",
10
+ ref_value: [ "#{args[:name]} role", "Arn" ],
11
+ export: _export_string(args, "role arn")