-
Notifications
You must be signed in to change notification settings - Fork 48
Add cloudstack_domain
as a data source
#195
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
base: main
Are you sure you want to change the base?
Conversation
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.
clgtm. Didn't test.
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.
I have provided incorrect domain name but still getting the root domain id
data "cloudstack_domain" "foo" {
filter {
value = "name"
name = "sagfasgha"
}
}
output "domain_id" {
value = data.cloudstack_domain.foo.id
}
output "domain_name" {
value = data.cloudstack_domain.foo.name
}
output "network_domain" {
value = data.cloudstack_domain.foo.network_domain
}
output "parent_domain_id" {
value = data.cloudstack_domain.foo.parent_domain_id
}
terraform apply
data.cloudstack_domain.foo: Reading...
data.cloudstack_domain.foo: Read complete after 1s [id=f8f8593c-7730-11f0-9a5b-1e00900003a2]
Changes to Outputs:
+ domain_id = "f8f8593c-7730-11f0-9a5b-1e00900003a2"
+ domain_name = "ROOT"
+ network_domain = ""
+ parent_domain_id = ""
You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
domain_id = "f8f8593c-7730-11f0-9a5b-1e00900003a2"
domain_name = "ROOT"
network_domain = ""
parent_domain_id = ""
Also could you please check by providing the sub domain id
log.Printf("Domain Data Source Read Started") | ||
|
||
cs := meta.(*cloudstack.CloudStackClient) | ||
p := cs.Domain.NewListDomainsParams() |
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.
parameters needs to be set for p
based on the provided input.
Adding
cloudstack_domain
as a data source: