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

Impossible to detect SG manually configure when the creation of a new plan #412

Closed
sylvain987 opened this issue Jan 12, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@sylvain987
Copy link

Terraform Version

Terraform v1.6.2
on linux_amd64
+ provider registry.terraform.io/hashicorp/local v2.4.0
+ provider registry.terraform.io/hashicorp/outscale v0.10.0
+ provider registry.terraform.io/hashicorp/vault v3.22.0

Terraform Configuration Files

resource "outscale_nic" "NIC-VM" {

    subnet_id          = "subnet-4f81c3eb"
    security_group_ids = ["sg-02bda794"]

}

resource "outscale_vm" "VM-AFD" {

    vm_initiated_shutdown_behavior = "stop"
    image_id                       = "ami-2361d881"
    performance                    = "high"
    vm_type                        = "tinav5.c2r4p2"
    nics {
        nic_id                     = outscale_nic.NIC-VM.nic_id
        device_number              = "0"
    }
    keypair_name                   = "KEY-PRV-LINUX"
    block_device_mappings {
        device_name                = "/dev/sda1"
        bsu {
            volume_size            = "30"
            volume_type            = "gp2"
            delete_on_vm_deletion  = true
        }
    }
    tags {
          key   = "Name"
          value = "test-sg"
    }

}

Debug Output

Crash Output

Expected Behavior

When we add a security group manually, Terraform should ask to delete it when we recreate the plan

Actual Behavior

Actually, when we add a security group manually, Terraform do not see the change when we recreate the plan. But we can see the new SG on the state ...

Steps to Reproduce

terraform init -plugin-dir=/opt/terraform/plugins
terraform plan -out=main.tfplan
terraform apply "main.tfplan"
Add SG manually through Cockpit on the created VM
terraform plan -out=main.tfplan => Terraform do not see the new SG (it should ask to delete it because the SG is not on the configuration)
terraform show => Terraform see the new SG only on the state

Additional Context

References

@sylvain987 sylvain987 added the bug Something isn't working label Jan 12, 2024
@outscale-toa
Copy link
Member

Hi @sylvain987,

Thanks for reaching us, we are looking at your issue

Best regards,

@outscale-toa outscale-toa mentioned this issue Jan 30, 2024
@outscale-toa
Copy link
Member

Merge in #409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants