AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Class: Aws::RailsProvisioner::Migration

Inherits:
CodeBuild
  • Object
show all
Defined in:
lib/aws-rails-provisioner/migration.rb

Instance Attribute Summary

Attributes inherited from CodeBuild

#buildspec, #description, #image, #project_name, #timeout

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Migration

An AWS CodeBuild Project that runs DB migration for the Ruby on Rails App inside private subnet of the VPC

configuration for :migration

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :project_name (String)

    name for the CodeBuild project, default to 'SERVICE_NAMEDBMigration'

  • :description (String)

    description for this CodeBuild project, default to 'running DB Migration for

    the rails app inside private subnet'
    
  • :buildspec (String)

    buildspec.yml file path, default to `buildspec-db.yml` under root directory, using template under `buildspecs/`

  • :build_image (String)

    default to codebuild `standard_4_0` full list of supported images see: docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-codebuild.LinuxBuildImage.html

  • :timeout (Integer)

    number of minutes after which CodeBuild stops the build if it’s not complete



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/aws-rails-provisioner/migration.rb', line 30

def initialize(options = {})
  unless options[:description]
    options[:description] = 'running DB Migration for'\
      ' the rails app inside private subnet'
  end
  unless options[:buildspec]
    options[:buildspec] = 'buildspec-db.yml'
  end
  unless options[:build_image]
    options[:build_image] = 'standard_4_0'
  end
  # TODO envs support?
  super(options)
end