QT-DevOps / DevOpsIssues

This Repo will be used to demonstrate the Skills & Questions in DevOps
Apache License 2.0
27 stars 130 forks source link

Error while executing kitchen create #1037

Open bhanusatvik opened 2 years ago

bhanusatvik commented 2 years ago

Getting this below error while executing kitchen create command. Please help me resolving this issue.

**PS C:\Users\kbsre\Desktop\Devops\chef-starter\chef-repo\cookbooks\apache_phpinfo> kitchen create -----> Starting Test Kitchen (v3.1.1) -----> Creating ...

------Exception------- Class: Kitchen::ActionFailed Message: 1 actions failed. Failed to complete #create action: [unable to sign request without credentials set in the specified region us-east-2. Please check this AMI is available in this region.] on default-ubuntu-2004

Please see .kitchen/logs/kitchen.log for more details Also try running kitchen diagnose --all for configuration**

I added my AWS credentials to ~/.aws/credentials.

This is my kitchen.yml file

driver: name: ec2 aws_ssh_key_id: test # key pair name region: us-east-2 # region code of aws availability_zone: us-east-2a # availability_zone of us-west subnet_id: subnet-024b11b9888cec1d9 # subnet-id noted from above steps instance_type: t2.micro # as it is free instance type image_id: ami-0629230e074c580f2 # image id of ubuntu security_group_ids: ["sg-04ef2846abccad92f"]

The forwarded_port port feature lets you connect to ports on the VM guest via

localhost on the host.

see also: https://www.vagrantup.com/docs/networking/forwarded_ports

network:

- ["forwarded_port", {guest: 80, host: 8080}]

provisioner: name: chef_zero

You may wish to disable always updating cookbooks in CI or other testing environments.

For example:

always_update_cookbooks: <%= !ENV['CI'] %>

always_update_cookbooks: true

product_name and product_version specifies a specific Chef product and version to install.

see the Chef documentation for more details: https://docs.chef.io/workstation/config_yml_kitchen/

product_name: chef

product_version: 17

verifier: name: inspec

transport: ssh_key: ./test.pem # relative path to pem file connection_timeout: 10 connection_retries: 5 username: ubuntu # username from ami-id

platforms:

suites: