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

Can't change the default tenant when we create pool / virtual service #100

Open
arun2arunraj opened this issue Feb 5, 2019 · 2 comments
Assignees

Comments

@arun2arunraj
Copy link

arun2arunraj commented Feb 5, 2019

hi Everyone,

We are trying to create a POOL in our own custom tenant. The code always creating under the default tenant(admin). It is not overriding with our custom tenant. Any help would be much appreciated.

Our code snippet follows:

provider "avi" {
        avi_username = "${var.avi_username}"
        avi_tenant = "${var.avi_tenant}"
        avi_password = "${var.avi_password}"
        avi_controller = "${var.avi_controller}"
}

resource "avi_pool" "terraform_pool" {
        name= "terraform-test-pool-05",
        health_monitor_refs= ["${data.avi_healthmonitor.terraform-health-check.uuid}"]
        tenant_ref= "${avi_tenant.cloud_tenant.uuid}"
        cloud_ref= "${data.avi_cloud.default_cloud.uuid}"
        application_persistence_profile_ref= "${data.avi_applicationpersistenceprofile.http_cookie.uuid}"
        servers {
                ip= {
                        type= "V4",
                        addr= "10.110.54.55",
                }
                port= 8080
        }
        servers {
                ip= {
                        type= "V4",
                        addr= "10.110.154.155",
                }
        }
        fail_action= {
                type= "FAIL_ACTION_CLOSE_CONN"
        }
}

resource "avi_tenant" "cloud_tenant" {
        name= "Our Tenant"
}

data "avi_cloud" "default_cloud" {
        name= "Default-Cloud"
}

data "avi_healthmonitor" "terraform-health-check" {
        name= "System-HTTP"
}

data "avi_applicationprofile" "system_http_profile" {
        name= "System-Secure-HTTP"
}
@gitshrikant gitshrikant self-assigned this Feb 5, 2019
@arun2arunraj
Copy link
Author

@gitshrikant : hey Shri,

May I know, How to ensure the plugin version. I am struggling to figure it out. Could you please help me out ?

@gitshrikant
Copy link
Contributor

@arun2arunraj Hey Hi,
Sorry for the late reply.

Try to do ‘terraform init’ then you can see the provider version. If that doesn’t work you can get that version in provider.go file which is located under terraform-provider-avi/avi/provider.go.

For the tenant issue you have to either reinitialise the provider with different tenant in same .tf file or you can create seperate .tf file, initialise provider with desired tenant by setting ‘avi_tenant’ parameter and create resources under that tenant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants