Skip to content

Commit

Permalink
Network create issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
vanarajaz committed Feb 9, 2022
1 parent be4da4f commit 890eec2
Show file tree
Hide file tree
Showing 4 changed files with 242 additions and 45 deletions.
14 changes: 7 additions & 7 deletions examples/instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ variable "coffee_name" {
# zone_uuid = "74b12720-73ce-49b6-857f-48cdac6dcd3f"
# }

# resource "stackbill_network" "my-server" {
# description = "terraform test"
# name = "terraform volume teo"
# network_offering_uuid = "19c28a5d-0237-450d-b47a-dbddc67aa0df"
# virtual_machine_uuid = "4d9150e6-64b5-451a-8851-0a4ea5142242"
# zone_uuid = "74b12720-73ce-49b6-857f-48cdac6dcd3f"
# }
resource "stackbill_network" "my-server" {
description = "terraform test"
name = "terraform volume teo"
network_offering_uuid = "19c28a5d-0237-450d-b47a-dbddc67aa0df"
virtual_machine_uuid = "4d9150e6-64b5-451a-8851-0a4ea5142242"
zone_uuid = "74b12720-73ce-49b6-857f-48cdac6dcd3f"
}
# resource "stackbill_network_attach" "my-server" {
# network_uuid = "80934451-21e7-4bb3-be39-30a8d14db2ac"
# virutal_machine_uuid = "4d9150e6-64b5-451a-8851-0a4ea5142242"
Expand Down
271 changes: 234 additions & 37 deletions examples/instance/terraform.tfstate.backup
Original file line number Diff line number Diff line change
@@ -1,53 +1,250 @@
{
"version": 4,
"terraform_version": "1.1.2",
"serial": 12,
"lineage": "d9c29c08-714c-63de-e94e-dae5a10a4f7f",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "stackbill_instance",
"name": "my-server",
"provider": "provider[\"stackbill.com/assistanz/stackbill\"]",
"instances": [
"serial": 1,
"lineage": "5d5f0756-7a3e-5ba9-0bd5-7962d49c7bf9",
"outputs": {
"stackbill_security_group_list": {
"value": [
{
"schema_version": 0,
"attributes": {
"compute_offering_uuid": "2f7b1b02-078f-42fb-aece-aa21bfa89e1a",
"cpu_core": "3",
"disk_size": null,
"hypervisor_name": "string",
"id": "d7d17107-7ec9-4224-becc-dc7e09f8d9c9",
"memory": null,
"name": "AzTestingVmFour",
"network_uuid": "0c7cc302-abe5-4687-8351-26aba55b3d0d",
"security_group_name": null,
"ssh_key_name": null,
"storage_offering_uuid": null,
"template_uuid": "e39172b4-715b-44ac-ada2-7f97f733eecc",
"zone_uuid": "74b12720-73ce-49b6-857f-48cdac6dcd3f"
},
"sensitive_attributes": [],
"private": "bnVsbA=="
"description": "Test Security Group",
"is_active": true,
"name": "Test Security Group",
"security_group_egress_rule": [
{
"cidr_list": "",
"end_port": "3434",
"icmp_code": "",
"icmp_type": "",
"id": 13,
"is_active": true,
"protocol": "tcp",
"security_group_uuid": "a860fad9-d1d2-4394-883d-07d8a209a78b",
"start_port": "2323"
}
],
"security_group_firewall_rule": [],
"security_group_port_forwarding": [],
"status": "ENABLED",
"uuid": "a860fad9-d1d2-4394-883d-07d8a209a78b"
},
{
"description": "",
"is_active": true,
"name": "Mat-Public",
"security_group_egress_rule": [
{
"cidr_list": "",
"end_port": "80",
"icmp_code": "",
"icmp_type": "",
"id": 53,
"is_active": true,
"protocol": "tcp",
"security_group_uuid": "c0bb95be-25e5-4ec1-b0e6-79b5fbfb527f",
"start_port": "80"
},
{
"cidr_list": "",
"end_port": "99",
"icmp_code": "",
"icmp_type": "",
"id": 74,
"is_active": true,
"protocol": "tcp",
"security_group_uuid": "c0bb95be-25e5-4ec1-b0e6-79b5fbfb527f",
"start_port": "99"
}
],
"security_group_firewall_rule": [
{
"cidr_list": "0.0.0.0/0",
"end_port": "80",
"icmp_code": "",
"icmp_type": "",
"id": 36,
"is_active": true,
"protocol": "tcp",
"security_group_uuid": "c0bb95be-25e5-4ec1-b0e6-79b5fbfb527f",
"start_port": "80"
}
],
"security_group_port_forwarding": [
{
"id": 32,
"is_active": true,
"private_end_port": "80",
"private_start_port": "80",
"protocol_type": "tcp",
"public_end_port": "80",
"public_start_port": "80",
"security_group_uuuid": "c0bb95be-25e5-4ec1-b0e6-79b5fbfb527f"
}
],
"status": "ENABLED",
"uuid": "c0bb95be-25e5-4ec1-b0e6-79b5fbfb527f"
}
],
"type": [
"list",
[
"object",
{
"description": "string",
"is_active": "bool",
"name": "string",
"security_group_egress_rule": [
"list",
[
"object",
{
"cidr_list": "string",
"end_port": "string",
"icmp_code": "string",
"icmp_type": "string",
"id": "number",
"is_active": "bool",
"protocol": "string",
"security_group_uuid": "string",
"start_port": "string"
}
]
],
"security_group_firewall_rule": [
"list",
[
"object",
{
"cidr_list": "string",
"end_port": "string",
"icmp_code": "string",
"icmp_type": "string",
"id": "number",
"is_active": "bool",
"protocol": "string",
"security_group_uuid": "string",
"start_port": "string"
}
]
],
"security_group_port_forwarding": [
"list",
[
"object",
{
"id": "number",
"is_active": "bool",
"private_end_port": "string",
"private_start_port": "string",
"protocol_type": "string",
"public_end_port": "string",
"public_start_port": "string",
"security_group_uuuid": "string"
}
]
],
"status": "string",
"uuid": "string"
}
]
]
},
}
},
"resources": [
{
"mode": "managed",
"type": "stackbill_instance_actions",
"name": "actions",
"mode": "data",
"type": "stackbill_security_group_list",
"name": "all",
"provider": "provider[\"stackbill.com/assistanz/stackbill\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"action": "Stop",
"id": "d7d17107-7ec9-4224-becc-dc7e09f8d9c9",
"uuid": "d7d17107-7ec9-4224-becc-dc7e09f8d9c9"
"id": "1644384821",
"length": 2,
"securitygroups": [
{
"description": "Test Security Group",
"is_active": true,
"name": "Test Security Group",
"security_group_egress_rule": [
{
"cidr_list": "",
"end_port": "3434",
"icmp_code": "",
"icmp_type": "",
"id": 13,
"is_active": true,
"protocol": "tcp",
"security_group_uuid": "a860fad9-d1d2-4394-883d-07d8a209a78b",
"start_port": "2323"
}
],
"security_group_firewall_rule": [],
"security_group_port_forwarding": [],
"status": "ENABLED",
"uuid": "a860fad9-d1d2-4394-883d-07d8a209a78b"
},
{
"description": "",
"is_active": true,
"name": "Mat-Public",
"security_group_egress_rule": [
{
"cidr_list": "",
"end_port": "80",
"icmp_code": "",
"icmp_type": "",
"id": 53,
"is_active": true,
"protocol": "tcp",
"security_group_uuid": "c0bb95be-25e5-4ec1-b0e6-79b5fbfb527f",
"start_port": "80"
},
{
"cidr_list": "",
"end_port": "99",
"icmp_code": "",
"icmp_type": "",
"id": 74,
"is_active": true,
"protocol": "tcp",
"security_group_uuid": "c0bb95be-25e5-4ec1-b0e6-79b5fbfb527f",
"start_port": "99"
}
],
"security_group_firewall_rule": [
{
"cidr_list": "0.0.0.0/0",
"end_port": "80",
"icmp_code": "",
"icmp_type": "",
"id": 36,
"is_active": true,
"protocol": "tcp",
"security_group_uuid": "c0bb95be-25e5-4ec1-b0e6-79b5fbfb527f",
"start_port": "80"
}
],
"security_group_port_forwarding": [
{
"id": 32,
"is_active": true,
"private_end_port": "80",
"private_start_port": "80",
"protocol_type": "tcp",
"public_end_port": "80",
"public_start_port": "80",
"security_group_uuuid": "c0bb95be-25e5-4ec1-b0e6-79b5fbfb527f"
}
],
"status": "ENABLED",
"uuid": "c0bb95be-25e5-4ec1-b0e6-79b5fbfb527f"
}
],
"uuid": null
},
"sensitive_attributes": [],
"private": "bnVsbA=="
"sensitive_attributes": []
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion network/network_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (nt *networkUtils) GetCreateNetworkRequest(d *schema.ResourceData) map[stri
func (nt *networkUtils) GetCreateNetworkOptionalRequest(d *schema.ResourceData) map[string]interface{} {
request := make(map[string]interface{})
request["isPublic"] = d.Get("is_public").(bool)
request["networkOfferingUuid"] = d.Get("security_group_id").(string)
request["securityGroupId"] = d.Get("security_group_id").(string)
return request
}

Expand Down
Binary file modified terraform-provider-stackbill
Binary file not shown.

0 comments on commit 890eec2

Please sign in to comment.