Skip to content

Commit

Permalink
Fix examples for Terraform 0.12
Browse files Browse the repository at this point in the history
Update map declarations in the documentation examples to work in
Terraform 0.12, as described in issue #48.
  • Loading branch information
Travis Foster committed Aug 17, 2020
1 parent 15ddec0 commit 74e1dba
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 88 deletions.
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

0 comments on commit 74e1dba

Please sign in to comment.