-
Notifications
You must be signed in to change notification settings - Fork 135
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
Add resource and data for ovh_dbaas_logs #364
Conversation
ovh/resource_dbaas_logs_cluster.go
Outdated
} | ||
|
||
func resourceDbaasLogsClusterDelete(d *schema.ResourceData, meta interface{}) error { | ||
if false { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should i do when releasing the logs cluster from terraform management ?
Should i delete all ACL or should i leave them as-is ?
AFAIK, a empty list mean that the cluster has no ACL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a user execute the command terraform destroy
on this resource, he/she should have a cluster like it was before the usage of this resource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this scenario :
- you order a dedicated cluster
- you manage it thru terraform, setting some ACL
- you add data in it
- you stop managing it thru terraform
As you go back to initial state, you don't have ACL anymore and a cluster full of data anyone can query
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
2da1709
to
e20ff86
Compare
e20ff86
to
e559854
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several sugestions made.
Moreover, is it possible to create test acceptances for the new resource?
Thanks :)
resource "ovh_dbaas_logs_cluster" "ldp" { | ||
service_name = "ldp-xx-xxxxx" | ||
|
||
archive_input_allowed_networks = ["10.0.0.0/16"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
archive_input_allowed_networks = ["10.0.0.0/16"] | |
archive_allowed_networks = ["10.0.0.0/16"] |
e559854
to
7cffe18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acceptance tests are missing for resource_dbaas_logs_cluster
resource
7cffe18
to
f274f66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f274f66
to
8d0e245
Compare
After a First, a message asks me to execute
And the acceptance test failed:
So please execute Thanks |
8d0e245
to
c3a7b3e
Compare
This advice is for:
https://developer.hashicorp.com/terraform/tutorials/configuration-language/sensitive-variables Thanks |
9935361
to
97538d6
Compare
24c8952
to
095e85a
Compare
} | ||
|
||
const testAccDbaasLogsClusterConfig = ` | ||
resource "ovh_dbaas_logs_cluster" "ldp" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add threee more attributes in your resource definition, and three more tests in the acceptance test
resource "ovh_dbaas_logs_cluster" "ldp" {
service_name = "%s"
archive_allowed_networks = ["10.0.0.0/16"]
direct_input_allowed_networks = ["10.0.0.0/16"]
query_allowed_networks = ["10.0.0.0/16"]
}
and then test if the created query_allowed_networks
is equals to ["10.0.0.0/16"]
and the same things for the others attributes :)
ovh/resource_dbaas_logs_cluster.go
Outdated
} | ||
|
||
func resourceDbaasLogsClusterDelete(d *schema.ResourceData, meta interface{}) error { | ||
if false { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a user execute the command terraform destroy
on this resource, he/she should have a cluster like it was before the usage of this resource
095e85a
to
5b2c6a7
Compare
Reference a DBaaS logs cluster to manipulate ACL on a `DEDICATED` cluster | ||
type. | ||
|
||
As LDP cluster can't be created through API, create and delete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As LDP cluster can't be created through API, create and delete | |
!> An LDP cluster can't be created and deleted via Terraform at this time. So when Terraform destroys the resource, it only actually restores it. |
type. | ||
|
||
As LDP cluster can't be created through API, create and delete | ||
operation are no-op. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
operation are no-op. |
5b2c6a7
to
f43ec9d
Compare
As we can't, easily, send a warning message to a user when he or she wants to delete/destroy a LDP cluster in order to alert he or she that the cluster will "only" be resetted, I created a feature request: #385 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved and need to be improved in the future with a fully create and delete feature
No description provided.