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

Apps: Support Project Assignment #1113

Merged
merged 10 commits into from
Feb 21, 2024
Merged

Apps: Support Project Assignment #1113

merged 10 commits into from
Feb 21, 2024

Conversation

danaelhe
Copy link
Member

@danaelhe danaelhe commented Feb 20, 2024

Adds support for specifying a project ID for a app. Addresses #1112

Tried it out locally and was able to confirm an App was created in specified project:

terraform {
  required_providers {
    digitalocean = {
      source = "digitalocean/digitalocean"
      version = ">= 2.8.0"
    }
  }
}

provider "digitalocean" {
  # You need to set this in your .bashrc
  # export DIGITALOCEAN_TOKEN="Your API TOKEN"
  #
}

resource "digitalocean_project" "foobar" {
  name = "test_apps"
}

resource "digitalocean_app" "golang-sample" {
  project_id = digitalocean_project.foobar.id
  spec {
    name   = "golang-sample"
    region = "ams"

    service {
      name               = "go-service"
      environment_slug   = "go"
      instance_count     = 1
      instance_size_slug = "professional-xs"

      git {
        repo_clone_url = "https://github.com/digitalocean/sample-golang.git"
        branch         = "main"
      }
    }
  }
}

@danaelhe danaelhe marked this pull request as ready for review February 20, 2024 21:38
@danaelhe danaelhe requested a review from a team February 20, 2024 21:51
Copy link
Member

@andrewsomething andrewsomething left a comment

Choose a reason for hiding this comment

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

Looks great. One small nitpick in the data source schema.

digitalocean/app/datasource_app.go Outdated Show resolved Hide resolved
@danaelhe danaelhe merged commit a5d8aea into main Feb 21, 2024
3 checks passed
@danaelhe danaelhe deleted the apps_projects branch February 21, 2024 15:31
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

Successfully merging this pull request may close these issues.

2 participants