    # File lib/fog/aws/models/compute/servers.rb, line 74
            def bootstrap(new_attributes = {})
              server = connection.servers.new(new_attributes)

              unless new_attributes[:key_name]
                # first or create fog_#{credential} keypair
                name = Fog.respond_to?(:credential) && Fog.credential || :default
                unless server.key_pair = connection.key_pairs.get("fog_#{name}")
                  server.key_pair = connection.key_pairs.create(
                    :name => "fog_#{name}",
                    :public_key => server.public_key
                  )
                end
              end

              # make sure port 22 is open in the first security group
              security_group = connection.security_groups.get(server.groups.first)
              authorized = security_group.ip_permissions.detect do |ip_permission|
                ip_permission['ipRanges'].first && ip_permission['ipRanges'].first['cidrIp'] == '0.0.0.0/0' &&
                ip_permission['fromPort'] == 22 &&
                ip_permission['ipProtocol'] == 'tcp' &&
                ip_permission['toPort'] == 22
              end
              unless authorized
                security_group.authorize_port_range(22..22)
              end

              server.save
              server.wait_for { ready? }
              server.setup(:key_data => [server.private_key])
              server
            end