Skip to content

add tls_certificate_key and tls_ca to mysql - #1098

Merged
tvoran merged 11 commits into
hashicorp:masterfrom
cassidy1:mysql_tls
Aug 12, 2021
Merged

add tls_certificate_key and tls_ca to mysql#1098
tvoran merged 11 commits into
hashicorp:masterfrom
cassidy1:mysql_tls

Conversation

@cassidy1

@cassidy1 cassidy1 commented Jul 16, 2021

Copy link
Copy Markdown
Contributor

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

hashicorp-cla commented Jul 16, 2021

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@tvoran tvoran left a comment

Copy link
Copy Markdown
Member

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.

Comment thread vault/resource_database_secret_backend_connection.go Outdated
Comment thread vault/resource_database_secret_backend_connection.go
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

cassidy1 commented Aug 2, 2021

Copy link
Copy Markdown
Contributor Author

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.

Comment thread vault/resource_database_secret_backend_connection_test.go Outdated
@github-actions github-actions Bot added size/L and removed size/M labels Aug 5, 2021
@cassidy1

cassidy1 commented Aug 5, 2021

Copy link
Copy Markdown
Contributor Author

@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?

Comment thread vault/resource_database_secret_backend_connection.go Outdated
Comment thread vault/resource_database_secret_backend_connection_test.go Outdated
Comment thread vault/resource_database_secret_backend_connection_test.go Outdated
Comment thread vault/resource_database_secret_backend_connection_test.go Outdated
Comment thread vault/resource_database_secret_backend_connection_test.go Outdated
@jasonodonnell

Copy link
Copy Markdown
Contributor

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>

@tvoran tvoran left a comment

Copy link
Copy Markdown
Member

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