Sha256: efb0fc0b37daabb224466839179d39a752bbddcfd3922671175c9d1795f93ff9

Contents?: true

Size: 1.49 KB

Versions: 10

Compression:

Stored size: 1.49 KB

Contents

module CfnGuardian::Resource
    class RDSCluster < Base
           
      def default_event_subscriptions()
        event_subscription = CfnGuardian::Models::RDSClusterEventSubscription.new(@resource)
        event_subscription.name = 'FailoverFailed'
        event_subscription.event_id = 'RDS-EVENT-0069'
        @event_subscriptions.push(event_subscription)

        event_subscription = CfnGuardian::Models::RDSClusterEventSubscription.new(@resource)
        event_subscription.name = 'FailoverFinished'
        event_subscription.event_id = 'RDS-EVENT-0071'
        @event_subscriptions.push(event_subscription)

        event_subscription = CfnGuardian::Models::RDSClusterEventSubscription.new(@resource)
        event_subscription.name = 'FailoverStartedSameAZ'
        event_subscription.event_id = 'RDS-EVENT-0072'
        @event_subscriptions.push(event_subscription)

        event_subscription = CfnGuardian::Models::RDSClusterEventSubscription.new(@resource)
        event_subscription.name = 'FailoverStartedDifferentAZ'
        event_subscription.event_id = 'RDS-EVENT-0073'
        @event_subscriptions.push(event_subscription)
      end
  
      def resource_exists?
        client = Aws::RDS::Client.new
        resource = Aws::RDS::Resource.new(client: client)
        instance = resource.db_cluster(@resource['Id'])
  
        begin
          instance.load
        rescue Aws::RDS::Errors::DBClusterNotFoundFault
          return false
        end
        
        return true
      end

    end
  end
  

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cfn-guardian-0.11.11 lib/cfnguardian/resources/rds_cluster.rb
cfn-guardian-0.11.10 lib/cfnguardian/resources/rds_cluster.rb
cfn-guardian-0.11.9 lib/cfnguardian/resources/rds_cluster.rb
cfn-guardian-0.11.8 lib/cfnguardian/resources/rds_cluster.rb
cfn-guardian-0.11.7 lib/cfnguardian/resources/rds_cluster.rb
cfn-guardian-0.11.6 lib/cfnguardian/resources/rds_cluster.rb
cfn-guardian-0.11.5 lib/cfnguardian/resources/rds_cluster.rb
cfn-guardian-0.11.4 lib/cfnguardian/resources/rds_cluster.rb
cfn-guardian-0.11.3 lib/cfnguardian/resources/rds_cluster.rb
cfn-guardian-0.11.2 lib/cfnguardian/resources/rds_cluster.rb