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

replica_sets attribute in alicloud_mongodb_instance is not consistency and got only 1 connection information #7847

Open
chris-ng-scmp opened this issue Nov 13, 2024 · 2 comments

Comments

@chris-ng-scmp
Copy link

Terraform Version

OpenTofu v1.6.2

Affected Resource(s)

alicloud_mongodb_instance

Terraform Configuration Files

# This file is maintained automatically by "tofu init".
# Manual edits may be lost in future updates.

provider "registry.opentofu.org/aliyun/alicloud" {
  version     = "1.233.1"
  constraints = "1.233.1"
  hashes = [
    "h1:tFYvpLJzL49GXxxOyFNIVFSFwwqyeG2/aFJk1DGgF/U=",
    "zh:6608b6e72bec76da0090a9afbc4e0a2478923502ba36f376708aac23dc308551",
    "zh:7143193dc42bf83b8e7e8f7c6bf4c777fd3ee71bc96553e296a53440b08eafc4",
    "zh:8fa8eeba483c567593bac5c6e478d373ea22989f29a101abf16c7144a2ddf916",
    "zh:b52310aa04eab3a647936c4726ef7d7715ea939518aa84b8649d282aa1d6f6bc",
    "zh:b696f697952f5dd53a6da39906b9d3729b2c03fd4153cb78c63a844c306eb56d",
    "zh:b98c1cf90e2d6a505b32220b05d85d369f0cfe080d0c1ef0fca9daa1d539deb8",
    "zh:d46e561e882c32afa2979e885f19a32244a9a55d6bbbfaaf84b975e2250fd690",
    "zh:d5fa02b8e85dae291ec49b29ecdbf32347877105ec0e2902437c0b356c8fc251",
    "zh:df2e2d118bb6b7e42b09eb352b848db8d89358269679fa1de422238d294f1dc3",
    "zh:ec65ecf7b932befa8875bae7a5fa19ccc918a01066fb9ef79b637a98eda99817",
    "zh:fb7b659036a939e2af15d7bf7af2324015138e46f8477d335b0a3609e2ec1c9c",
  ]
}

provider "registry.opentofu.org/hashicorp/alicloud" {
  version = "1.233.1"
  hashes = [
    "h1:tFYvpLJzL49GXxxOyFNIVFSFwwqyeG2/aFJk1DGgF/U=",
    "zh:6608b6e72bec76da0090a9afbc4e0a2478923502ba36f376708aac23dc308551",
    "zh:7143193dc42bf83b8e7e8f7c6bf4c777fd3ee71bc96553e296a53440b08eafc4",
    "zh:8fa8eeba483c567593bac5c6e478d373ea22989f29a101abf16c7144a2ddf916",
    "zh:b52310aa04eab3a647936c4726ef7d7715ea939518aa84b8649d282aa1d6f6bc",
    "zh:b696f697952f5dd53a6da39906b9d3729b2c03fd4153cb78c63a844c306eb56d",
    "zh:b98c1cf90e2d6a505b32220b05d85d369f0cfe080d0c1ef0fca9daa1d539deb8",
    "zh:d46e561e882c32afa2979e885f19a32244a9a55d6bbbfaaf84b975e2250fd690",
    "zh:d5fa02b8e85dae291ec49b29ecdbf32347877105ec0e2902437c0b356c8fc251",
    "zh:df2e2d118bb6b7e42b09eb352b848db8d89358269679fa1de422238d294f1dc3",
    "zh:ec65ecf7b932befa8875bae7a5fa19ccc918a01066fb9ef79b637a98eda99817",
    "zh:fb7b659036a939e2af15d7bf7af2324015138e46f8477d335b0a3609e2ec1c9c",
  ]
}

provider "registry.opentofu.org/hashicorp/random" {
  version = "3.6.3"
  hashes = [
    "h1:GRAEnu2AKg83f9m3rmp56kJQbPoezeEHdGR98FRbjcc=",
    "h1:Ry0Lr0zaoicslZlcUR4rAySPpl/a7QupfMfuAxhW3fw=",
    "zh:1bfd2e54b4eee8c761a40b6d99d45880b3a71abc18a9a7a5319204da9c8363b2",
    "zh:21a15ac74adb8ba499aab989a4248321b51946e5431219b56fc827e565776714",
    "zh:221acfac3f7a5bcd6cb49f79a1fca99da7679bde01017334bad1f951a12d85ba",
    "zh:3026fcdc0c1258e32ab519df878579160b1050b141d6f7883b39438244e08954",
    "zh:50d07a7066ea46873b289548000229556908c3be746059969ab0d694e053ee4c",
    "zh:54280cdac041f2c2986a585f62e102bc59ef412cad5f4ebf7387c2b3a357f6c0",
    "zh:632adf40f1f63b0c5707182853c10ae23124c00869ffff05f310aef2ed26fcf3",
    "zh:b8c2876cce9a38501d14880a47e59a5182ee98732ad7e576e9a9ce686a46d8f5",
    "zh:f27e6995e1e9fe3914a2654791fc8d67cdce44f17bf06e614ead7dfd2b13d3ae",
    "zh:f423f2b7e5c814799ad7580b5c8ae23359d8d342264902f821c357ff2b3c6d3d",
  ]
}

provider "registry.opentofu.org/hashicorp/vault" {
  version     = "4.3.0"
  constraints = "4.3.0"
  hashes = [
    "h1:LjXe9v7ZsPvqQFcVis9SCe0nKq1+ALnOeXK2oZyou7I=",
    "h1:l4MgilX9NNLYQ7J+Y84YI20LZoBWLTYRiQ5BqP+SfFk=",
    "zh:10d727e50925e75c4e678ee3de2a8149ba1c4168877ff8afb396a8d556579a9a",
    "zh:117045416e7a52b41bfcf7c459f2dc6c86b6e1350e62f5bddc2cfbc54194bdfe",
    "zh:31f636dbd5eff07222628378628a27a338e528418e210e7a95878ddd071ac626",
    "zh:3c5ff916028fff21b85131d2c0d4b54768628ffa76b15de0be6fd3aded1d343a",
    "zh:52b216a371ec54e1da210035b520e1d245c176d4c8b7431c6a2474b45bdb741d",
    "zh:90141dd58b1e0902515250c80340da82a20cb3d7eb6bb0077b7ccd2f7c516640",
    "zh:b252df26048a8fa3cff9ec5b531ea4eb721883655cba0f30e967bacba55e4d07",
    "zh:b4c5f693d52a756a38b1b7f0c4669e74e5157cc487014c60598102229177ff2c",
    "zh:c04bf0729321f061ba156e90291a0fe9008cba1875b8de40c3733ac99e940cd8",
    "zh:d18fd50aa1fde79b3bb036f3769b5590dc56b4e29ba16933f8f0e3384e42f79d",
  ]
}

Debug Output

tofu "state show module.tech_dev_cn_hongkong.alicloud_mongodb_instance.masked"

# module.tech_dev_cn_hongkong.alicloud_mongodb_instance.masked:
resource "alicloud_mongodb_instance" "masked" {
....
    replica_sets                = [
        {
            connection_domain     = "dds-masked.mongodb.rds.aliyuncs.com"
            connection_port       = "3717"
            network_type          = "VPC"
            replica_set_role      = "Primary"
            vpc_cloud_instance_id = "dds-masked-1-1"
            vpc_id                = "vpc-masked"
            vswitch_id            = "vsw-masked"
        },
    ]
...
}

Expected Behavior

Suppose replica_sets is an array should return both primary and secondary connection object
But replica_sets now only returning a single object randomly, sometime is secondary, sometime is primary

Actual Behavior

replica_sets should return both secondary and primary connection object

@walbertus
Copy link

You did not provide the resource tf files. It cannot be reproduced.

@chris-ng-scmp
Copy link
Author

You did not provide the resource tf files. It cannot be reproduced.

Here you are:

resource "alicloud_mongodb_instance" "masked" {
  backup_period        = [
    "Friday",
    "Monday",
    "Saturday",
    "Sunday",
    "Thursday",
    "Tuesday",
    "Wednesday",
  ]
  backup_time          = "03:00Z-04:00Z"
  db_instance_class    = "dds.mongo.mid"
  db_instance_storage  = 10
  engine_version       = "4.2"
  instance_charge_type = "PrePaid"
  maintain_end_time    = "22:00Z"
  maintain_start_time  = "18:00Z"
  name                 = "masked"
  period               = 1
  replication_factor   = 3
  security_ip_list     = [
    "127.0.0.1",
  ]
  storage_engine       = "WiredTiger"
  tags                 = {}
  vswitch_id           = "vsw-masked"
  zone_id              = "cn-hongkong-MAZ2(b,c,d)"

  timeouts {}
}```

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