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

使用 tencentcloud_security_groups 数据源资源获取的安全组id错误 #2540

Open
wokwong opened this issue Feb 27, 2024 · 3 comments

Comments

@wokwong
Copy link

wokwong commented Feb 27, 2024

Terraform Version

Terraform v1.7.4
on linux_amd64

  • provider registry.terraform.io/tencentcloudstack/tencentcloud v1.81.74

Affected Resource(s)

  • tencentcloud_security_groups

Terraform Configuration Files

data "tencentcloud_security_groups" "selected" {
  security_group_id = "sg-nma6pdd3"
}

resource "tencentcloud_instance" "ops_recovery_tmp_sever" { 
.......

  instance_name = "ops_recovery_tmp_sever"
  orderly_security_groups = [
    data.tencentcloud_security_groups.selected.id,
  ]

.......

Expected Behavior

$ terraform plan -out plan.tfplan
......
data.tencentcloud_security_groups.selected: Read complete after 2s [id=sg-nma6pdd3]

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:

  # tencentcloud_instance.ops_recovery_tmp_sever[0] will be created
  + resource "tencentcloud_instance" "ops_recovery_tmp_sever" {
      .......
      + orderly_security_groups                 = [
          + "sg-nma6pdd3",
        ]
      ......
    }

Actual Behavior

$ terraform plan -out plan.tfplan
......
data.tencentcloud_security_groups.selected: Read complete after 2s [id=securityGroups-sg-nma6pdd3-]

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:

  # tencentcloud_instance.ops_recovery_tmp_sever[0] will be created
  + resource "tencentcloud_instance" "ops_recovery_tmp_sever" {
      .......
      + orderly_security_groups                 = [
          + "securityGroups-sg-nma6pdd3-",
        ]
      ......
    }
@wokwong
Copy link
Author

wokwong commented Feb 27, 2024

企业微信截图_17090027388239

@wokwong
Copy link
Author

wokwong commented Feb 27, 2024

sorry,I made a mistake,ishould have used data.tencentcloud_security_groups.selected.security_group_id .

@walbertus
Copy link

@wokwong please close this issue if it's already resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants