Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ func TestAccDataSourceCloudStackPhysicalNetwork_basic(t *testing.T) {
Config: testAccDataSourceCloudStackPhysicalNetwork_basic,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(
"data.cloudstack_physicalnetwork.foo", "name", "terraform-physical-network"),
"data.cloudstack_physical_network.foo", "name", "terraform-physical-network"),
resource.TestCheckResourceAttr(
"data.cloudstack_physicalnetwork.foo", "broadcast_domain_range", "ZONE"),
"data.cloudstack_physical_network.foo", "broadcast_domain_range", "ZONE"),
),
},
},
Expand All @@ -51,17 +51,18 @@ resource "cloudstack_zone" "foo" {
network_type = "Advanced"
}

resource "cloudstack_physicalnetwork" "foo" {
resource "cloudstack_physical_network" "foo" {
name = "terraform-physical-network"
zone = cloudstack_zone.foo.name
zone_id = cloudstack_zone.foo.id
broadcast_domain_range = "ZONE"
isolation_methods = ["VLAN"]
}

data "cloudstack_physicalnetwork" "foo" {
data "cloudstack_physical_network" "foo" {
filter {
name = "name"
value = "terraform-physical-network"
}
depends_on = [cloudstack_physicalnetwork.foo]
}`
depends_on = [cloudstack_physical_network.foo]
}
`
92 changes: 49 additions & 43 deletions cloudstack/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,53 +91,59 @@ func Provider() *schema.Provider {
"cloudstack_vpn_connection": dataSourceCloudstackVPNConnection(),
"cloudstack_pod": dataSourceCloudstackPod(),
"cloudstack_domain": dataSourceCloudstackDomain(),
"cloudstack_physicalnetwork": dataSourceCloudStackPhysicalNetwork(),
"cloudstack_physical_network": dataSourceCloudStackPhysicalNetwork(),
"cloudstack_role": dataSourceCloudstackRole(),
},

ResourcesMap: map[string]*schema.Resource{
"cloudstack_affinity_group": resourceCloudStackAffinityGroup(),
"cloudstack_attach_volume": resourceCloudStackAttachVolume(),
"cloudstack_autoscale_vm_profile": resourceCloudStackAutoScaleVMProfile(),
"cloudstack_configuration": resourceCloudStackConfiguration(),
"cloudstack_disk": resourceCloudStackDisk(),
"cloudstack_egress_firewall": resourceCloudStackEgressFirewall(),
"cloudstack_firewall": resourceCloudStackFirewall(),
"cloudstack_host": resourceCloudStackHost(),
"cloudstack_instance": resourceCloudStackInstance(),
"cloudstack_ipaddress": resourceCloudStackIPAddress(),
"cloudstack_kubernetes_cluster": resourceCloudStackKubernetesCluster(),
"cloudstack_kubernetes_version": resourceCloudStackKubernetesVersion(),
"cloudstack_loadbalancer_rule": resourceCloudStackLoadBalancerRule(),
"cloudstack_network": resourceCloudStackNetwork(),
"cloudstack_network_acl": resourceCloudStackNetworkACL(),
"cloudstack_network_acl_rule": resourceCloudStackNetworkACLRule(),
"cloudstack_nic": resourceCloudStackNIC(),
"cloudstack_port_forward": resourceCloudStackPortForward(),
"cloudstack_private_gateway": resourceCloudStackPrivateGateway(),
"cloudstack_secondary_ipaddress": resourceCloudStackSecondaryIPAddress(),
"cloudstack_security_group": resourceCloudStackSecurityGroup(),
"cloudstack_security_group_rule": resourceCloudStackSecurityGroupRule(),
"cloudstack_ssh_keypair": resourceCloudStackSSHKeyPair(),
"cloudstack_static_nat": resourceCloudStackStaticNAT(),
"cloudstack_static_route": resourceCloudStackStaticRoute(),
"cloudstack_template": resourceCloudStackTemplate(),
"cloudstack_vpc": resourceCloudStackVPC(),
"cloudstack_vpn_connection": resourceCloudStackVPNConnection(),
"cloudstack_vpn_customer_gateway": resourceCloudStackVPNCustomerGateway(),
"cloudstack_vpn_gateway": resourceCloudStackVPNGateway(),
"cloudstack_network_offering": resourceCloudStackNetworkOffering(),
"cloudstack_disk_offering": resourceCloudStackDiskOffering(),
"cloudstack_volume": resourceCloudStackVolume(),
"cloudstack_zone": resourceCloudStackZone(),
"cloudstack_service_offering": resourceCloudStackServiceOffering(),
"cloudstack_account": resourceCloudStackAccount(),
"cloudstack_user": resourceCloudStackUser(),
"cloudstack_domain": resourceCloudStackDomain(),
"cloudstack_physicalnetwork": resourceCloudStackPhysicalNetwork(),
"cloudstack_traffic_type": resourceCloudStackTrafficType(),
"cloudstack_network_service_provider": resourceCloudStackNetworkServiceProvider(),
"cloudstack_role": resourceCloudStackRole(),
"cloudstack_affinity_group": resourceCloudStackAffinityGroup(),
"cloudstack_attach_volume": resourceCloudStackAttachVolume(),
"cloudstack_autoscale_vm_profile": resourceCloudStackAutoScaleVMProfile(),
"cloudstack_configuration": resourceCloudStackConfiguration(),
"cloudstack_cluster": resourceCloudStackCluster(),
"cloudstack_disk": resourceCloudStackDisk(),
"cloudstack_egress_firewall": resourceCloudStackEgressFirewall(),
"cloudstack_firewall": resourceCloudStackFirewall(),
"cloudstack_host": resourceCloudStackHost(),
"cloudstack_instance": resourceCloudStackInstance(),
"cloudstack_ipaddress": resourceCloudStackIPAddress(),
"cloudstack_kubernetes_cluster": resourceCloudStackKubernetesCluster(),
"cloudstack_kubernetes_version": resourceCloudStackKubernetesVersion(),
"cloudstack_loadbalancer_rule": resourceCloudStackLoadBalancerRule(),
"cloudstack_network": resourceCloudStackNetwork(),
"cloudstack_network_acl": resourceCloudStackNetworkACL(),
"cloudstack_network_acl_rule": resourceCloudStackNetworkACLRule(),
"cloudstack_nic": resourceCloudStackNIC(),
"cloudstack_physical_network": resourceCloudStackPhysicalNetwork(),
"cloudstack_pod": resourceCloudStackPod(),
"cloudstack_port_forward": resourceCloudStackPortForward(),
"cloudstack_network_service_provider_state": resourceCloudStackNetworkServiceProviderState(),
"cloudstack_private_gateway": resourceCloudStackPrivateGateway(),
"cloudstack_secondary_ipaddress": resourceCloudStackSecondaryIPAddress(),
"cloudstack_secondary_storage": resourceCloudStackSecondaryStorage(),
"cloudstack_security_group": resourceCloudStackSecurityGroup(),
"cloudstack_security_group_rule": resourceCloudStackSecurityGroupRule(),
"cloudstack_ssh_keypair": resourceCloudStackSSHKeyPair(),
"cloudstack_static_nat": resourceCloudStackStaticNAT(),
"cloudstack_static_route": resourceCloudStackStaticRoute(),
"cloudstack_storage_pool": resourceCloudStackStoragePool(),
"cloudstack_template": resourceCloudStackTemplate(),
"cloudstack_traffic_type": resourceCloudStackTrafficType(),
"cloudstack_vpc": resourceCloudStackVPC(),
"cloudstack_vpn_connection": resourceCloudStackVPNConnection(),
"cloudstack_vpn_customer_gateway": resourceCloudStackVPNCustomerGateway(),
"cloudstack_vpn_gateway": resourceCloudStackVPNGateway(),
"cloudstack_network_offering": resourceCloudStackNetworkOffering(),
"cloudstack_disk_offering": resourceCloudStackDiskOffering(),
"cloudstack_vlan_ip_range": resourceCloudstackVlanIpRange(),
"cloudstack_volume": resourceCloudStackVolume(),
"cloudstack_zone": resourceCloudStackZone(),
"cloudstack_service_offering": resourceCloudStackServiceOffering(),
"cloudstack_account": resourceCloudStackAccount(),
"cloudstack_user": resourceCloudStackUser(),
"cloudstack_domain": resourceCloudStackDomain(),
"cloudstack_network_service_provider": resourceCloudStackNetworkServiceProvider(),
"cloudstack_role": resourceCloudStackRole(),
},

ConfigureFunc: providerConfigure,
Expand Down
Loading