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

docs: update host set plugin filters examples #420

Merged
merged 1 commit into from
Jun 23, 2023
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
8 changes: 3 additions & 5 deletions docs/resources/host_set_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,15 @@ resource "boundary_host_catalog_plugin" "aws_example" {
resource "boundary_host_set_plugin" "web" {
name = "My web host set plugin"
host_catalog_id = boundary_host_catalog_plugin.aws_example.id
attributes_json = jsonencode({ "filters" = "tag:service-type=web" })
attributes_json = jsonencode({ "filters" = ["tag:service-type=web"] })
}

resource "boundary_host_set_plugin" "foobar" {
name = "My foobar host set plugin"
host_catalog_id = boundary_host_catalog_plugin.aws_example.id
preferred_endpoints = ["cidr:54.0.0.0/8"]
attributes_json = jsonencode({
"filters" = "tag-key=foo",
"filters" = "tag-key=bar"
Comment on lines -62 to -63
Copy link
Contributor

Choose a reason for hiding this comment

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

Huh, would this example ever have worked? wouldn't jsonencode just set the "filters" key to whatever is defined last?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I don't think it's a valid example. It'd have always just used the last "filters" key

"filters" = ["tag-key=foo", "tag-key=bar"]
})
}

Expand All @@ -69,8 +68,7 @@ resource "boundary_host_set_plugin" "launch" {
host_catalog_id = boundary_host_catalog_plugin.aws_example.id
sync_interval_seconds = 60
attributes_json = jsonencode({
"filters" = "tag:development=prod,dev",
"filters" = "launch-time=2022-01-04T*"
"filters" = ["tag:development=prod,dev", "launch-time=2022-01-04T*"]
})
}

Expand Down
8 changes: 3 additions & 5 deletions examples/resources/boundary_host_set_plugin/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,15 @@ resource "boundary_host_catalog_plugin" "aws_example" {
resource "boundary_host_set_plugin" "web" {
name = "My web host set plugin"
host_catalog_id = boundary_host_catalog_plugin.aws_example.id
attributes_json = jsonencode({ "filters" = "tag:service-type=web" })
attributes_json = jsonencode({ "filters" = ["tag:service-type=web"] })
}

resource "boundary_host_set_plugin" "foobar" {
name = "My foobar host set plugin"
host_catalog_id = boundary_host_catalog_plugin.aws_example.id
preferred_endpoints = ["cidr:54.0.0.0/8"]
attributes_json = jsonencode({
"filters" = "tag-key=foo",
"filters" = "tag-key=bar"
"filters" = ["tag-key=foo", "tag-key=bar"]
})
}

Expand All @@ -54,8 +53,7 @@ resource "boundary_host_set_plugin" "launch" {
host_catalog_id = boundary_host_catalog_plugin.aws_example.id
sync_interval_seconds = 60
attributes_json = jsonencode({
"filters" = "tag:development=prod,dev",
"filters" = "launch-time=2022-01-04T*"
"filters" = ["tag:development=prod,dev", "launch-time=2022-01-04T*"]
})
}

Expand Down