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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add several data sources to ease automation #2512

Open
gaetan-craft opened this issue Apr 9, 2024 · 0 comments
Open

Add several data sources to ease automation #2512

gaetan-craft opened this issue Apr 9, 2024 · 0 comments
Assignees
Labels
enhancement instance Instance issues, bugs and feature requests priority:medium Improvements that are not the main priority

Comments

@gaetan-craft
Copy link

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

It would be nice to have data sources for the following elements:

  • Instance server details like RAM, CPU, GPU provided by scw instance server-type list -o json
  • Available ami available on the account with filtering by tags

New or Affected Resource(s)

  • scaleway_instance_server_types
  • scaleway_instance_image

Potential Terraform Configuration

data scaleway_instance_image myapp {
  tags   = ["production","myapp"]
  latest = true
}

data scaleway_instance_server_types all{
}

locals {
   allowed_app_ram = data.scaleway_instance_server_types.all[var.app_server_type]-100000000 
   cloud-init = templatefile("cloud-init.yaml.tpl",{app_ram= local.allowed_app_ram})
}

resource "scaleway_instance_server" "web" {
  type = var.app_server_type
  image = data.scaleway_instance_image.myapp.id
  user_data = {
    cloud-init = local.cloud-init
  }
}

References

@remyleone remyleone added priority:medium Improvements that are not the main priority instance Instance issues, bugs and feature requests labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement instance Instance issues, bugs and feature requests priority:medium Improvements that are not the main priority
Projects
None yet
Development

No branches or pull requests

3 participants