kumogata-template 0.0.35 → 0.0.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (278) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +4 -2
  3. data/Gemfile +1 -1
  4. data/Rakefile +1 -1
  5. data/kumogata-template.gemspec +4 -4
  6. data/lib/kumogata/template/alb.rb +48 -34
  7. data/lib/kumogata/template/api-gateway.rb +262 -0
  8. data/lib/kumogata/template/autoscaling.rb +17 -44
  9. data/lib/kumogata/template/certificate.rb +11 -8
  10. data/lib/kumogata/template/cloudfront.rb +67 -60
  11. data/lib/kumogata/template/cloudwatch.rb +7 -12
  12. data/lib/kumogata/template/codebuild.rb +4 -8
  13. data/lib/kumogata/template/codecommit.rb +2 -6
  14. data/lib/kumogata/template/codedeploy.rb +15 -0
  15. data/lib/kumogata/template/cognito.rb +203 -0
  16. data/lib/kumogata/template/const.rb +109 -47
  17. data/lib/kumogata/template/datapipeline.rb +16 -47
  18. data/lib/kumogata/template/dynamodb.rb +17 -8
  19. data/lib/kumogata/template/ec2.rb +61 -10
  20. data/lib/kumogata/template/ecr.rb +11 -9
  21. data/lib/kumogata/template/ecs.rb +256 -91
  22. data/lib/kumogata/template/elasticbeanstalk.rb +6 -9
  23. data/lib/kumogata/template/elb.rb +9 -24
  24. data/lib/kumogata/template/emr.rb +184 -51
  25. data/lib/kumogata/template/events.rb +22 -10
  26. data/lib/kumogata/template/ext/kumogata.rb +7 -7
  27. data/lib/kumogata/template/helper.rb +189 -130
  28. data/lib/kumogata/template/iam.rb +556 -146
  29. data/lib/kumogata/template/kinesis.rb +282 -0
  30. data/lib/kumogata/template/lambda.rb +43 -2
  31. data/lib/kumogata/template/logs.rb +2 -6
  32. data/lib/kumogata/template/nlb.rb +10 -0
  33. data/lib/kumogata/template/pinpoint.rb +83 -0
  34. data/lib/kumogata/template/rds.rb +52 -0
  35. data/lib/kumogata/template/redshift.rb +15 -6
  36. data/lib/kumogata/template/role.rb +425 -0
  37. data/lib/kumogata/template/s3.rb +120 -80
  38. data/lib/kumogata/template/sns.rb +2 -6
  39. data/lib/kumogata/template/version.rb +1 -1
  40. data/lib/kumogata/template.rb +9 -1
  41. data/template/_template.rb +2 -2
  42. data/template/alb-load-balancer.rb +5 -4
  43. data/template/alb-target-group.rb +8 -9
  44. data/template/api-gateway-account.rb +15 -0
  45. data/template/api-gateway-api-key.rb +22 -0
  46. data/template/api-gateway-authorizer.rb +38 -0
  47. data/template/api-gateway-base-path-mapping.rb +23 -0
  48. data/template/api-gateway-client-certificate.rb +16 -0
  49. data/template/api-gateway-deployment.rb +24 -0
  50. data/template/api-gateway-domain-name.rb +17 -0
  51. data/template/api-gateway-method.rb +71 -0
  52. data/template/api-gateway-model.rb +23 -0
  53. data/template/api-gateway-resource.rb +32 -0
  54. data/template/api-gateway-rest-api.rb +29 -0
  55. data/template/api-gateway-stage.rb +33 -0
  56. data/template/api-gateway-usage-plan-key.rb +19 -0
  57. data/template/api-gateway-usage-plan.rb +24 -0
  58. data/template/autoscaling-group.rb +2 -2
  59. data/template/autoscaling-launch-configuration.rb +7 -4
  60. data/template/autoscaling-scheduled-action.rb +0 -1
  61. data/template/certificate.rb +2 -2
  62. data/template/cloudfront-distribution.rb +4 -0
  63. data/template/cloudfront-origin-access-identity.rb +19 -0
  64. data/template/cloudtrail.rb +6 -4
  65. data/template/cloudwatch-alarm.rb +9 -3
  66. data/template/codebuild-project.rb +3 -3
  67. data/template/codecommit-repository.rb +2 -2
  68. data/template/codedeploy-application.rb +1 -1
  69. data/template/codedeploy-deployment-config.rb +1 -1
  70. data/template/codedeploy-deployment-group.rb +2 -0
  71. data/template/cognito-identity-pool.rb +34 -0
  72. data/template/cognito-identity-role-attachment.rb +22 -0
  73. data/template/cognito-user-pool-client.rb +28 -0
  74. data/template/cognito-user-pool-group.rb +24 -0
  75. data/template/cognito-user-pool-user-to-group-attachment.rb +20 -0
  76. data/template/cognito-user-pool-user.rb +28 -0
  77. data/template/cognito-user-pool.rb +45 -0
  78. data/template/datapipeline-pipeline.rb +4 -4
  79. data/template/dynamodb-table.rb +5 -1
  80. data/template/ec2-eip-association.rb +1 -1
  81. data/template/ec2-instance.rb +4 -1
  82. data/template/ec2-nat-gateway.rb +4 -0
  83. data/template/ec2-route.rb +4 -0
  84. data/template/ec2-security-group-ingress.rb +1 -1
  85. data/template/ec2-security-group.rb +2 -2
  86. data/template/ec2-subnet.rb +8 -4
  87. data/template/ec2-volume.rb +1 -2
  88. data/template/ec2-vpc-cidr-block.rb +4 -2
  89. data/template/ec2-vpc-endpoint.rb +5 -2
  90. data/template/ecr-repository.rb +2 -2
  91. data/template/ecs-cluster.rb +1 -1
  92. data/template/ecs-service.rb +19 -7
  93. data/template/ecs-task-definition.rb +4 -4
  94. data/template/elasticache-cache-cluster.rb +1 -1
  95. data/template/elasticache-parameter-group.rb +1 -1
  96. data/template/elasticache-replication-group.rb +1 -1
  97. data/template/elasticache-subnet-group.rb +1 -1
  98. data/template/elasticbeanstalk-application-version.rb +1 -1
  99. data/template/elasticbeanstalk-application.rb +1 -1
  100. data/template/elasticbeanstalk-configuration-template.rb +1 -1
  101. data/template/elasticbeanstalk-environment.rb +1 -1
  102. data/template/elb-load-balancer.rb +2 -2
  103. data/template/emr-cluster.rb +3 -3
  104. data/template/emr-instance-group-config.rb +4 -2
  105. data/template/emr-security-configuration.rb +17 -0
  106. data/template/emr-step.rb +2 -2
  107. data/template/events-rule.rb +8 -8
  108. data/template/iam-group.rb +2 -2
  109. data/template/iam-instance-profile.rb +2 -2
  110. data/template/iam-managed-policy.rb +1 -1
  111. data/template/iam-policy.rb +1 -1
  112. data/template/iam-role.rb +17 -2
  113. data/template/iam-user.rb +4 -4
  114. data/template/kinesis-firehose-delivery-stream.rb +36 -0
  115. data/template/kinesis-stream.rb +21 -0
  116. data/template/kms-alias.rb +2 -2
  117. data/template/kms-key.rb +1 -1
  118. data/template/lambda-alias.rb +2 -2
  119. data/template/lambda-event-source-mapping.rb +4 -4
  120. data/template/lambda-function.rb +17 -17
  121. data/template/lambda-permission.rb +31 -10
  122. data/template/lambda-version.rb +4 -2
  123. data/template/logs-destination.rb +1 -1
  124. data/template/logs-log-group.rb +1 -1
  125. data/template/logs-log-stream.rb +4 -2
  126. data/template/logs-metric-filter.rb +1 -1
  127. data/template/logs-subscription_filter.rb +1 -1
  128. data/template/mappings-ec2.rb +114 -52
  129. data/template/output-arn.rb +12 -4
  130. data/template/output-certificate.rb +11 -0
  131. data/template/output-distribution.rb +11 -0
  132. data/template/output-domain-name.rb +11 -0
  133. data/template/output-ecr-repository.rb +16 -0
  134. data/template/output-eip.rb +11 -0
  135. data/template/output-lambda-function.rb +6 -0
  136. data/template/output-name.rb +7 -2
  137. data/template/output-origin-access-identity.rb +13 -0
  138. data/template/output-rds-cluster.rb +17 -0
  139. data/template/{output-rds.rb → output-rds-instance.rb} +1 -1
  140. data/template/output-redshift.rb +11 -0
  141. data/template/output-rest-api.rb +11 -0
  142. data/template/output-s3.rb +3 -0
  143. data/template/output-stage.rb +19 -0
  144. data/template/output-subnet.rb +6 -3
  145. data/template/output-trail.rb +14 -0
  146. data/template/output-user-pool-client.rb +14 -0
  147. data/template/output-user-pool.rb +17 -0
  148. data/template/output-vpc.rb +13 -3
  149. data/template/output.rb +3 -2
  150. data/template/parameter-ec2.rb +10 -4
  151. data/template/parameter-elasticache.rb +1 -1
  152. data/template/parameter-rds.rb +51 -4
  153. data/template/parameter-redshift.rb +31 -1
  154. data/template/parameter.rb +87 -7
  155. data/template/rds-db-cluster-parameter-group.rb +18 -4
  156. data/template/rds-db-cluster.rb +19 -7
  157. data/template/rds-db-instance.rb +55 -131
  158. data/template/rds-db-parameter-group.rb +29 -3
  159. data/template/rds-db-subnet-group.rb +1 -1
  160. data/template/rds-event-subscription.rb +2 -4
  161. data/template/rds-option-group.rb +28 -5
  162. data/template/redshift-cluster-parameter-group.rb +3 -1
  163. data/template/redshift-cluster-security-group.rb +17 -0
  164. data/template/redshift-cluster-subnet-group.rb +3 -1
  165. data/template/redshift-cluster.rb +15 -12
  166. data/template/s3-bucket.rb +10 -5
  167. data/template/sns-topic.rb +2 -2
  168. data/template/sqs-queue.rb +1 -1
  169. data/test/abstract_unit.rb +2 -9
  170. data/test/cloudfront_test.rb +57 -28
  171. data/test/codedeploy_test.rb +21 -0
  172. data/test/datapipeline_test.rb +0 -22
  173. data/test/ec2_test.rb +12 -52
  174. data/test/ecs_test.rb +30 -26
  175. data/test/emr_test.rb +101 -20
  176. data/test/events_test.rb +47 -0
  177. data/test/helper_test.rb +251 -281
  178. data/test/iam_test.rb +572 -57
  179. data/test/lambda_test.rb +1 -1
  180. data/test/s3_test.rb +49 -14
  181. data/test/template/alb-load-balancer_test.rb +4 -5
  182. data/test/template/alb-target-group_test.rb +1 -3
  183. data/test/template/api-gateway-account_test.rb +26 -0
  184. data/test/template/api-gateway-api-key_test.rb +33 -0
  185. data/test/template/api-gateway-authorizer_test.rb +62 -0
  186. data/test/template/api-gateway-base-path-mapping_test.rb +27 -0
  187. data/test/template/api-gateway-client-certificate_test.rb +21 -0
  188. data/test/template/api-gateway-deployment_test.rb +27 -0
  189. data/test/template/api-gateway-domain-name_test.rb +26 -0
  190. data/test/template/api-gateway-method_test.rb +29 -0
  191. data/test/template/api-gateway-model_test.rb +37 -0
  192. data/test/template/api-gateway-resource_test.rb +82 -0
  193. data/test/template/api-gateway-rest-api_test.rb +33 -0
  194. data/test/template/api-gateway-stage_test.rb +39 -0
  195. data/test/template/api-gateway-usage-plan-key_test.rb +25 -0
  196. data/test/template/api-gateway-usage-plan_test.rb +42 -0
  197. data/test/template/cloudfront-distribution_test.rb +41 -3
  198. data/test/template/cloudtrail_test.rb +13 -5
  199. data/test/template/cloudwatch-alarm_test.rb +14 -2
  200. data/test/template/codebuild-project_test.rb +2 -11
  201. data/test/template/codecommit-repository_test.rb +12 -1
  202. data/test/template/cognito-identity-pool_test.rb +32 -0
  203. data/test/template/cognito-identity-role-attachment_test.rb +38 -0
  204. data/test/template/cognito-user-pool-client_test.rb +36 -0
  205. data/test/template/cognito-user-pool-group_test.rb +36 -0
  206. data/test/template/cognito-user-pool-user-to-group-attachment_test.rb +29 -0
  207. data/test/template/cognito-user-pool-user_test.rb +38 -0
  208. data/test/template/cognito-user-pool_test.rb +99 -0
  209. data/test/template/datapipeline-pipeline_test.rb +45 -6
  210. data/test/template/dynamodb-table_test.rb +19 -1
  211. data/test/template/ec2-instance_test.rb +9 -1
  212. data/test/template/ec2-nat-gateway_test.rb +29 -1
  213. data/test/template/ec2-security-group-egress_test.rb +1 -0
  214. data/test/template/ec2-security-group-ingress_test.rb +1 -0
  215. data/test/template/ec2-security-group_test.rb +11 -1
  216. data/test/template/ec2-spot-fleet_test.rb +1 -1
  217. data/test/template/ec2-subnet_test.rb +62 -1
  218. data/test/template/ec2-vpc-cidr-block_test.rb +1 -1
  219. data/test/template/ec2-vpc-endpoint_test.rb +56 -0
  220. data/test/template/ecr-repository_test.rb +63 -11
  221. data/test/template/ecs-service_test.rb +13 -2
  222. data/test/template/ecs-task-definition_test.rb +86 -13
  223. data/test/template/elasticache-cache-cluster_test.rb +4 -6
  224. data/test/template/elasticache-replication-group_test.rb +1 -1
  225. data/test/template/elasticbeanstalk-application-version_test.rb +1 -0
  226. data/test/template/elasticbeanstalk-application_test.rb +2 -1
  227. data/test/template/elasticbeanstalk-configuration-template_test.rb +2 -1
  228. data/test/template/elasticbeanstalk-template_test.rb +1 -0
  229. data/test/template/elb-load-balancer_test.rb +1 -3
  230. data/test/template/emr-cluster_test.rb +2 -14
  231. data/test/template/emr-instance-group-config_test.rb +2 -4
  232. data/test/template/emr-security-configuration_test.rb +34 -0
  233. data/test/template/emr-step_test.rb +2 -6
  234. data/test/template/events-rule_test.rb +3 -3
  235. data/test/template/iam-group_test.rb +11 -1
  236. data/test/template/iam-instance-profile_test.rb +11 -1
  237. data/test/template/iam-managed-policy_test.rb +1 -0
  238. data/test/template/iam-policy_test.rb +1 -3
  239. data/test/template/iam-role_test.rb +12 -2
  240. data/test/template/iam-user_test.rb +11 -17
  241. data/test/template/kinesis-firehorse-delivery-stream_test.rb +68 -0
  242. data/test/template/kinesis-stream_test.rb +61 -0
  243. data/test/template/kms-key_test.rb +1 -0
  244. data/test/template/lambda-alias_test.rb +2 -3
  245. data/test/template/lambda-event-source-mapping_test.rb +1 -1
  246. data/test/template/lambda-function_test.rb +20 -32
  247. data/test/template/lambda-permission_test.rb +7 -4
  248. data/test/template/lambda-version_test.rb +5 -2
  249. data/test/template/logs-log-group_test.rb +1 -3
  250. data/test/template/logs-log-stream_test.rb +2 -6
  251. data/test/template/logs-metric-filter_test.rb +1 -3
  252. data/test/template/logs-subscription-filter_test.rb +1 -3
  253. data/test/template/mappings-ec2_test.rb +10 -3
  254. data/test/template/output-domain-name_test.rb +30 -0
  255. data/test/template/output-name_test.rb +9 -0
  256. data/test/template/{output-rds_test.rb → output-rds-instance_test.rb} +2 -2
  257. data/test/template/output-rest-api_test.rb +30 -0
  258. data/test/template/output-s3_test.rb +9 -0
  259. data/test/template/output-stage_test.rb +43 -0
  260. data/test/template/output-user-pool-client_test.rb +39 -0
  261. data/test/template/output-user-pool_test.rb +48 -0
  262. data/test/template/output_test.rb +3 -1
  263. data/test/template/parameter-ec2_test.rb +22 -24
  264. data/test/template/parameter-elasticache_test.rb +2 -1
  265. data/test/template/parameter-rds_test.rb +32 -3
  266. data/test/template/parameter-redshift_test.rb +31 -2
  267. data/test/template/parameter_test.rb +37 -4
  268. data/test/template/rds-db-cluster-parameter-group_test.rb +1 -1
  269. data/test/template/rds-db-cluster_test.rb +4 -20
  270. data/test/template/rds-db-instance_test.rb +3 -373
  271. data/test/template/rds-db-parameter-group_test.rb +1 -1
  272. data/test/template/rds-option-group_test.rb +2 -2
  273. data/test/template/redshift-cluster-parameter-group_test.rb +28 -0
  274. data/test/template/redshift-cluster-security-group_test.rb +49 -0
  275. data/test/template/redshift-cluster-subnet-group_test.rb +28 -0
  276. data/test/template/redshift-cluster_test.rb +33 -5
  277. data/test/template/s3-bucket_test.rb +6 -20
  278. metadata +130 -22
@@ -8,6 +8,15 @@ _output_s3 "test", domain: true
8
8
  act_template = run_client_as_json(template)
9
9
  exp_template = <<-EOS
10
10
  {
11
+ "TestBucketS3Arn": {
12
+ "Description": "description of TestBucketS3Arn",
13
+ "Value": {
14
+ "Fn::GetAtt": [
15
+ "TestBucket",
16
+ "Arn"
17
+ ]
18
+ }
19
+ },
11
20
  "TestBucketS3DomainName": {
12
21
  "Description": "description of TestBucketS3DomainName",
13
22
  "Value": {
@@ -0,0 +1,43 @@
1
+ require 'abstract_unit'
2
+
3
+ class OutputStageTest < Minitest::Test
4
+ def test_normal
5
+ template = <<-EOS
6
+ _output_stage "test"
7
+ EOS
8
+ act_template = run_client_as_json(template)
9
+ exp_template = <<-EOS
10
+ {
11
+ "TestStage": {
12
+ "Description": "description of TestStage",
13
+ "Value": {
14
+ "Ref": "TestStage"
15
+ }
16
+ },
17
+ "TestStageInvokeUrl": {
18
+ "Description": "description of TestStageInvokeUrl",
19
+ "Value": {
20
+ "Fn::Join": [
21
+ "",
22
+ [
23
+ "https://",
24
+ {
25
+ "Ref": "TestRestApi"
26
+ },
27
+ ".execute-api.",
28
+ {
29
+ "Ref": "AWS::Region"
30
+ },
31
+ ".#{DOMAIN}/",
32
+ {
33
+ "Ref": "TestStage"
34
+ }
35
+ ]
36
+ ]
37
+ }
38
+ }
39
+ }
40
+ EOS
41
+ assert_equal exp_template.chomp, act_template
42
+ end
43
+ end
@@ -0,0 +1,39 @@
1
+ require 'abstract_unit'
2
+
3
+ class OutputUserPoolClientTest < Minitest::Test
4
+ def test_normal
5
+ template = <<-EOS
6
+ _output_user_pool_client "test"
7
+ EOS
8
+ act_template = run_client_as_json(template)
9
+ exp_template = <<-EOS
10
+ {
11
+ "TestUserPoolClient": {
12
+ "Description": "description of TestUserPoolClient",
13
+ "Value": {
14
+ "Ref": "TestUserPoolClient"
15
+ }
16
+ },
17
+ "TestUserPoolClientSecret": {
18
+ "Description": "description of TestUserPoolClientSecret",
19
+ "Value": {
20
+ "Fn::GetAtt": [
21
+ "TestUserPoolClient",
22
+ "ClientSecret"
23
+ ]
24
+ }
25
+ },
26
+ "TestUserPoolClientName": {
27
+ "Description": "description of TestUserPoolClientName",
28
+ "Value": {
29
+ "Fn::GetAtt": [
30
+ "TestUserPoolClient",
31
+ "Name"
32
+ ]
33
+ }
34
+ }
35
+ }
36
+ EOS
37
+ assert_equal exp_template.chomp, act_template
38
+ end
39
+ end
@@ -0,0 +1,48 @@
1
+ require 'abstract_unit'
2
+
3
+ class OutputUserPoolTest < Minitest::Test
4
+ def test_normal
5
+ template = <<-EOS
6
+ _output_user_pool "test"
7
+ EOS
8
+ act_template = run_client_as_json(template)
9
+ exp_template = <<-EOS
10
+ {
11
+ "TestUserPool": {
12
+ "Description": "description of TestUserPool",
13
+ "Value": {
14
+ "Ref": "TestUserPool"
15
+ }
16
+ },
17
+ "TestUserPoolProviderName": {
18
+ "Description": "description of TestUserPoolProviderName",
19
+ "Value": {
20
+ "Fn::GetAtt": [
21
+ "TestUserPool",
22
+ "ProviderName"
23
+ ]
24
+ }
25
+ },
26
+ "TestUserPoolProviderUrl": {
27
+ "Description": "description of TestUserPoolProviderUrl",
28
+ "Value": {
29
+ "Fn::GetAtt": [
30
+ "TestUserPool",
31
+ "ProviderURL"
32
+ ]
33
+ }
34
+ },
35
+ "TestUserPoolArn": {
36
+ "Description": "description of TestUserPoolArn",
37
+ "Value": {
38
+ "Fn::GetAtt": [
39
+ "TestUserPool",
40
+ "Arn"
41
+ ]
42
+ }
43
+ }
44
+ }
45
+ EOS
46
+ assert_equal exp_template.chomp, act_template
47
+ end
48
+ end
@@ -10,7 +10,9 @@ _output "test"
10
10
  {
11
11
  "Test": {
12
12
  "Description": "description of Test",
13
- "Value": "Test"
13
+ "Value": {
14
+ "Ref": "Test"
15
+ }
14
16
  }
15
17
  }
16
18
  EOS
@@ -6,11 +6,7 @@ class ParameterEc2Test < Minitest::Test
6
6
  _parameter_ec2 "test"
7
7
  EOS
8
8
  act_template = run_client_as_json(template)
9
- allowed_values = []
10
- EC2_INSTANCE_TYPES.each do |type|
11
- allowed_values << "#{type}"
12
- end
13
- allowed_values = JSON.generate(allowed_values)
9
+ values = JSON.generate(EC2_INSTANCE_TYPES)
14
10
  .gsub("[", "[\n ")
15
11
  .gsub("\",", "\",\n ")
16
12
  .gsub("\"]", "\"\n ]")
@@ -19,13 +15,15 @@ _parameter_ec2 "test"
19
15
  "TestInstanceType": {
20
16
  "Type": "String",
21
17
  "Default": "#{EC2_DEFAULT_INSTANCE_TYPE}",
22
- "AllowedValues": #{allowed_values},
23
- "Description": "test instance type"
18
+ "Description": "test instance type",
19
+ "AllowedValues": #{values},
20
+ "NoEcho": "false"
24
21
  },
25
- "TestDataVolumeSize": {
26
- "Type": "String",
27
- "Default": "100",
28
- "Description": "test data volume size"
22
+ "TestRootVolumeSize": {
23
+ "Type": "Number",
24
+ "Default": "8",
25
+ "Description": "test root volume size",
26
+ "NoEcho": "false"
29
27
  }
30
28
  }
31
29
  EOS
@@ -35,11 +33,7 @@ _parameter_ec2 "test"
35
33
  _parameter_ec2 "test", iam_instance: "test", key_name: "test"
36
34
  EOS
37
35
  act_template = run_client_as_json(template)
38
- allowed_values = []
39
- EC2_INSTANCE_TYPES.each do |type|
40
- allowed_values << "#{type}"
41
- end
42
- allowed_values = JSON.generate(allowed_values)
36
+ values = JSON.generate(EC2_INSTANCE_TYPES)
43
37
  .gsub("[", "[\n ")
44
38
  .gsub("\",", "\",\n ")
45
39
  .gsub("\"]", "\"\n ]")
@@ -48,23 +42,27 @@ _parameter_ec2 "test", iam_instance: "test", key_name: "test"
48
42
  "TestInstanceType": {
49
43
  "Type": "String",
50
44
  "Default": "#{EC2_DEFAULT_INSTANCE_TYPE}",
51
- "AllowedValues": #{allowed_values},
52
- "Description": "test instance type"
45
+ "Description": "test instance type",
46
+ "AllowedValues": #{values},
47
+ "NoEcho": "false"
53
48
  },
54
49
  "TestIamInstanceProfile": {
55
50
  "Type": "String",
56
51
  "Default": "test",
57
- "Description": "test iam instance profile"
52
+ "Description": "test iam instance profile",
53
+ "NoEcho": "false"
58
54
  },
59
- "TestDataVolumeSize": {
60
- "Type": "String",
61
- "Default": "100",
62
- "Description": "test data volume size"
55
+ "TestRootVolumeSize": {
56
+ "Type": "Number",
57
+ "Default": "8",
58
+ "Description": "test root volume size",
59
+ "NoEcho": "false"
63
60
  },
64
61
  "TestKeyName": {
65
62
  "Type": "AWS::EC2::KeyPair::KeyName",
66
63
  "Default": "test",
67
- "Description": "test key name"
64
+ "Description": "test key name",
65
+ "NoEcho": "false"
68
66
  }
69
67
  }
70
68
  EOS
@@ -18,10 +18,11 @@ _parameter_elasticache "test"
18
18
  "TestCacheNodeTypes": {
19
19
  "Type": "String",
20
20
  "Default": "#{ELASTICACHE_DEFAULT_NODE_TYPE}",
21
+ "Description": "test cache node types",
21
22
  "AllowedValues": [
22
23
  #{values.chomp}
23
24
  ],
24
- "Description": "test cache node types"
25
+ "NoEcho": "false"
25
26
  }
26
27
  }
27
28
  EOS
@@ -10,18 +10,47 @@ class ParameterRdsTest < Minitest::Test
10
10
  EOS
11
11
  end
12
12
  template = <<-EOS
13
- _parameter_rds "test"
13
+ _parameter_rds "test", port: "test", user_name: "test", user_password: "test", db_name: "test"
14
14
  EOS
15
15
  act_template = run_client_as_json(template)
16
16
  exp_template = <<-EOS
17
17
  {
18
- "TestDbInstanceClasses": {
18
+ "TestDbInstanceClass": {
19
19
  "Type": "String",
20
20
  "Default": "#{RDS_DEFAULT_INSTANCE_CLASS}",
21
+ "Description": "test db instance db instance classes",
21
22
  "AllowedValues": [
22
23
  #{values.chomp}
23
24
  ],
24
- "Description": "test db instance classes"
25
+ "NoEcho": "false"
26
+ },
27
+ "TestDbPort": {
28
+ "Type": "Number",
29
+ "Default": "test",
30
+ "Description": "test db instance db port",
31
+ "NoEcho": "false"
32
+ },
33
+ "TestDbName": {
34
+ "Type": "String",
35
+ "Default": "test",
36
+ "Description": "test db instance db name",
37
+ "NoEcho": "false"
38
+ },
39
+ "TestDbMasterUserName": {
40
+ "Type": "String",
41
+ "Default": "test",
42
+ "Description": "test db instance db master user name",
43
+ "MaxLength": "16",
44
+ "MinLength": "2",
45
+ "NoEcho": "false"
46
+ },
47
+ "TestDbMasterUserPassword": {
48
+ "Type": "String",
49
+ "Default": "test",
50
+ "Description": "test db instance db master user password",
51
+ "MaxLength": "64",
52
+ "MinLength": "8",
53
+ "NoEcho": "true"
25
54
  }
26
55
  }
27
56
  EOS
@@ -10,7 +10,7 @@ class ParameterRdsInstanceTest < Minitest::Test
10
10
  EOS
11
11
  end
12
12
  template = <<-EOS
13
- _parameter_redshift "test"
13
+ _parameter_redshift "test", port: "test", user_name: "test", user_password: "test", db_name: "test"
14
14
  EOS
15
15
  act_template = run_client_as_json(template)
16
16
  exp_template = <<-EOS
@@ -18,10 +18,39 @@ _parameter_redshift "test"
18
18
  "TestRedshiftClusterNodeTypes": {
19
19
  "Type": "String",
20
20
  "Default": "#{REDSHIFT_DEFAULT_NODE_TYPE}",
21
+ "Description": "test redshift cluster node types",
21
22
  "AllowedValues": [
22
23
  #{values.chomp}
23
24
  ],
24
- "Description": "test redshift cluster node types"
25
+ "NoEcho": "false"
26
+ },
27
+ "TestRedshiftClusterPort": {
28
+ "Type": "Number",
29
+ "Default": "test",
30
+ "Description": "test redshift cluster port",
31
+ "NoEcho": "false"
32
+ },
33
+ "TestRedshiftClusterDbName": {
34
+ "Type": "String",
35
+ "Default": "test",
36
+ "Description": "test redshift cluster db name",
37
+ "NoEcho": "false"
38
+ },
39
+ "TestRedshiftClusterMasterUserName": {
40
+ "Type": "String",
41
+ "Default": "test",
42
+ "Description": "test redshift cluster master user name",
43
+ "MaxLength": "16",
44
+ "MinLength": "2",
45
+ "NoEcho": "false"
46
+ },
47
+ "TestRedshiftClusterMasterUserPassword": {
48
+ "Type": "String",
49
+ "Default": "test",
50
+ "Description": "test redshift cluster master user password",
51
+ "MaxLength": "64",
52
+ "MinLength": "8",
53
+ "NoEcho": "true"
25
54
  }
26
55
  }
27
56
  EOS
@@ -11,28 +11,61 @@ _parameter "test"
11
11
  "Test": {
12
12
  "Type": "String",
13
13
  "Default": "",
14
- "Description": ""
14
+ "Description": "test parameter description",
15
+ "NoEcho": "false"
15
16
  }
16
17
  }
17
18
  EOS
18
19
  assert_equal exp_template.chomp, act_template
19
20
 
20
21
  template = <<-EOS
21
- _parameter "test", { type: "type", default: "default", description: "desc", allowed_values: [ "1", "2" ], no_echo: true }
22
+ _parameter "test", { default: "default", description: "desc", values: %w( 1 2 ) }
22
23
  EOS
23
24
  act_template = run_client_as_json(template)
24
25
  exp_template = <<-EOS
25
26
  {
26
27
  "Test": {
27
- "Type": "type",
28
+ "Type": "String",
28
29
  "Default": "default",
30
+ "Description": "desc",
29
31
  "AllowedValues": [
30
32
  "1",
31
33
  "2"
32
34
  ],
33
- "Description": "desc",
35
+ "NoEcho": "false"
36
+ }
37
+ }
38
+ EOS
39
+ assert_equal exp_template.chomp, act_template
40
+
41
+ template = <<-EOS
42
+ _parameter "test password", { default: "default", no_echo: true }
43
+ EOS
44
+ act_template = run_client_as_json(template)
45
+ exp_template = <<-EOS
46
+ {
47
+ "TestPassword": {
48
+ "Type": "String",
49
+ "Default": "default",
50
+ "Description": "test password parameter description",
34
51
  "NoEcho": "true"
35
52
  }
53
+ }
54
+ EOS
55
+ assert_equal exp_template.chomp, act_template
56
+
57
+ template = <<-EOS
58
+ _parameter "test", { default: "default", type: "instance id" }
59
+ EOS
60
+ act_template = run_client_as_json(template)
61
+ exp_template = <<-EOS
62
+ {
63
+ "Test": {
64
+ "Type": "AWS::EC2::Instance::Id",
65
+ "Default": "default",
66
+ "Description": "test parameter description",
67
+ "NoEcho": "false"
68
+ }
36
69
  }
37
70
  EOS
38
71
  assert_equal exp_template.chomp, act_template
@@ -3,7 +3,7 @@ require 'abstract_unit'
3
3
  class RdsDbClusterParameterGroupTest < Minitest::Test
4
4
  def test_normal
5
5
  template = <<-EOS
6
- _rds_db_cluster_parameter_group "test", parameters: { test: "test" }
6
+ _rds_db_cluster_parameter_group "test", engine: 'aurora', parameters: { test: "test" }
7
7
  EOS
8
8
  act_template = run_client_as_json(template)
9
9
  exp_template = <<-EOS
@@ -3,7 +3,7 @@ require 'abstract_unit'
3
3
  class RdsDbClusterTest < Minitest::Test
4
4
  def test_normal
5
5
  template = <<-EOS
6
- _rds_db_cluster "test", ref_parameter: "test", ref_subnet: "test", ref_user_name: "test", ref_user_password: "test", ref_security_groups: "test"
6
+ _rds_db_cluster "test", ref_parameter: "test", ref_subnet_group: "test", ref_db_name: "test", ref_user_name: "test", ref_user_password: "test", ref_security_groups: "test"
7
7
  EOS
8
8
  act_template = run_client_as_json(template)
9
9
  exp_template = <<-EOS
@@ -11,25 +11,9 @@ _rds_db_cluster "test", ref_parameter: "test", ref_subnet: "test", ref_user_name
11
11
  "TestDbCluster": {
12
12
  "Type": "AWS::RDS::DBCluster",
13
13
  "Properties": {
14
- "AvailabilityZone": {
15
- "Fn::GetAtt": [
16
- "TestSubnet",
17
- "AvailabilityZone"
18
- ]
19
- },
20
14
  "BackupRetentionPeriod": "7",
21
15
  "DatabaseName": {
22
- "Fn::Join": [
23
- "-",
24
- [
25
- {
26
- "Ref": "Service"
27
- },
28
- {
29
- "Ref": "Name"
30
- }
31
- ]
32
- ]
16
+ "Ref": "TestDbName"
33
17
  },
34
18
  "DBClusterParameterGroupName": {
35
19
  "Ref": "TestDbClusterParameterGroup"
@@ -37,8 +21,8 @@ _rds_db_cluster "test", ref_parameter: "test", ref_subnet: "test", ref_user_name
37
21
  "DBSubnetGroupName": {
38
22
  "Ref": "TestDbSubnetGroup"
39
23
  },
40
- "Engine": "aurora",
41
- "EngineVersion": "5.6.10a",
24
+ "Engine": "aurora-mysql",
25
+ "EngineVersion": "#{RDS_DEFAULT_ENGINE_VERSION[:'aurora-mysql']}",
42
26
  "MasterUsername": {
43
27
  "Ref": "TestDbMasterUserName"
44
28
  },