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

attempt at fixing the (R)IGM.status output message #7104

Conversation

modular-magician
Copy link
Collaborator

Add google_compute_(region)_instance_group_manager.status.all_instances_config.revision field
Fix status fields in (Regional)InstanceGroupManagers.

fixes hashicorp/terraform-provider-google#17572

Making documentation consistent with the implementation and with the API
the tfstate file contains (e.g.):

"status": [
              {
                "all_instances_config": [
                  {
                    "current_revision": "2024-03-11T15:56:35.837380Z",
                    "effective": true
                  }
                ],
                "is_stable": false,
                "stateful": [
                  {
                    "has_stateful_config": false,
                    "per_instance_configs": [
                      {
                        "all_effective": true
                      }
                    ]
                  }
                ],
                "version_target": [
                  {
                    "is_reached": true
                  }
                ]
              }
            ],

this is consistent (apart from the autoscaler field, which is not in scope of this PR) with the public discovery docs:

    "InstanceGroupManagerStatus": {
      "id": "InstanceGroupManagerStatus",
      "type": "object",
      "properties": {
        "isStable": {
          "description": "[Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified.",
          "type": "boolean"
        },
        "allInstancesConfig": {
          "description": "[Output only] Status of all-instances configuration on the group.",
          "$ref": "InstanceGroupManagerStatusAllInstancesConfig"
        },
        "versionTarget": {
          "description": "[Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager.",
          "$ref": "InstanceGroupManagerStatusVersionTarget"
        },
        "stateful": {
          "description": "[Output Only] Stateful status of the given Instance Group Manager.",
          "$ref": "InstanceGroupManagerStatusStateful"
        },
        "autoscaler": {
          "description": "[Output Only] The URL of the Autoscaler that targets this instance group manager.",
          "type": "string"
        }
      }
    },
    "InstanceGroupManagerStatusAllInstancesConfig": {
      "id": "InstanceGroupManagerStatusAllInstancesConfig",
      "type": "object",
      "properties": {
        "effective": {
          "description": "[Output Only] A bit indicating whether this configuration has been applied to all managed instances in the group.",
          "type": "boolean"
        },
        "currentRevision": {
          "description": "[Output Only] Current all-instances configuration revision. This value is in RFC3339 text format.",
          "type": "string"
        }
      }
    },
    "InstanceGroupManagerStatusVersionTarget": {
      "id": "InstanceGroupManagerStatusVersionTarget",
      "type": "object",
      "properties": {
        "isReached": {
          "description": "[Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager.",
          "type": "boolean"
        }
      }
    },
    "InstanceGroupManagerStatusStateful": {
      "id": "InstanceGroupManagerStatusStateful",
      "type": "object",
      "properties": {
        "hasStatefulConfig": {
          "description": "[Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful configuration even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions.",
          "type": "boolean"
        },
        "perInstanceConfigs": {
          "description": "[Output Only] Status of per-instance configurations on the instance.",
          "$ref": "InstanceGroupManagerStatusStatefulPerInstanceConfigs"
        }
      }
    },
    "InstanceGroupManagerStatusStatefulPerInstanceConfigs": {
      "id": "InstanceGroupManagerStatusStatefulPerInstanceConfigs",
      "type": "object",
      "properties": {
        "allEffective": {
          "description": "A bit indicating if all of the group's per-instance configurations (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs.",
          "type": "boolean"
        }
      }
    },

Release Note Template for Downstream PRs (will be copied)

compute: added `status.all_instances_config.revision` field to `google_compute_instance_group_manager` and `google_compute_region_instance_group_manager`

Derived from GoogleCloudPlatform/magic-modules#10188

* attempt at fixing the (R)IGM.status output message

* Fix plural of instances

* Fix plural of instances

* Fix plural of instances

* Fix plural of instances

[upstream:944450cac1644467f78fbcde4ed870ccbd07ba6f]

Signed-off-by: Modular Magician <magic-modules@google.com>
@modular-magician modular-magician merged commit 49be4c4 into hashicorp:main Mar 14, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant