Skip to content

Commit

Permalink
Merge pull request #12 from mineiros-io/mariux/fix
Browse files Browse the repository at this point in the history
fix: members validation
  • Loading branch information
mariux authored Mar 14, 2022
2 parents c81d1ee + 16f4a58 commit 2a74362
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.4]

### Fixed

- Fix validation to `members` variable

## [0.0.3]

### Added
Expand All @@ -17,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

Add validation to `var.members` variable to catch exceptions on `terraform plan`
- Add validation to `members` variable to catch exceptions on `terraform plan`

## [0.0.1]

Expand All @@ -27,7 +33,8 @@ Add validation to `var.members` variable to catch exceptions on `terraform plan`

<!-- markdown-link-check-disable -->

[unreleased]: https://github.com/mineiros-io/terraform-google-pubsub-topic-iam/compare/v0.0.3...HEAD
[unreleased]: https://github.com/mineiros-io/terraform-google-pubsub-topic-iam/compare/v0.0.4...HEAD
[0.0.4]: https://github.com/mineiros-io/terraform-google-pubsub-topic-iam/compare/v0.0.3...v0.0.4
[0.0.3]: https://github.com/mineiros-io/terraform-google-pubsub-topic-iam/compare/v0.0.2...v0.0.3
[0.0.2]: https://github.com/mineiros-io/terraform-google-pubsub-topic-iam/compare/v0.0.1...v0.0.2

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Most basic usage just setting required arguments:

```hcl
module "terraform-google-pubsub-topic-iam" {
source = "github.com/mineiros-io/terraform-google-pubsub-topic-iam?ref=v0.0.3"
source = "github.com/mineiros-io/terraform-google-pubsub-topic-iam?ref=v0.0.4"
topic = "example-topic"
role = "roles/editor"
Expand Down
2 changes: 1 addition & 1 deletion README.tfdoc.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ section {
```hcl
module "terraform-google-pubsub-topic-iam" {
source = "github.com/mineiros-io/terraform-google-pubsub-topic-iam?ref=v0.0.3"
source = "github.com/mineiros-io/terraform-google-pubsub-topic-iam?ref=v0.0.4"
topic = "example-topic"
role = "roles/editor"
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ variable "members" {
default = []

validation {
condition = alltrue([for member in var.members : can(regex("^(allUsers|allAuthenticatedUsers|(user|serviceAccount|group|domain|projectOwner|projectEditor|projectViewer):)$", member))])
condition = alltrue([for member in var.members : can(regex("^(?:allUsers|allAuthenticatedUsers|(?:user|serviceAccount|group|domain|projectOwner|projectEditor|projectViewer):.*)$", member))])
error_message = "Each member in 'var.members' can have one of the following values: 'allUsers', 'allAuthenticatedUsers', 'user:{emailid}', 'serviceAccount:{emailid}', 'group:{emailid}', 'domain:{domain}', 'projectOwner:projectid', 'projectEditor:projectid', 'projectViewer:projectid'."
}
}
Expand Down

0 comments on commit 2a74362

Please sign in to comment.