Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create a Chef resource using the Chef provider when the Chef sever is using a self signed certificate. #18916

Closed
sbobylev opened this issue Sep 20, 2018 · 2 comments

Comments

@sbobylev
Copy link

sbobylev commented Sep 20, 2018

Unable to create a role in AWS OpsWorks for Chef Automate using terraform and the chef provider. Since OpsWorks is using a self signed certificate, terraform apply fails.

Terraform Version

Terraform v0.11.8
+ provider.chef v0.1.0

Terraform Configuration Files

backend.tf

provider "chef" {
  server_url = "https://test-xgibsgi18eldm7wa.us-east-2.opsworks-cm.io/organizations/default"
  client_name  = "terraform"
  key_material = "${file("chef-terraform.pem")}"
}

test_chef_role.tf

resource "chef_role" "test" {
  name     = "test-role"
}

Crash Output

terraform apply -auto-approve

chef_role.test: Creating...
  default_attributes_json:  "" => "{}"
  description:              "" => "Managed by Terraform"
  name:                     "" => "test-role"
  override_attributes_json: "" => "{}"

Error: Error applying plan:

1 error(s) occurred:

* chef_role.test: 1 error(s) occurred:

* chef_role.test: Post https://test-xgibsgi18eldm7wa.us-east-2.opsworks-cm.io/organizations/roles: x509: certificate signed by unknown authority

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Expected Behavior

A new chef resource gets created.

Actual Behavior

Terraform apply fails.

Steps to Reproduce

  1. terraform init
  2. terraform apply -auto-approve

Workaround

Set allow_unverified_ssl to true in the backend.tf file.

provider "chef" {
  server_url = "https://test-xgibsgi18eldm7wa.us-east-2.opsworks-cm.io/organizations/default"
  client_name  = "terraform"
  key_material = "${file("chef-terraform.pem")}"
  allow_unverified_ssl = true
}

Feature Request

Add support for ssl_ca_file option

@sbobylev sbobylev changed the title Unable to create a Chef resource using the Chef provider when he Chef sever is using a self signed certificate. Unable to create a Chef resource using the Chef provider when the Chef sever is using a self signed certificate. Sep 20, 2018
@ghost
Copy link

ghost commented Sep 25, 2018

This issue has been automatically migrated to hashicorp/terraform-provider-chef#25 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-chef#25.

@ghost
Copy link

ghost commented Apr 2, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants