You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ terraform version
Terraform v1.4.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/template v2.2.0
+ provider registry.terraform.io/hashicorp/time v0.9.1
+ provider registry.terraform.io/outscale/outscale v0.9.1
+ provider registry.terraform.io/ovh/ovh v0.30.0
Your version of Terraform is out of date! The latest version
is 1.5.3. You can update by downloading from https://www.terraform.io/downloads.html
Terraform Configuration Files
resource"outscale_vm""vm" {
image_id=var.image_idvm_type=var.vm_typekeypair_name=var.ssh_keypair_namesecurity_group_ids=["${outscale_security_group.sg_kafka_nodes.id}","${data.outscale_security_group.sg_allow_ssh_from_jumphosts.id}"]
subnet_id=var.subnet_idplacement_tenancy="default"nested_virtualization=false#user_data = data.template_cloudinit_config.cloudinit.rendereddynamic"tags" {
for_each=merge(local.vm_tags,var.tags)
content {
key=tags.keyvalue=tags.value
}
}
#AML - switch rootdisk to 50G and SSDblock_device_mappings {
device_name="/dev/sda1"# /dev/sda1 corresponds to the root device of the VMbsu {
volume_size=var.root_volume_sizevolume_type=var.root_volume_typedelete_on_vm_deletion=true
}
}
lifecycle {
ignore_changes=[
user_data
]
}
}
resource"outscale_security_group""sg_kafka_nodes" {
security_group_name="secgroup-kafka"description="kafka node security group"net_id=data.outscale_net.vpc_poc_mdw.net_id
}
data"outscale_net""vpc_poc_mdw" {
filter {
name="tag_values"values=["vpc_poc_mdw${var.infra_env_suffix}"]
}
}
# Retreive existing security group of jumphost to be member of to allow communicationdata"outscale_security_group""sg_allow_ssh_from_jumphosts" {
filter {
name="security_group_names"values=["sg_allow_ssh_from_jumphosts"]
}
}
Debug Output
Crash Output
Expected Behavior
VM ressource is generated with two security groups ID.
Outside of terraform, with osc-cli, we reduce the number of Security Group to one.
Then, aterraform apply should update the security groups attached to the VM, but the "lost" security group is not detected / reaffected to the VM.
Actual Behavior
Steps to Reproduce
terraform init
terraform apply
osc-cli api UpdateVm --profile ${OSC_PROFILE} --VmId "${vmid}" --SecurityGroupIds "[\"${VM_SG_TO_KEEP}\"]"
terraform apply is detecting no change
Additional Context
References
The text was updated successfully, but these errors were encountered:
when you create resources with terraform, It is better to update/delete with terraform.
terraform doesn't really handle resources that it doesn't created or imported.
In your case, you can just remove the security_group_id in you terrafrom configuration and terrafom will update resources.
If you want to keep outscale_security_group.sg_kafka_nodes.id
Terraform Version
Terraform Configuration Files
Debug Output
Crash Output
Expected Behavior
terraform apply
should update the security groups attached to the VM, but the "lost" security group is not detected / reaffected to the VM.Actual Behavior
Steps to Reproduce
terraform init
terraform apply
osc-cli api UpdateVm --profile ${OSC_PROFILE} --VmId "${vmid}" --SecurityGroupIds "[\"${VM_SG_TO_KEEP}\"]"
terraform apply
is detecting no changeAdditional Context
References
The text was updated successfully, but these errors were encountered: