Skip to content

Commit

Permalink
Add note and validation for permission
Browse files Browse the repository at this point in the history
  • Loading branch information
lego963 committed Jun 17, 2021
1 parent 12c7109 commit 3291f06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/resources/swr_domain_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ The following arguments are supported:

* `access_domain` - (Required) The name of the domain for image sharing.

-> `access_domain` should be an existing OTC domain.

* `permission` - (Required) Permission to be granted. Currently, only the `read` permission is supported.

* `deadline` - (Required) End date of image sharing (UTC). When the value is set to `forever`,
Expand All @@ -52,11 +54,9 @@ The following arguments are supported:

## Attributes Reference

The following attributes are exported:

* `name` - See Argument Reference above.
In addition to all arguments above, the following attributes are exported:

* `creater_id` - Username ID of the domain creator.
* `creator_id` - Username ID of the domain creator.

* `creator_name` - Username of the domain creator.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/opentelekomcloud/gophertelekomcloud/openstack/swr/v2/domains"
"github.com/opentelekomcloud/terraform-provider-opentelekomcloud/opentelekomcloud/common/cfg"
"github.com/opentelekomcloud/terraform-provider-opentelekomcloud/opentelekomcloud/common/fmterr"
Expand Down Expand Up @@ -43,6 +44,9 @@ func ResourceSwrDomainV2() *schema.Resource {
"permission": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{
"read",
}, false),
},
"deadline": {
Type: schema.TypeString,
Expand Down

0 comments on commit 3291f06

Please sign in to comment.