<commit_before>require_relative '../resource'

module Convection
  module Model
    class Template
      class Resource
        ##
        # AWS::RDS::DBSecurityGroup
        ##
        class RDSDBSecurityGroup < Resource
          include Model::Mixin::Taggable

          type 'AWS::RDS::DBSecurityGroup', :rds_security_group
          property :description, 'GroupDescription'
          property :vpc, 'EC2VpcId'
          property :ingress, 'DBSecurityGroupIngress', :type => :list

          def security_group_ingress(&block)
            # A new code block defines a new ingress group
            @properties['DBSecurityGroupIngress'] << {}
            yield
          end

          def ec2_security_group(group, owner)
            @properties['DBSecurityGroupIngress'].last.merge!(
              :EC2SecurityGroupName => group,
              :EC2SecurityGroupOwnerId => owner
            )
          end

          def cidr_ip(cidr_block)
            @properties['DBSecurityGroupIngress'].last.merge!(
              :CIDRIP => cidr_block
            )
          end
<commit_msg>Add IAM Profile support to EC2 instances; fix hashing format for newer Ruby version<commit_after>require_relative '../resource'

module Convection
  module Model
    class Template
      class Resource
        ##
        # AWS::RDS::DBSecurityGroup
        ##
        class RDSDBSecurityGroup < Resource
          include Model::Mixin::Taggable

          type 'AWS::RDS::DBSecurityGroup', :rds_security_group
          property :description, 'GroupDescription'
          property :vpc, 'EC2VpcId'
          property :ingress, 'DBSecurityGroupIngress', :type => :list

          def security_group_ingress(&block)
            # A new code block defines a new ingress group
            @properties['DBSecurityGroupIngress'] << {}
            yield
          end

          def ec2_security_group(group, owner)
            @properties['DBSecurityGroupIngress'].last.merge!(
              { 'EC2SecurityGroupName' => group, 'EC2SecurityGroupOwnerId' => owner }
            )
          end

          def cidr_ip(cidr_block)
            @properties['DBSecurityGroupIngress'].last.merge!({ 'CIDRIP' => cidr_block })
          end

{'fraction_non_alphanumeric': 0.08955223880597014, 'fraction_numerical': 0.004070556309362279, 'mean_word_length': 2.1420454545454546, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2143655', 'n_tokens_mistral': 590, 'n_tokens_neox': 611, 'n_words': 131}