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

Add nomad_acl_tokens data source #128

Merged
merged 5 commits into from
Jul 13, 2020

Conversation

remilapeyre
Copy link
Collaborator

Closes #86

@cgbaker cgbaker added this to the 1.4.9 milestone Jul 11, 2020
Copy link
Contributor

@cgbaker cgbaker left a comment

Choose a reason for hiding this comment

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

some minor changes; QueryOptions will make for a more efficient call to the server and less work to do in the provider

nomad/data_source_acl_tokens.go Outdated Show resolved Hide resolved
website/nomad.erb Outdated Show resolved Hide resolved
cgbaker added a commit that referenced this pull request Jul 11, 2020
@cgbaker cgbaker mentioned this pull request Jul 11, 2020
}
}

d.SetId("nomad-tokens")
Copy link
Contributor

Choose a reason for hiding this comment

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

apologies for not noticing this before... does this ID need to include the prefix? different data "nomad_acl_tokens" with different prefix options should (probably?) have different IDs.

Copy link
Contributor

@cgbaker cgbaker Jul 12, 2020

Choose a reason for hiding this comment

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

i manually tested this as-written and terraform didn't complain... i will ask someone from the provider team on Monday.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the ID does not matters as long as it is not "" as this is used to indicate, it's usually set to the external ID for resources that have one but when a Terraform resource is a virtual resource (like https://github.com/hashicorp/terraform-provider-null/blob/master/null/data_source.go#L51) or is actually multiple resource it can be set to something else.

I can push a commit to change it to d.SetId(client.Address() + "/tokens/" + prefix) which would make it more like the pattern used by the other datasources if you want.

@cgbaker
Copy link
Contributor

cgbaker commented Jul 12, 2020 via email

cgbaker added a commit that referenced this pull request Jul 13, 2020
@cgbaker cgbaker merged commit 8833cf1 into hashicorp:master Jul 13, 2020
@cgbaker
Copy link
Contributor

cgbaker commented Jul 13, 2020

thanks, @remilapeyre!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create data source for listing ACL tokens
2 participants