Skip to content

Commit

Permalink
DocFix IBM-Cloud#3425: Fix IAMPAP examples with region argument
Browse files Browse the repository at this point in the history
  • Loading branch information
kavya498 committed Dec 14, 2021
1 parent dac5f41 commit b11a821
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 43 deletions.
6 changes: 3 additions & 3 deletions website/docs/r/iam_access_group_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ resource "ibm_iam_access_group_policy" "policy" {
```

### Access group policy using service with region
The following example creates an IAM policy that grants members of the access group the IAM `Viewer` platform role to all service instances of IBM Cloud Object Storage.
The following example creates an IAM policy that grants members of the access group the IAM `Viewer` platform role to all service instances of cloudantnosqldb in us-south region

```terraform
resource "ibm_iam_access_group" "accgrp" {
Expand All @@ -63,10 +63,10 @@ resource "ibm_iam_access_group_policy" "policy" {
roles = ["Viewer"]
resources {
service = "cloud-object-storage"
service = "cloudantnosqldb"
region = "us-south"
}
}
```

### Access group policy using service_type with region
Expand Down
41 changes: 21 additions & 20 deletions website/docs/r/iam_service_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Create, update, or delete an IAM service policy. For more information, about IAM
### Service policy for all Identity and Access enabled services

```terraform
resource "ibm_iam_service_id" "serviceID" {
resource "ibm_iam_service_id" "service_id" {
name = "test"
}
resource "ibm_iam_service_policy" "policy" {
iam_service_id = ibm_iam_service_id.serviceID.id
iam_service_id = ibm_iam_service_id.service_id.id
roles = ["Viewer"]
description = "IAM Service Policy"
}
Expand All @@ -31,24 +31,25 @@ resource "ibm_iam_service_policy" "policy" {
### Service Policy using service with region

```terraform
resource "ibm_iam_service_id" "serviceID" {
resource "ibm_iam_service_id" "service_id" {
name = "test"
}
resource "ibm_iam_service_policy" "policy" {
iam_service_id = ibm_iam_service_id.serviceID.id
roles = ["Viewer"]
iam_service_id = ibm_iam_service_id.service_id.id
roles = ["Viewer", "Manager"]
resources {
service = "cloud-object-storage"
service = "cloudantnosqldb"
region = "us-south"
}
}
```
### Service policy by using resource instance

```terraform
resource "ibm_iam_service_id" "serviceID" {
resource "ibm_iam_service_id" "service_id" {
name = "test"
}
Expand All @@ -60,7 +61,7 @@ resource "ibm_resource_instance" "instance" {
}
resource "ibm_iam_service_policy" "policy" {
iam_service_id = ibm_iam_service_id.serviceID.id
iam_service_id = ibm_iam_service_id.service_id.id
roles = ["Manager", "Viewer", "Administrator"]
resources {
Expand All @@ -74,7 +75,7 @@ resource "ibm_iam_service_policy" "policy" {
### Service policy by using resource group

```terraform
resource "ibm_iam_service_id" "serviceID" {
resource "ibm_iam_service_id" "service_id" {
name = "test"
}
Expand All @@ -83,7 +84,7 @@ data "ibm_resource_group" "group" {
}
resource "ibm_iam_service_policy" "policy" {
iam_service_id = ibm_iam_service_id.serviceID.id
iam_service_id = ibm_iam_service_id.service_id.id
roles = ["Viewer"]
resources {
Expand All @@ -97,7 +98,7 @@ resource "ibm_iam_service_policy" "policy" {
### Service policy by using resource and resource type

```terraform
resource "ibm_iam_service_id" "serviceID" {
resource "ibm_iam_service_id" "service_id" {
name = "test"
}
Expand All @@ -106,7 +107,7 @@ data "ibm_resource_group" "group" {
}
resource "ibm_iam_service_policy" "policy" {
iam_service_id = ibm_iam_service_id.serviceID.id
iam_service_id = ibm_iam_service_id.service_id.id
roles = ["Administrator"]
resources {
Expand All @@ -120,7 +121,7 @@ resource "ibm_iam_service_policy" "policy" {
### Service policy by using attributes

```terraform
resource "ibm_iam_service_id" "serviceID" {
resource "ibm_iam_service_id" "service_id" {
name = "test"
}
Expand All @@ -129,7 +130,7 @@ data "ibm_resource_group" "group" {
}
resource "ibm_iam_service_policy" "policy" {
iam_service_id = ibm_iam_service_id.serviceID.id
iam_service_id = ibm_iam_service_id.service_id.id
roles = ["Administrator"]
resources {
Expand All @@ -149,7 +150,7 @@ provider "ibm" {
alias = "accA"
ibmcloud_api_key = "Account A Api Key"
}
resource "ibm_iam_service_id" "serviceID" {
resource "ibm_iam_service_id" "service_id" {
provider = ibm.accA
name = "test"
}
Expand All @@ -160,7 +161,7 @@ provider "ibm" {
}
resource "ibm_iam_service_policy" "policy" {
provider = ibm.accB
iam_id = ibm_iam_service_id.serviceID.iam_id
iam_id = ibm_iam_service_id.service_id.iam_id
roles = ["Reader"]
resources {
service = "cloud-object-storage"
Expand All @@ -172,11 +173,11 @@ resource "ibm_iam_service_policy" "policy" {
### Service policy by using resource_attributes

```terraform
resource "ibm_iam_service_id" "serviceID" {
resource "ibm_iam_service_id" "service_id" {
name = "test"
}
resource "ibm_iam_service_policy" "policy" {
iam_service_id = ibm_iam_service_id.serviceID.id
iam_service_id = ibm_iam_service_id.service_id.id
roles = ["Viewer"]
resource_attributes {
name = "resource"
Expand All @@ -193,12 +194,12 @@ resource "ibm_iam_service_policy" "policy" {
### Service Policy using service_type with region

```terraform
resource "ibm_iam_service_id" "serviceID" {
resource "ibm_iam_service_id" "service_id" {
name = "test"
}
resource "ibm_iam_service_policy" "policy" {
iam_service_id = ibm_iam_service_id.serviceID.id
iam_service_id = ibm_iam_service_id.service_id.id
roles = ["Viewer"]
resources {
Expand Down
37 changes: 19 additions & 18 deletions website/docs/r/iam_trusted_profile_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Create, update, or delete an IAM trusted profile policy. For more information, a
### Trusted Profile Policy for all Identity and Access enabled services

```terraform
resource "ibm_iam_trusted_profile" "profileID" {
resource "ibm_iam_trusted_profile" "profile_id" {
name = "test"
}
resource "ibm_iam_trusted_profile_policy" "policy" {
profile_id = ibm_iam_trusted_profile.profileID.id
profile_id = ibm_iam_trusted_profile.profile_id.id
roles = ["Viewer"]
description = "IAM Trusted Profile Policy"
}
Expand All @@ -31,24 +31,25 @@ resource "ibm_iam_trusted_profile_policy" "policy" {
### Trusted Profile Policy using service with region

```terraform
resource "ibm_iam_trusted_profile" "profileID" {
resource "ibm_iam_trusted_profile" "profile_id" {
name = "test"
}
resource "ibm_iam_trusted_profile_policy" "policy" {
profile_id = ibm_iam_trusted_profile.profileID.id
roles = ["Viewer"]
profile_id = ibm_iam_trusted_profile.profile_id.id
roles = ["Viewer", "Manager"]
resources {
service = "cloud-object-storage"
service = "cloudantnosqldb"
region = "us-south"
}
}
```
### Trusted Profile Policy by using resource instance

```terraform
resource "ibm_iam_trusted_profile" "profileID" {
resource "ibm_iam_trusted_profile" "profile_id" {
name = "test"
}
Expand All @@ -60,7 +61,7 @@ resource "ibm_resource_instance" "instance" {
}
resource "ibm_iam_trusted_profile_policy" "policy" {
profile_id = ibm_iam_trusted_profile.profileID.id
profile_id = ibm_iam_trusted_profile.profile_id.id
roles = ["Manager", "Viewer", "Administrator"]
resources {
Expand All @@ -74,7 +75,7 @@ resource "ibm_iam_trusted_profile_policy" "policy" {
### Trusted Profile Policy by using resource group

```terraform
resource "ibm_iam_trusted_profile" "profileID" {
resource "ibm_iam_trusted_profile" "profile_id" {
name = "test"
}
Expand All @@ -83,7 +84,7 @@ data "ibm_resource_group" "group" {
}
resource "ibm_iam_trusted_profile_policy" "policy" {
profile_id = ibm_iam_trusted_profile.profileID.id
profile_id = ibm_iam_trusted_profile.profile_id.id
roles = ["Viewer"]
resources {
Expand All @@ -97,7 +98,7 @@ resource "ibm_iam_trusted_profile_policy" "policy" {
### Trusted Profile Policy by using resource and resource type

```terraform
resource "ibm_iam_trusted_profile" "profileID" {
resource "ibm_iam_trusted_profile" "profile_id" {
name = "test"
}
Expand All @@ -106,7 +107,7 @@ data "ibm_resource_group" "group" {
}
resource "ibm_iam_trusted_profile_policy" "policy" {
profile_id = ibm_iam_trusted_profile.profileID.id
profile_id = ibm_iam_trusted_profile.profile_id.id
roles = ["Administrator"]
resources {
Expand All @@ -120,7 +121,7 @@ resource "ibm_iam_trusted_profile_policy" "policy" {
### Trusted Profile Policy by using attributes

```terraform
resource "ibm_iam_trusted_profile" "profileID" {
resource "ibm_iam_trusted_profile" "profile_id" {
name = "test"
}
Expand All @@ -129,7 +130,7 @@ data "ibm_resource_group" "group" {
}
resource "ibm_iam_trusted_profile_policy" "policy" {
profile_id = ibm_iam_trusted_profile.profileID.id
profile_id = ibm_iam_trusted_profile.profile_id.id
roles = ["Administrator"]
resources {
Expand All @@ -146,11 +147,11 @@ resource "ibm_iam_trusted_profile_policy" "policy" {
### Trusted Profile Policy by using resource_attributes

```terraform
resource "ibm_iam_trusted_profile" "profileID" {
resource "ibm_iam_trusted_profile" "profile_id" {
name = "test"
}
resource "ibm_iam_trusted_profile_policy" "policy" {
profile_id = ibm_iam_trusted_profile.profileID.id
profile_id = ibm_iam_trusted_profile.profile_id.id
roles = ["Viewer"]
resource_attributes {
name = "resource"
Expand All @@ -167,12 +168,12 @@ resource "ibm_iam_trusted_profile_policy" "policy" {
### Trusted Profile Policy using service_type with region

```terraform
resource "ibm_iam_trusted_profile" "profileID" {
resource "ibm_iam_trusted_profile" "profile_id" {
name = "test"
}
resource "ibm_iam_trusted_profile_policy" "policy" {
profile_id = ibm_iam_trusted_profile.profileID.id
profile_id = ibm_iam_trusted_profile.profile_id.id
roles = ["Viewer"]
resources {
Expand Down
5 changes: 3 additions & 2 deletions website/docs/r/iam_user_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ resource "ibm_iam_user_policy" "policy" {
```terraform
resource "ibm_iam_user_policy" "policy" {
ibm_id = "test@in.ibm.com"
roles = ["Viewer"]
roles = ["Viewer", "Manager"]
resources {
service = "kms"
service = "cloudantnosqldb"
region = "us-south"
}
}
Expand Down

0 comments on commit b11a821

Please sign in to comment.