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

OCM-5428 | OCM-5414 | OCM-5409: machine pool data source #491

Merged
merged 3 commits into from
Jan 11, 2024

Conversation

bardielle
Copy link
Member

@bardielle bardielle commented Jan 7, 2024

This PRs:

  • OCM-5414: add availability_zonese as a computed attribute to machinepool resource
  • OCM-5409: add aws_submet_ids as a computed attribute to machinepool resource
  • OCM-5428: add machine-pool datasource
  • Generate docs

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 7, 2024

@bardielle: This pull request references OCM-5409 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.16.0" version, but no target version was set.

In response to this:

This PRs:

  • OCM-5414: add availability_zonese as a computed attribute to machinepool resource
  • OCM-5409: add aws_submet_ids as a computed attribute to machinepool resource
  • OCM-5428: add machine-pool datasource
  • Generate docs

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@bardielle
Copy link
Member Author

bardielle commented Jan 8, 2024

for the configuration file:


data "rhcs_machine_pool" "mp2" {
  cluster = "28k1v2l8pofsbmor1injvng0d8i7ie3q"
  id = "worker"
}


resource "rhcs_machine_pool" "machine_pool" {
  cluster                 = "28k1v2l8pofsbmor1injvng0d8i7ie3q"
  name                    = "test"
  machine_type =  "m5.xlarge"
  replicas = 3

}

output:

#the output of mp resource:
terraform state show rhcs_machine_pool.machine_pool
# rhcs_machine_pool.machine_pool:
resource "rhcs_machine_pool" "machine_pool" {
    availability_zones      = [
        "us-east-2a",
        "us-east-2b",
        "us-east-2c",
    ]
    aws_subnet_ids          = [
        "subnet-0afdd90afd6008ff0",
        "subnet-04c6fcc2ce591fb4b",
        "subnet-0a437951b8b316357",
    ]
    cluster                 = "28k1v2l8pofsbmor1injvng0d8i7ie3q"
    disk_size               = 300
    id                      = "test"
    machine_type            = "m5.xlarge"
    multi_availability_zone = true
    name                    = "test"
    replicas                = 3
}




terraform state show data.rhcs_machine_pool.mp2
# data.rhcs_machine_pool.mp2:
data "rhcs_machine_pool" "mp2" {
    availability_zones      = [
        "us-east-2a",
        "us-east-2b",
        "us-east-2c",
    ]
    aws_subnet_ids          = [
        "subnet-0afdd90afd6008ff0",
        "subnet-04c6fcc2ce591fb4b",
        "subnet-0a437951b8b316357",
    ]
    cluster                 = "28k1v2l8pofsbmor1injvng0d8i7ie3q"
    disk_size               = 300
    id                      = "terr-cluster-machine-pool"
    machine_type            = "m5.xlarge"
    multi_availability_zone = true
    name                    = "terr-cluster-machine-pool"
    replicas                = 6
}

@bardielle bardielle changed the title OCM-5428 | OCM-5414 | OCM-5409: machine pool data source [WIP] OCM-5428 | OCM-5414 | OCM-5409: machine pool data source Jan 8, 2024
Copy link
Member

@nirarg nirarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the comments here are suggestion for different descriptions as the descriptions in the data source need to be different from the descriptions in the resource (particular avoid using common.ValueCannotBeChangedStringDescription message)

provider/machinepool/machine_pool_resource.go Outdated Show resolved Hide resolved
provider/machinepool/machine_pool_datasource.go Outdated Show resolved Hide resolved
provider/machinepool/machine_pool_datasource.go Outdated Show resolved Hide resolved
provider/machinepool/machine_pool_datasource.go Outdated Show resolved Hide resolved
provider/machinepool/machine_pool_datasource.go Outdated Show resolved Hide resolved
provider/machinepool/machine_pool_datasource.go Outdated Show resolved Hide resolved
provider/machinepool/machine_pool_resource.go Outdated Show resolved Hide resolved
provider/machinepool/machine_pool_resource.go Outdated Show resolved Hide resolved
provider/machinepool/machine_pool_resource.go Outdated Show resolved Hide resolved
provider/machinepool/machine_pool_resource.go Outdated Show resolved Hide resolved
…ool resource

OCM-5409: add aws_submet_ids as a computed attribute to machinepool resource
@nirarg
Copy link
Member

nirarg commented Jan 11, 2024

/approve
/lgtm

Copy link

openshift-ci bot commented Jan 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nirarg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit a6d99b9 into terraform-redhat:main Jan 11, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants