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

public cloud resources/data_sources proposal #74

Open
majidkarimizadeh opened this issue Sep 18, 2024 · 0 comments
Open

public cloud resources/data_sources proposal #74

majidkarimizadeh opened this issue Sep 18, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@majidkarimizadeh
Copy link
Contributor

majidkarimizadeh commented Sep 18, 2024

Minimal requirement to support public cloud in Terraform:
based on the https://developer.leaseweb.com/api-docs/publiccloud_v1.html

NOTE: I added only required attributes to the Terraform resources and data sources. we need to see how far we want to go.

Proposal:

Resources

resource "leaseweb_public_cloud_instance" "example" {
   region = ""
   type = ""
   image_id = ""
   contract_type = ""
   contract_term = ""
   billing_frequency = ""
   root_disk_storage_type = ""
}

resp:
{
   id = "" // get from response
   region = ""
   type = ""
   image_id = ""
   contract_type = ""
   contract_term = ""
   billing_frequency = ""
   root_disk_storage_type = ""
}
resource "leaseweb_public_cloud_load_balancer" "example" {
   region = ""
   type = ""
   contract_type = ""
   billing_frequency = ""
   root_disk_storage_type = ""
   target_port = ""
}

resp: 
{
   id = "" // get from response
   region = ""
   type = ""
   contract_type = ""
   billing_frequency = ""
   root_disk_storage_type = "" // NOTE: this attribute is not in the response, we need to check!
   target_port = ""
}
resource "leaseweb_public_cloud_load_balancer_listener" "example" {
   load_balancer_id = ""
   protocol = ""
   port = ""
}

resp: 
{
   id = "" // get from response
   load_balancer_id = ""
   protocol = ""
   port = ""
}
resource "leaseweb_public_cloud_credential" "example" {
   instance_id = ""
   type = ""
   username = ""
   password = ""
}

resp: 
we have the same example for dedicated server.
resource "leaseweb_public_cloud_auto_scalling_group" "example" {
   instance_id = ""
   reference = ""
   type = ""
}

resp: 
{
   id = "" // get from response
   instance_id = "" // NOTE: this attribute is not in the response, we need to check!
   reference = ""
   type = ""
}

Data-Sources

data "leaseweb_public_cloud_instances" "example" {
    id = "" // optional
    reference = "" // optional
    type = "" // optional, NOTE: we can just use the type name here
    region = "" // optional
    state = "" // optional
}

resp: 
{
    instances = [
        {
              id = ""
              reference = ""
              type = ""
              region = ""
              state = ""
        },
        ...
    ]
}
data "leaseweb_public_cloud_credentials" "example" {
    instance_id = ""
}

resp: 
we have the same example for dedicated server.
data "leaseweb_public_cloud_load_balancers" "example" {
    id = "" // optional
    reference = "" // optional
    type = "" // optional
    region = "" // optional
    state = "" // optional
}

resp: 
{
    load_balancers = [
        {
              id = ""
              reference = ""
              type = ""
              region = ""
              state = ""
        },
        ...
    ]
}
data "leaseweb_public_cloud_auto_scalling_groups" "example" {
    instance_id = "" // optional
    reference = "" // optional
    type = "" // optional
    region = "" // optional
    state = "" // optional
}

resp: 
{
    auto_scalling_groups = [
        {
              id = ""
              reference = ""
              type = ""
              region = ""
              state = ""
        },
        ...
    ]
}

Please let me know your opinions about it.

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

No branches or pull requests

6 participants