aws-rails-provisioner 0.0.1.rc2 → 0.0.2.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68afffac36f59c3407396efe0c2e84430015937390efc8d8559bcba784288108
4
- data.tar.gz: caee01dde33cc7bfa360ea498879b61411ed1c566bb77d7c1753c40cb0f93512
3
+ metadata.gz: 17ab168eeba12cb5e76d72c022269197cefe803e19515505473e4ee8219ac82a
4
+ data.tar.gz: eb63e2b7c14980ae96b06cc3150cdba437132ff9810604265954119d668eb778
5
5
  SHA512:
6
- metadata.gz: dd7a7daa5f0f58e864e743bda4f0b573a5ffe0940101af0d39f9db34431f18929bc4c286f4d3ac6deffdedde24b52cf217df7c63974394144c83b766c4caa513
7
- data.tar.gz: 514708e81bcd7d0bf322ab65d36619c17275f8dfef09483f9840b2ab19e9c1cd99432943cf9274da1feda9d7fc394d4ff7d17c06979212b062198ba716df1b79
6
+ metadata.gz: 5233a25be1e789b27ae1c5df94b45b0aa43c3de87810912fdb4a1b51e2b523e3ee61d030fa24764dfd91e5972343bc2dd9745d3ca4d63e32b138598a9a697647
7
+ data.tar.gz: ea96c05133c12dd45f3aa00b2142d121468b456dfbd75164f504153a81a5548397f577398ba7ae08e7c21114606ba0f2f56710a75c4be061205835e5d0364250
@@ -125,7 +125,7 @@ elsif options[:deploy]
125
125
  service_name: options[:service_name]
126
126
  }
127
127
  if options[:profile]
128
- deploy_params[:profile] = profile
128
+ deploy_params[:profile] = options[:profile]
129
129
  end
130
130
  deploy_params.merge!(options[:deploy])
131
131
  deployer = Aws::RailsProvisioner::CDKDeployer.new(deploy_params)
@@ -56,6 +56,7 @@ module Aws::RailsProvisioner
56
56
  end
57
57
  Dir.chdir(@cdk_dir) do
58
58
  pkgs.each do |pkg|
59
+ puts "installing pkg: #{pkg} ..."
59
60
  `npm install #{pkg}`
60
61
  end
61
62
  end
@@ -64,7 +65,7 @@ module Aws::RailsProvisioner
64
65
  def _npm_build
65
66
  Dir.chdir(@cdk_dir) do
66
67
  puts "running npm run build ..."
67
- `npm run build`
68
+ `npm run build --verbose`
68
69
  end
69
70
  end
70
71
 
@@ -20,6 +20,7 @@ module Aws::RailsProvisioner
20
20
 
21
21
  def run
22
22
  Dir.chdir(@cdk_dir) do
23
+ `cdk bootstrap`
23
24
  deploy_init_stack
24
25
  unless @init_stack_only
25
26
  if @svc_name
@@ -1,6 +1,6 @@
1
1
  require 'aws-sdk-rds'
2
2
 
3
- module Aws::RailsProvisioner
3
+ module Aws::RailsProvisioner
4
4
  class DBCluster
5
5
 
6
6
  # Configuration value under :db_cluster
@@ -59,9 +59,9 @@ module Aws::RailsProvisioner
59
59
  #
60
60
  # @example: at `aws-rails-provisioner.yml`
61
61
  # parameter_group:
62
- # family: 'aurora-postgresql9.6'
62
+ # family: 'aurora-postgresql11'
63
63
  # description: 'created by AWS RailsProvisioner'
64
- # parameters:
64
+ # parameters:
65
65
  # key: value
66
66
  # @see {Aws::RailsProvisioner::DBCluster::ParameterGroup}
67
67
  #
@@ -178,7 +178,7 @@ module Aws::RailsProvisioner
178
178
  end
179
179
 
180
180
  class ParameterGroup
181
-
181
+
182
182
  # @param [Hash] options
183
183
  #
184
184
  # @option options [String] :family
@@ -223,7 +223,7 @@ module Aws::RailsProvisioner
223
223
 
224
224
  def _default_family
225
225
  case @engine
226
- when 'AURORA_POSTGRESQL' then 'aurora-postgresql9.6'
226
+ when 'AURORA_POSTGRESQL' then 'aurora-postgresql11'
227
227
  when 'AURORA_MYSQL' then 'aurora-mysql5.7'
228
228
  when 'AURORA' then 'aurora5.6'
229
229
  else
@@ -277,7 +277,7 @@ module Aws::RailsProvisioner
277
277
  when 'AURORA' then 'r5.large'
278
278
  else
279
279
  msg = 'Failed to locate a default instance type for :engine'\
280
- ' provided, please provide :instance_type'
280
+ ' provided, please provide :instance_type'
281
281
  raise Aws::RailsProvisioner::Errors::ValidationError, msg
282
282
  end
283
283
  end
@@ -289,7 +289,7 @@ module Aws::RailsProvisioner
289
289
  when 'AURORA' then 3306
290
290
  else
291
291
  msg = 'Failed to locate a default db port for :engine'\
292
- ' provided, please provide :port'
292
+ ' provided, please provide :port'
293
293
  raise Aws::RailsProvisioner::Errors::ValidationError, msg
294
294
  end
295
295
 
@@ -20,7 +20,7 @@ module Aws::RailsProvisioner
20
20
  # to `buildspec-db.yml` under root directory, using template under
21
21
  # `buildspecs/`
22
22
  #
23
- # @option options [String] :build_image default to codebuild `standard_1_0`
23
+ # @option options [String] :build_image default to codebuild `standard_4_0`
24
24
  # full list of supported images see:
25
25
  # https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-codebuild.LinuxBuildImage.html
26
26
  #
@@ -36,7 +36,7 @@ module Aws::RailsProvisioner
36
36
  options[:buildspec] = 'buildspec-db.yml'
37
37
  end
38
38
  unless options[:build_image]
39
- options[:build_image] = 'standard_1_0'
39
+ options[:build_image] = 'standard_4_0'
40
40
  end
41
41
  # TODO envs support?
42
42
  super(options)
@@ -1,20 +1,20 @@
1
1
  module Aws::RailsProvisioner
2
2
  # @api private
3
3
  class ServiceEnumerator
4
-
4
+
5
5
  include Enumerable
6
6
 
7
7
  def initialize(options = {})
8
- @configs = options || {}
8
+ @configs = options || {}
9
9
  end
10
10
 
11
- # @param [String] name
11
+ # @param [String] name
12
12
  def [](name)
13
13
  if services.key?(name)
14
14
  services[name]
15
15
  else
16
- msg = "unknown service #{identifier.inspect} under :services"
17
- raise Aws::RailsProvisioner::ValidationError, msg
16
+ msg = "unknown service #{name} under :services"
17
+ raise Aws::RailsProvisioner::Errors::ValidationError, msg
18
18
  end
19
19
  end
20
20
  alias service []
@@ -45,7 +45,6 @@ module Aws::RailsProvisioner
45
45
  base = [
46
46
  { abbr: 'ec2', value: 'ec2' },
47
47
  { abbr: 'ecs', value: 'ecs' },
48
- { abbr: 'ecr', value: 'ecr' },
49
48
  { abbr: 'ecs_patterns', value: 'ecs-patterns' },
50
49
  { abbr: 'ecr_assets', value: 'ecr-assets' },
51
50
  { abbr: 'rds', value: 'rds' }
@@ -93,7 +93,7 @@ export class {{stack_prefix}}FargateStack extends cdk.Stack {
93
93
  instances: {{instances}},
94
94
  parameterGroup: clusterParameterGroup
95
95
  });
96
- const dbUrl = {{#postgres}}"postgres://"{{/postgres}}{{^postgres}}"mysql2://"{{/postgres}} + username + ":" + password + "@" + db.clusterEndpoint.socketAddress;
96
+ const dbUrl = {{#postgres}}"postgres://"{{/postgres}}{{^postgres}}"mysql2://"{{/postgres}} + username + ":" + password + "@" + db.clusterEndpoint.socketAddress + "/{{db_name}}";
97
97
  this.dbUrl = dbUrl;
98
98
  {{/db_cluster}}
99
99
 
@@ -106,8 +106,7 @@ export class {{stack_prefix}}FargateStack extends cdk.Stack {
106
106
  const repoName = parts.slice(1, parts.length).join("/").split(":")[0];
107
107
  this.repoName = repoName;
108
108
 
109
- const ecrRepo = ecr.Repository.fromRepositoryName(this, 'EcrRepo', repoName);
110
- const image = ecs.ContainerImage.fromEcrRepository(ecrRepo);
109
+ const image = ecs.ContainerImage.fromDockerImageAsset(asset);
111
110
 
112
111
  {{#fargate}}
113
112
  // Fargate service
@@ -122,7 +121,7 @@ export class {{stack_prefix}}FargateStack extends cdk.Stack {
122
121
  containerPort: {{container_port}},
123
122
  environment: {
124
123
  {{#has_db}}
125
- 'DATABASE_URL': dbUrl,
124
+ 'DATABASE_URL': dbUrl,
126
125
  {{/has_db}}
127
126
  {{#envs}}
128
127
  {{{.}}}
@@ -241,7 +240,7 @@ export class {{stack_prefix}}FargateStack extends cdk.Stack {
241
240
  {{/on_metric}}
242
241
  {{#on_request}}
243
242
  scaling.scaleOnRequestCount('FargateScalingOnRequest', {
244
- requestsPerTarget: {{requests_per_target}},
243
+ requestsPerTarget: {{requests_per_target}},
245
244
  targetGroup: target,
246
245
  {{#disable_scale_in}}
247
246
  disableScaleIn: true,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-rails-provisioner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.rc2
4
+ version: 0.0.2.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-14 00:00:00.000000000 Z
11
+ date: 2020-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-rds