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

Fix examples for Terraform 0.12 #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions website/docs/index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ with the proper credentials before it can be used.

## Example Usage
```hcl
# Required for [Terraform 0.13](https://www.terraform.io/upgrade-guides/0-13.html)
terraform {
required_providers {
artifactory = {
source = "terraform.example.com/atlassian/artifactory"
version = "2.0.0"
}
}
}

# Configure the Artifactory provider
provider "artifactory" {
url = "${var.artifactory_url}"
Expand Down
87 changes: 18 additions & 69 deletions website/docs/r/artifactory_permission_target.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,33 @@ Provides an Artifactory permission target resource. This can be used to create a
resource "artifactory_permission_target" "test-perm" {
name = "test-perm"

repo = {
repo {
includes_pattern = ["foo/**"]
excludes_pattern = ["bar/**"]
repositories = ["example-repo-local"]

actions = {
users = [
{
name = "anonymous"
permissions = ["read", "write"]
},
]

groups = [
{
name = "readers"
permissions = ["read"]
},
]
actions {
users {
name = "anonymous"
permissions = ["read", "write"]
}

groups {
name = "readers"
permissions = ["read"]
}
}
}

build = {
build {
includes_pattern = ["**"]
repositories = ["artifactory-build-info"]

actions = {
users = [
{
name = "anonymous"
permissions = ["read", "write"]
},
]
actions {
users {
name = "anonymous"
permissions = ["read", "write"]
}
}
}
}
Expand All @@ -77,49 +72,3 @@ Permission targets can be imported using their name, e.g.
```
$ terraform import artifactory_permission_target.terraform-test-permission mypermission
```


Provides an Artifactory permission target resource. This can be used to create and manage Artifactory permission targets.

## Example Usage

```hcl
# Create a new Artifactory permission target called testpermission
resource "artifactory_permission_targets" "terraform-test-permission" {
name = "testpermission"
repositories = ["myrepo"]
users = [
{
name = "test_user"
permissions = ["r", "w"]
}
]
groups = [
{
name = "readers"
permissions = ["r"]
}
]
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Required) Name of permission
* `includes_pattern` - (Optional) Pattern of artifacts to include
* `excludes_pattern` - (Optional) Pattern of artifacts to exclude
* `repositories` - (Optional) List of repositories this permission target is applicable for
* `users` - (Optional) Users this permission target applies for.
* `groups` - (Optional) Groups this permission applies for.

The permissions can be set to a combination of m=admin; d=delete; w=deploy; n=annotate; r=read

## Import

Permission targets can be imported using their name, e.g.

```
$ terraform import artifactory_permission_targets.terraform-test-permission mypermission
```
20 changes: 8 additions & 12 deletions website/docs/r/artifactory_permission_target_v1.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@ Provides an Artifactory permission target resource. This can be used to create a
resource "artifactory_permission_targets" "terraform-test-permission" {
name = "testpermission"
repositories = ["myrepo"]
users = [
{
name = "test_user"
permissions = ["r", "w"]
}
]
groups = [
{
name = "readers"
permissions = ["r"]
}
]
users {
name = "test_user"
permissions = ["r", "w"]
}
groups {
name = "readers"
permissions = ["r"]
}
}
```

Expand Down
12 changes: 5 additions & 7 deletions website/docs/r/artifactory_replication_config.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ resource "artifactory_replication_config" "foo-rep" {
cron_exp = "0 0 * * * ?"
enable_event_replication = true

replications = [
{
url = "$var.artifactory_url"
username = "$var.artifactory_username"
password = "$var.artifactory_password"
}
]
replications {
url = "$var.artifactory_url"
username = "$var.artifactory_username"
password = "$var.artifactory_password"
}
}
```

Expand Down