jfrog / terraform-provider-artifactory

Terraform provider to manage JFrog Artifactory
https://jfrog.com/artifactory
Apache License 2.0
272 stars 102 forks source link

[Feat] Xray Watch Support #6

Closed josh-barker-coles closed 3 years ago

josh-barker-coles commented 3 years ago

Hi,

This issue is to discuss the implementation of a watch resource.

I've started implementing the code in https://github.com/jfrog/jfrog-client-go/pull/211 to support a watch resource. I've also started working on the watch resource locally, and will push this up, but I have a few design questions.

Firstly, the endpoint to create/manage a watch is different.

For example:

This means the provider will need at least the xray_url parameter, as an optional parameter.

Can we use the existing credential variables - username, password, api_key and access_token, or would we need a separate set of variables?

Do you have any feedback on the below examples of the resource?

Example resource - All Repos

```hcl resource "artifactory_watch" "all_repos" { name = "all_repos" description = "all_repos" active = true all_repositories { package_types = ["NuGet", "Docker"] filter_path = ["path/**"] filter_names = ["name1", "name2"] filter_mime_types = ["application/zip"] filter_property { key = "field1" value = "value 1" } filter_property { key = "field2" value = "value 2" } include_patterns = [ "path1/**" ] exclude_patterns = [ "path1/ignore/**" ] } policy { name = "policy-1" type = "security" } policy { name = "policy-2" type = "security" } } ```

Example resource - Repos by name

```hcl resource "artifactory_watch" "named_repos" { name = "named_repos" description = "named_repos" active = true repository { name = "repo1" package_types = ["NuGet", "Docker"] filter_path = ["path/**"] filter_names = ["name1", "name2"] filter_mime_types = ["application/zip"] filter_property { key = "field1" value = "value 1" } filter_property { key = "field2" value = "value 2" } include_patterns = [ "path1/**" ] exclude_patterns = [ "path1/ignore/**" ] } policy { name = "policy-1" type = "security" } } ```

Example resource - All Builds

```hcl resource "artifactory_watch" "all_builds" { name = "all_builds" description = "all_builds" active = true all_builds { bin_mgr_id = "default" } policy { name = "policy-1" type = "security" } policy { name = "policy-2" type = "security" } } ```

Example resource - Named build

```hcl resource "artifactory_watch" "named_builds" { name = "named_builds" description = "named_builds" active = true build { name = "build1" bin_mgr_id = "default" } policy { name = "policy-1" type = "security" } } ```

Is there anything else I need to know?

Cheers,

Josh

References:

josh-barker-coles commented 3 years ago

@chb0github I'd like to use this provider for the watch support, but we need the include/exclude filters. Are there plans to support this?

I've tested #36 and also found that:

Did you want me to open a separate issue for these?

chb0github commented 3 years ago

That would be ideal, if you could.

Thanks

On Wed, Mar 3, 2021, 22:16 josh-barker-coles notifications@github.com wrote:

@chb0github https://github.com/chb0github I've tested #36 https://github.com/jfrog/terraform-provider-artifactory/pull/36 and found that:

  • Property filters are not supported
  • Include and Exclude filters are not supported
  • Resource documentation is missing

Did you want me to open a separate issue for these?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jfrog/terraform-provider-artifactory/issues/6#issuecomment-790326752, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALIRUFQVA2AB6UXF7N6OY3TB4QS7ANCNFSM4TAKXQHA .

--

https://swampup.jfrog.com/?utm_source=email-signature&utm_medium=banner&utm_campaign=swampUP_Live&utm_term=2021