Skip to content

Commit

Permalink
apps: Add computed URN attribute. (#854)
Browse files Browse the repository at this point in the history
* Vendor github.com/digitalocean/godo v1.82.0

* apps: Add computed URN attribute.
  • Loading branch information
andrewsomething committed Aug 4, 2022
1 parent e3551e0 commit a14b43c
Show file tree
Hide file tree
Showing 17 changed files with 398 additions and 7 deletions.
5 changes: 5 additions & 0 deletions digitalocean/datasource_digitalocean_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func dataSourceDigitalOceanApp() *schema.Resource {
Computed: true,
Description: "The ID the App's currently active deployment",
},
"urn": {
Type: schema.TypeString,
Computed: true,
Description: "The uniform resource identifier for the app",
},
"updated_at": {
Type: schema.TypeString,
Computed: true,
Expand Down
2 changes: 2 additions & 0 deletions digitalocean/datasource_digitalocean_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ func TestAccDataSourceDigitalOceanApp_Basic(t *testing.T) {
"data.digitalocean_app.foobar", "live_url"),
resource.TestCheckResourceAttrPair("digitalocean_app.foobar", "active_deployment_id",
"data.digitalocean_app.foobar", "active_deployment_id"),
resource.TestCheckResourceAttrPair("digitalocean_app.foobar", "urn",
"data.digitalocean_app.foobar", "urn"),
resource.TestCheckResourceAttrPair("digitalocean_app.foobar", "updated_at",
"data.digitalocean_app.foobar", "updated_at"),
resource.TestCheckResourceAttrPair("digitalocean_app.foobar", "created_at",
Expand Down
8 changes: 8 additions & 0 deletions digitalocean/resource_digitalocean_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,18 @@ func resourceDigitalOceanApp() *schema.Resource {
Description: "The ID the App's currently active deployment",
},

"urn": {
Type: schema.TypeString,
Computed: true,
Description: "The uniform resource identifier for the app",
},

"updated_at": {
Type: schema.TypeString,
Computed: true,
Description: "The date and time of when the App was last updated",
},

"created_at": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -114,6 +121,7 @@ func resourceDigitalOceanAppRead(ctx context.Context, d *schema.ResourceData, me
d.Set("live_url", app.LiveURL)
d.Set("updated_at", app.UpdatedAt.UTC().String())
d.Set("created_at", app.CreatedAt.UTC().String())
d.Set("urn", app.URN())

if err := d.Set("spec", flattenAppSpec(d, app.Spec)); err != nil {
return diag.Errorf("Error setting app spec: %#v", err)
Expand Down
1 change: 1 addition & 0 deletions digitalocean/resource_digitalocean_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func TestAccDigitalOceanApp_Basic(t *testing.T) {
resource.TestCheckResourceAttrSet("digitalocean_app.foobar", "default_ingress"),
resource.TestCheckResourceAttrSet("digitalocean_app.foobar", "live_url"),
resource.TestCheckResourceAttrSet("digitalocean_app.foobar", "active_deployment_id"),
resource.TestCheckResourceAttrSet("digitalocean_app.foobar", "urn"),
resource.TestCheckResourceAttrSet("digitalocean_app.foobar", "updated_at"),
resource.TestCheckResourceAttrSet("digitalocean_app.foobar", "created_at"),
resource.TestCheckResourceAttr(
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The following attributes are exported:
* `default_ingress` - The default URL to access the app.
* `live_url` - The live URL of the app.
* `active_deployment_id` - The ID the app's currently active deployment.
* `urn` - The uniform resource identifier for the app.
* `updated_at` - The date and time of when the app was last updated.
* `created_at` - The date and time of when the app was created.
* `spec` - A DigitalOcean App spec describing the app.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ In addition to the above attributes, the following are exported:
* `default_ingress` - The default URL to access the app.
* `live_url` - The live URL of the app.
* `active_deployment_id` - The ID the app's currently active deployment.
* `urn` - The uniform resource identifier for the app.
* `updated_at` - The date and time of when the app was last updated.
* `created_at` - The date and time of when the app was created.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/digitalocean/terraform-provider-digitalocean

require (
github.com/aws/aws-sdk-go v1.42.18
github.com/digitalocean/godo v1.81.0
github.com/digitalocean/godo v1.82.0
github.com/hashicorp/awspolicyequivalence v1.5.0
github.com/hashicorp/go-uuid v1.0.2
github.com/hashicorp/go-version v1.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/digitalocean/godo v1.81.0 h1:sjb3fOfPfSlUQUK22E87BcI8Zx2qtnF7VUCCO4UK3C8=
github.com/digitalocean/godo v1.81.0/go.mod h1:BPCqvwbjbGqxuUnIKB4EvS/AX7IDnNmt5fwvIkWo+ew=
github.com/digitalocean/godo v1.82.0 h1:lqAit46H1CqJGjh7LDbsamng/UMBME5rvmfH3Vb5Yy8=
github.com/digitalocean/godo v1.82.0/go.mod h1:BPCqvwbjbGqxuUnIKB4EvS/AX7IDnNmt5fwvIkWo+ew=
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
Expand Down
8 changes: 8 additions & 0 deletions vendor/github.com/digitalocean/godo/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 74 additions & 0 deletions vendor/github.com/digitalocean/godo/apps.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions vendor/github.com/digitalocean/godo/apps.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/digitalocean/godo/balance.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/digitalocean/godo/billing_history.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a14b43c

Please sign in to comment.