@@ -152,7 +152,7 @@ Outputs:
152152 # Generated
153153 AMI :
154154 Description : AMI Used.
155- Value : !FindInMap [ RegionMap, !Ref "AWS::Region", EBS ]
155+ Value : !FindInMap [ RegionMap, !Ref "AWS::Region", amazon ]
156156 IAMRole :
157157 Description : IAM Instance Profile Role Created.
158158 Value : !Ref IamRole
@@ -162,52 +162,52 @@ Mappings:
162162 # Amazon Linux AMI 2017.03 was released on 2017-04-04
163163 # N. Virginia
164164 us-east-1 :
165- EBS : ami-22ce4934
165+ amazon : ami-22ce4934
166166 # Ohio
167167 us-east-2 :
168- EBS : ami-7bfcd81e
168+ amazon : ami-7bfcd81e
169169 # Oregon
170170 us-west-2 :
171- EBS : ami-8ca83fec
171+ amazon : ami-8ca83fec
172172 # N. California
173173 us-west-1 :
174- EBS : ami-9e247efe
174+ amazon : ami-9e247efe
175175 # Canada
176176 ca-central-1 :
177- EBS : ami-8601bce2
177+ amazon : ami-8601bce2
178178 # Ireland
179179 eu-west-1 :
180- EBS : ami-e5083683
180+ amazon : ami-e5083683
181181 # London
182182 eu-west-2 :
183- EBS : ami-11130775
183+ amazon : ami-11130775
184184 # Frankfurt
185185 eu-central-1 :
186- EBS : ami-5b06d634
186+ amazon : ami-5b06d634
187187 # Singapore
188188 ap-southeast-1 :
189- EBS : ami-a2bc03c1
189+ amazon : ami-a2bc03c1
190190 # Seoul
191191 ap-northeast-1 :
192- EBS : ami-8369baed
192+ amazon : ami-8369baed
193193 # Tokyo
194194 ap-northeast-2 :
195- EBS : ami-859bbfe2
195+ amazon : ami-859bbfe2
196196 # Sydney
197197 ap-southeast-2 :
198- EBS : ami-8bf2fde8
198+ amazon : ami-8bf2fde8
199199 # Mumbai
200200 ap-south-1 :
201- EBS : ami-815625ee
201+ amazon : ami-815625ee
202202 # Sao Paulo
203203 sa-east-1 :
204- EBS : ami-a97013c5
204+ amazon : ami-a97013c5
205205 # Beijing
206206 cn-north-1 :
207- EBS : ami-b3d80ede
207+ amazon : ami-b3d80ede
208208 # GovCloud
209209 us-gov-west-1 :
210- EBS : ami-700a8f11
210+ amazon : ami-700a8f11
211211
212212Conditions :
213213 # Condition for if SSH access not wanted for maybe a prd env
@@ -327,7 +327,7 @@ Resources:
327327 - IamInstanceProfile
328328 Properties :
329329 AssociatePublicIpAddress : false
330- ImageId : !FindInMap [ RegionMap, !Ref "AWS::Region", EBS ]
330+ ImageId : !FindInMap [ RegionMap, !Ref "AWS::Region", amazon ]
331331 SecurityGroups : !Ref SecurityGroups
332332 InstanceType : !Ref InstanceType
333333 IamInstanceProfile : !Ref IamInstanceProfile
@@ -399,11 +399,11 @@ Resources:
399399 cwd : /opt/chef-repo
400400 command : !Sub "cp -R cookbooks/${CookbookName}/test/data_bags/${CookbookName} data_bags/"
401401 05_download_dependent_cookbook :
402- cwd : !Sub /opt/chef-repo/cookbooks/${CookbookName}
402+ cwd : !Sub " /opt/chef-repo/cookbooks/${CookbookName}"
403403 command : !Sub "/opt/chefdk/embedded/bin/berks install"
404404 06_vendor_dependent_cookbook :
405- cwd : !Sub /opt/chef-repo/cookbooks/${CookbookName}
406- command : !Sub "/opt/chefdk/embedded/bin/berks vendor /opt/chef-repo/cookbooks/"
405+ cwd : !Sub " /opt/chef-repo/cookbooks/${CookbookName}"
406+ command : !Sub "export HOME=/root && /opt/chefdk/embedded/bin/berks vendor /opt/chef-repo/cookbooks/"
407407 files :
408408 " /opt/chef-repo/encrypted_data_bag_secret " :
409409 content : !Sub ${DataBagSecret}
@@ -419,6 +419,9 @@ Resources:
419419 role_path '/opt/chef-repo/roles'
420420 chef_server_url 'http://127.0.0.1:8889'
421421 encrypted_data_bag_secret '/opt/chef-repo/data_bags/encrypted_data_bag_secret'
422+ log_level :info
423+ log_location '/var/log/chef-client.log'
424+ verify_api_cert false
422425 " /opt/chef-repo/environments/aws.json " :
423426 content : !Sub |
424427 {
@@ -437,26 +440,10 @@ Resources:
437440 }
438441 }
439442 }
440- " /opt/chef-repo/roles/ec2.json " :
441- content : !Sub |
442- {
443- "name": "ec2",
444- "description": "Role",
445- "json_class": "Chef::Role",
446- "default_attributes": {},
447- "override_attributes": {
448- },
449- "chef_type": "role",
450- "run_list": [
451- "recipe[${CookbookName}]"
452- ],
453- "env_run_lists": {
454- }
455- }
456443 run_chef_client :
457444 commands :
458445 01_run_chef :
459- command : " /opt/chefdk/bin/chef-client -z -o 'role[ec2 ]' --environment 'aws' --config /opt/chef-repo/client.rb --log_level info --force-formatter --chef-zero-port 8889"
446+ command : !Sub "/opt/chefdk/bin/chef-client -z -o 'recipe[${CookbookName} ]' --environment 'aws' --config /opt/chef-repo/client.rb --log_level info --force-formatter --chef-zero-port 8889"
460447 warm_ebs :
461448 commands :
462449 01_warm_ebs :
0 commit comments