Skip to content

Instantly share code, notes, and snippets.

@danilodorgam
Last active April 28, 2025 16:24
Show Gist options
  • Save danilodorgam/f8497aac9a7ceb9954860f8d3423c19e to your computer and use it in GitHub Desktop.
Save danilodorgam/f8497aac9a7ceb9954860f8d3423c19e to your computer and use it in GitHub Desktop.
PS C:\projetos\primis-iac\magalucloud-virtualmachine> terraform apply -var-file="runner.tfvars" -auto-approve
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# mgc_network_public_ips.this will be created
+ resource "mgc_network_public_ips" "this" {
+ description = "picktag IP Publicos"
+ id = (known after apply)
+ public_ip = (known after apply)
+ vpc_id = (known after apply)
}
# mgc_network_public_ips_attach.this will be created
+ resource "mgc_network_public_ips_attach" "this" {
+ interface_id = (known after apply)
+ public_ip_id = (known after apply)
}
# mgc_network_security_groups.this will be created
+ resource "mgc_network_security_groups" "this" {
+ description = "Security group for VM access"
+ disable_default_rules = false
+ id = (known after apply)
+ name = "vm-security-groups"
}
# mgc_network_security_groups_attach.sg_attachment will be created
+ resource "mgc_network_security_groups_attach" "sg_attachment" {
+ interface_id = (known after apply)
+ security_group_id = (known after apply)
}
# mgc_network_security_groups_rules.ssh_rule will be created
+ resource "mgc_network_security_groups_rules" "ssh_rule" {
+ description = "Allow SSH access"
+ direction = "ingress"
+ ethertype = "IPv4"
+ id = (known after apply)
+ port_range_max = 22
+ port_range_min = 22
+ protocol = "tcp"
+ remote_ip_prefix = "0.0.0.0/0"
+ security_group_id = (known after apply)
}
# mgc_network_subnetpools.this will be created
+ resource "mgc_network_subnetpools" "this" {
+ cidr = "172.6.0.0/16"
+ description = "Main Subnet Pool"
+ id = (known after apply)
+ name = "main-subnetpools"
+ type = "pip"
}
# mgc_network_vpcs.this will be created
+ resource "mgc_network_vpcs" "this" {
+ description = "picktag VPC"
+ id = (known after apply)
+ name = "picktag-prd-vpcs"
}
# mgc_network_vpcs_interfaces.vm_interface will be created
+ resource "mgc_network_vpcs_interfaces" "vm_interface" {
+ id = (known after apply)
+ name = "vm-interfaces"
+ vpc_id = (known after apply)
}
# mgc_network_vpcs_subnets.primary_subnet will be created
+ resource "mgc_network_vpcs_subnets" "primary_subnet" {
+ availability_zone = (known after apply)
+ cidr_block = "172.6.1.0/24"
+ description = "Primary Network Subnet"
+ dns_nameservers = [
+ "8.8.8.8",
+ "1.1.1.1",
]
+ id = (known after apply)
+ ip_version = "IPv4"
+ name = "primary-subnets"
+ subnetpool_id = (known after apply)
+ vpc_id = (known after apply)
}
# mgc_ssh_keys.this will be created
+ resource "mgc_ssh_keys" "this" {
+ id = (known after apply)
+ key = "ssh-rsa ..."
+ name = "vm-suporte"
}
# mgc_virtual_machine_instances.this will be created
+ resource "mgc_virtual_machine_instances" "this" {
+ availability_zone = "br-se1-a"
+ created_at = (known after apply)
+ id = (known after apply)
+ image = "cloud-ubuntu-24.04 LTS"
+ machine_type = "BV4-16-100"
+ name = "vm-suporte"
+ network_interfaces = (known after apply)
+ ssh_key_name = "vm-suporte"
+ user_data = "IyEvYmluL2Jhc2gKZWNobyAiSU5JQ0lBTkRPIEZMVVhPIERFIElOU1RBTEFDQU8iCnNldCAtZXV4byBwaXBlZmFpbAoKIyBBZGQgRG9ja2VyJ3Mgb2ZmaWNpYWwgR1BHIGtleToKc3VkbyBhcHQtZ2V0IHVwZGF0ZQpzdWRvIGFwdC1nZXQgaW5zdGFsbCBjYS1jZXJ0aW
ZpY2F0ZXMgY3VybApzdWRvIGluc3RhbGwgLW0gMDc1NSAtZCAvZXRjL2FwdC9rZXlyaW5ncwpzdWRvIGN1cmwgLWZzU0wgaHR0cHM6Ly9kb3dubG9hZC5kb2NrZXIuY29tL2xpbnV4L3VidW50dS9ncGcgLW8gL2V0Yy9hcHQva2V5cmluZ3MvZG9ja2VyLmFzYwpzdWRvIGNobW9kIGErciAvZXRjL2FwdC9rZX
lyaW5ncy9kb2NrZXIuYXNjCiMgQWRkIHRoZSByZXBvc2l0b3J5IHRvIEFwdCBzb3VyY2VzOgplY2hvIFwKICAiZGViIFthcmNoPSQoZHBrZyAtLXByaW50LWFyY2hpdGVjdHVyZSkgc2lnbmVkLWJ5PS9ldGMvYXB0L2tleXJpbmdzL2RvY2tlci5hc2NdIGh0dHBzOi8vZG93bmxvYWQuZG9ja2VyLmNvbS9saW
51eC91YnVudHUgXAogICQoLiAvZXRjL29zLXJlbGVhc2UgJiYgZWNobyAiJHtVQlVOVFVfQ09ERU5BTUU6LSRWRVJTSU9OX0NPREVOQU1FfSIpIHN0YWJsZSIgfCBcCiAgc3VkbyB0ZWUgL2V0Yy9hcHQvc291cmNlcy5saXN0LmQvZG9ja2VyLmxpc3QgPiAvZGV2L251bGwKc3VkbyBhcHQtZ2V0IHVwZGF0ZQ
plY2hvICJBRElDSU9OT1UgREVQRU5ERU5DSUFTIEZMVVhPIERFIElOU1RBTEFDQU8iCgpzdWRvIGFwdC1nZXQgaW5zdGFsbCBkb2NrZXItY2UgZG9ja2VyLWNlLWNsaSBjb250YWluZXJkLmlvIGRvY2tlci1idWlsZHgtcGx1Z2luIGRvY2tlci1jb21wb3NlLXBsdWdpbiAteQplY2hvICJGSU0gQVBUIElOU1RBTEwgRkxVWE8gREUgSU5TVEFMQUNBTyIKCnN1ZG8gZ3JvdXBhZGQgZG9ja2VyCnN1ZG8gdXNlcm1vZCAtYUcgZG9ja2VyIHVidW50dQpuZXdncnAgZG9ja2VyCgplY2hvICJGSU5BTElaQU5ETyBGTFVYTyBERSBJTlNUQUxBQ0FPIg=="
+ vpc_id = (known after apply)
}
# mgc_virtual_machine_interface_attach.this will be created
+ resource "mgc_virtual_machine_interface_attach" "this" {
+ instance_id = (known after apply)
+ interface_id = (known after apply)
}
Plan: 12 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ vm_public_ip = (known after apply)
mgc_network_vpcs.this: Creating...
mgc_network_security_groups.this: Creating...
mgc_ssh_keys.this: Creating...
mgc_network_subnetpools.this: Creating...
mgc_ssh_keys.this: Creation complete after 1s [id=f9976647-5db0-4380-8fed-4e6ca6445722]
mgc_virtual_machine_instances.this: Creating...
mgc_network_subnetpools.this: Creation complete after 1s [id=2a2eaf13-2dfe-44e5-9324-d8dfe534e318]
mgc_network_security_groups.this: Still creating... [10s elapsed]
mgc_network_vpcs.this: Still creating... [10s elapsed]
mgc_virtual_machine_instances.this: Still creating... [10s elapsed]
mgc_network_security_groups.this: Creation complete after 13s [id=d28b53d4-26e6-45fa-943b-51f2da6e36c4]
mgc_network_security_groups_rules.ssh_rule: Creating...
mgc_network_security_groups_rules.ssh_rule: Creation complete after 4s [id=def5fbd2-5cc6-4e77-b710-7aa113c85b19]
mgc_network_vpcs.this: Still creating... [20s elapsed]
mgc_virtual_machine_instances.this: Still creating... [20s elapsed]
mgc_network_vpcs.this: Still creating... [30s elapsed]
mgc_virtual_machine_instances.this: Still creating... [1m20s elapsed]
mgc_network_public_ips_attach.this: Creation complete after 4s
mgc_virtual_machine_instances.this: Creation complete after 1m23s [id=539ed21e-9315-491d-8f22-bf826014505f]
mgc_virtual_machine_interface_attach.this: Creating...
mgc_virtual_machine_interface_attach.this: Creation complete after 9s
Apply complete! Resources: 12 added, 0 changed, 0 destroyed.
Outputs:
vm_public_ip = "201.54.13.14"
{
"availability_zone": "br-se1-a",
"created_at": "2025-04-27T19:12:14Z",
"id": "4e9e15ab-bc7b-4024-90fc-49aedfbd1987",
"image": {
"id": "cb81dc93-747c-4d5c-bd1e-4667fd24bb35"
},
"machine_type": {
"id": "ce182fc9-0736-4045-811f-409afc16427e"
},
"name": "picktag-runner-linux",
"network": {
"interfaces": [
{
"id": "5a00d19c-1db0-4dc3-bdfd-875078dc3f0e"
}
]
},
"ssh_key_name": "picktag-runner-linux",
"state": "running",
"status": "detach_nic_pending",
"updated_at": "2025-04-27T19:16:04Z",
"user_data": "=="
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment