Sha256: 96809a9612be98d7b88e7a4691b14aa464acfd8be24a1928a617093593d67b00

Contents?: true

Size: 806 Bytes

Versions: 14

Compression:

Stored size: 806 Bytes

Contents

# Detects route changes
class Jets::Cfn::Resource::ApiGateway::RestApi::Routes
  class Change
    include Jets::AwsServices

    def changed?
      return false unless parent_stack_exists?
      return true if reset?

      # Note: Variable.changed? will likely always true in one_apigw_method_for_all_routes mode
      # since parent variables are allowed to vary in Jets v5.
      if Jets.config.cfn.build.routes == "one_apigw_method_for_all_routes"
        MediaTypes.changed? || To.changed?
      else
        MediaTypes.changed? || To.changed? || Variable.changed? || Page.changed?
      end
    end

    def reset?
      ENV['JETS_RESET'] || ENV['JETS_API_REPLACE'] || ENV['JETS_REPLACE_API']
    end

    def parent_stack_exists?
      stack_exists?(Jets::Names.parent_stack_name)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
jets-5.0.13 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.12 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.11 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.10 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.9 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.8 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.7 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.6 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.5 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.4 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.3 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.2 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.1 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb
jets-5.0.0 lib/jets/cfn/resource/api_gateway/rest_api/routes/change.rb