<commit_before>#
# Cookbook Name:: fake
# Recipe:: test1
#
# Author:: <NAME> (<<EMAIL>>)
#
#
# Copyright 2014, B7 Interactive, LLC
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an 'AS IS' BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

credentials = Chef::EncryptedDataBagItem.load(
  node['aws_security']['encrypted_data_bag'],
  'aws_keys'
)

credentials = Chef::EncryptedDataBagItem.load(
  node['aws_security']['encrypted_data_bag'],
  'aws_keys'
)

aws_security_group 'test' do
  description 'test security group'
  region 'us-west-2'
  aws_access_key_id credentials['aws_access_key_id']
  aws_secret_access_key credentials['aws_secret_access_key']
end

aws_security_group 'test_source_group' do
  description 'test source security group'
  region 'us-west-2'
  aws_access_key_id credentials['aws_access_key_id']
  aws_secret_access_key credentials['aws_secret_access_key']
end

aws_security_group_rule 'test rule 1' do
  description 'test rule 1'
  cidr_ip '192.168.1.1/32'
  groupname 'test'
  region 'us-west-2'
  port_range '80..80'<commit_msg>Don't load the data bag twice and use the Chef 12+ helper<commit_after>#
# Cookbook Name:: fake
# Recipe:: test1
#
# Author:: <NAME> (<<EMAIL>>)
#
#
# Copyright 2014, B7 Interactive, LLC
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an 'AS IS' BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

credentials = data_bag_item(
  node['aws_security']['encrypted_data_bag'],
  'aws_keys'
)

aws_security_group 'test' do
  description 'test security group'
  region 'us-west-2'
  aws_access_key_id credentials['aws_access_key_id']
  aws_secret_access_key credentials['aws_secret_access_key']
end

aws_security_group 'test_source_group' do
  description 'test source security group'
  region 'us-west-2'
  aws_access_key_id credentials['aws_access_key_id']
  aws_secret_access_key credentials['aws_secret_access_key']
end

aws_security_group_rule 'test rule 1' do
  description 'test rule 1'
  cidr_ip '192.168.1.1/32'
  groupname 'test'
  region 'us-west-2'
  port_range '80..80'
{'fraction_non_alphanumeric': 0.09687392648574374, 'fraction_numerical': 0.020611473720371008, 'mean_word_length': 5.130526315789473, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '4146200', 'n_tokens_mistral': 955, 'n_tokens_neox': 918, 'n_words': 298}