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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add tls_certificate_key and tls_ca to mysql #1098

Merged
merged 11 commits into from
Aug 12, 2021
Merged

Conversation

cassidy1
Copy link
Contributor

@cassidy1 cassidy1 commented Jul 16, 2021

Community Note

  • Please vote on this pull request by adding a 馃憤 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #1082

Release note for CHANGELOG:

Add tls_certificate_key and tls_ca options for mysql secret backend

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccDatabaseSecretBackendConnection_mysql'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccDatabaseSecretBackendConnection_mysql -timeout 120m
?   	github.com/hashicorp/terraform-provider-vault	[no test files]
?   	github.com/hashicorp/terraform-provider-vault/cmd/coverage	[no test files]
?   	github.com/hashicorp/terraform-provider-vault/cmd/generate	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/codegen	0.280s [no tests to run]
?   	github.com/hashicorp/terraform-provider-vault/generated	[no test files]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
	A future release of golang/protobuf will delete this package,
	which has long been excluded from the compatibility promise.

testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/decode	0.306s [no tests to run]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
	A future release of golang/protobuf will delete this package,
	which has long been excluded from the compatibility promise.

testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/encode	0.764s [no tests to run]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
	A future release of golang/protobuf will delete this package,
	which has long been excluded from the compatibility promise.

testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/resources/transform/alphabet	1.201s [no tests to run]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
	A future release of golang/protobuf will delete this package,
	which has long been excluded from the compatibility promise.

testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/resources/transform/role	0.529s [no tests to run]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
	A future release of golang/protobuf will delete this package,
	which has long been excluded from the compatibility promise.

testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/resources/transform/template	1.430s [no tests to run]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
	A future release of golang/protobuf will delete this package,
	which has long been excluded from the compatibility promise.

testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/resources/transform/transformation	0.985s [no tests to run]
?   	github.com/hashicorp/terraform-provider-vault/schema	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/util	0.285s [no tests to run]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
	A future release of golang/protobuf will delete this package,
	which has long been excluded from the compatibility promise.

=== RUN   TestAccDatabaseSecretBackendConnection_mysql
    resource_database_secret_backend_connection_test.go:243: MYSQL_URL not set
--- SKIP: TestAccDatabaseSecretBackendConnection_mysql (0.00s)
PASS
ok  	github.com/hashicorp/terraform-provider-vault/vault	0.824s

@hashicorp-cla
Copy link

hashicorp-cla commented Jul 16, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@tvoran tvoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch! Could you add a test for a mysql config with the new tls parameters in resource_database_secret_backend_connection_test.go? It's probably not one we can run in CI easily, so you'll want to check for some extra env variables at the top (like MYSQL_CA, MYSQL_CERTIFICATE_KEY), similar to the mongodb atlas test.

cassidy1 and others added 3 commits August 2, 2021 15:32
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
@cassidy1
Copy link
Contributor Author

cassidy1 commented Aug 2, 2021

Hi @tvoran. Thanks for reviewing this. I added the new tls parameters to resource_database_secret_backend_connection_test.go. Let me know if this looks good.

@github-actions github-actions bot added size/L and removed size/M labels Aug 5, 2021
@cassidy1
Copy link
Contributor Author

cassidy1 commented Aug 5, 2021

@tvoran I added a new testAccDatabaseSecretBackendConnectionConfig_mysql_tls() function, used in a new TestAccDatabaseSecretBackendConnection_mysql_tls() test like you mentioned in your last comment. Can you take a look when you have a moment if everything looks good?

@jasonodonnell
Copy link
Collaborator

Bumping this to resolve the feedback 馃槃

cassidy1 and others added 3 commits August 11, 2021 11:23
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
@github-actions github-actions bot added size/M and removed size/L labels Aug 11, 2021
cassidy1 and others added 2 commits August 11, 2021 11:23
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
Copy link
Member

@tvoran tvoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all your work on this!

@tvoran tvoran merged commit fe37851 into hashicorp:master Aug 12, 2021
davidmontoyago pushed a commit to davidmontoyago/terraform-provider-vault that referenced this pull request Aug 17, 2021
* add mysql_tls test

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mysql database secret backend connection resource does not permit TLS configuration
4 participants