Files
terraform-provider-threshold/docs/resources/scope.md
T

88 lines
2.8 KiB
Markdown
Raw Normal View History

2020-10-06 20:34:16 -04:00
---
page_title: "boundary_scope Resource - terraform-provider-boundary"
subcategory: ""
description: |-
The scope resource allows you to configure a Boundary scope.
---
# Resource `boundary_scope`
The scope resource allows you to configure a Boundary scope.
## Example Usage
Creating the global scope:
```terraform
resource "boundary_scope" "global" {
2020-10-13 23:12:03 -04:00
global_scope = true
scope_id = "global"
2020-10-06 20:34:16 -04:00
}
```
Creating an organization scope within global:
```terraform
resource "boundary_scope" "org" {
2020-10-13 23:12:03 -04:00
name = "organization_one"
description = "My first scope!"
scope_id = boundary_scope.global.id
auto_create_admin_role = true
auto_create_default_role = true
2020-10-06 20:34:16 -04:00
}
```
Creating an project scope within an organization:
```terraform
resource "boundary_scope" "project" {
2020-10-13 23:12:03 -04:00
name = "project_one"
description = "My first scope!"
scope_id = boundary_scope.org.id
auto_create_admin_role = true
2020-10-06 20:34:16 -04:00
}
```
Creating an organization scope with a managed role for administration (auto create role set false):
```terraform
resource "boundary_scope" "org" {
name = "organization_one"
description = "My first scope!"
scope_id = boundary_scope.global.id
}
resource "boundary_role" "org_admin" {
scope_id = boundary_scope.global.id
grant_scope_id = boundary_scope.org.id
grant_strings = ["id=*;type=*;actions=*"]
principal_ids = ["u_auth"]
}
```
2021-01-14 14:07:36 -08:00
<!-- schema generated by tfplugindocs -->
2020-10-06 20:34:16 -04:00
## Schema
### Required
2022-05-13 18:10:43 -07:00
- `scope_id` (String) The scope ID containing the sub scope resource.
2020-10-06 20:34:16 -04:00
### Optional
2022-05-13 18:10:43 -07:00
- `auto_create_admin_role` (Boolean) If set, when a new scope is created, the provider will not disable the functionality that automatically creates a role in the new scope and gives permissions to manage the scope to the provider's user. Marking this true makes for simpler HCL but results in role resources that are unmanaged by Terraform.
- `auto_create_default_role` (Boolean) Only relevant when creating an org scope. If set, when a new scope is created, the provider will not disable the functionality that automatically creates a role in the new scope and gives listing of scopes and auth methods and the ability to authenticate to the anonymous user. Marking this true makes for simpler HCL but results in role resources that are unmanaged by Terraform.
- `description` (String) The scope description.
- `global_scope` (Boolean) Indicates that the scope containing this value is the global scope, which triggers some specialized behavior to allow it to be imported and managed.
- `name` (String) The scope name. Defaults to the resource name.
2020-10-07 12:04:11 -04:00
2021-05-05 10:02:53 -07:00
### Read-Only
2022-05-13 18:10:43 -07:00
- `id` (String) The ID of the scope.
2020-10-07 12:04:11 -04:00
## Import
Import is supported using the following syntax:
```shell
terraform import boundary_scope.foo <my-id>
2020-10-13 23:12:03 -04:00
```