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: Allow multiple routes (Closes: #567). #571

Merged
merged 2 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions digitalocean/app_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,6 @@ func appSpecComponentBase() map[string]*schema.Schema {
Elem: appSpecEnvSchema(),
Set: schema.HashResource(appSpecEnvSchema()),
},
"routes": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: appSpecRouteSchema(),
},
},
"source_dir": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -335,6 +326,14 @@ func appSpecServicesSchema() *schema.Resource {
Schema: appSpecImageSourceSchema(),
},
},
"routes": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Elem: &schema.Resource{
Schema: appSpecRouteSchema(),
},
},
}

for k, v := range appSpecComponentBase() {
Expand Down Expand Up @@ -368,6 +367,14 @@ func appSpecStaticSiteSchema() *schema.Resource {
Optional: true,
Description: "The name of the document to use as the fallback for any requests to documents that are not found when serving this static site.",
},
"routes": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Elem: &schema.Resource{
Schema: appSpecRouteSchema(),
},
},
}

for k, v := range appSpecComponentBase() {
Expand Down
4 changes: 4 additions & 0 deletions digitalocean/resource_digitalocean_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,10 @@ resource "digitalocean_app" "foobar" {
routes {
path = "/"
}

routes {
path = "/foo"
}
}
}
}`
Expand Down