blueprint_permissions

package
v1.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlueprintPermissionsResourceMarkdownDescription = `

# Blueprint Permissions resource

Docs about blueprint permissions can be found [here](https://docs.getport.io/build-your-software-catalog/set-catalog-rbac/examples/#setting-blueprint-permissions)

## Example Usage

### Allow access to all members:

` + "```hcl" + `
resource "port_blueprint_permissions" "microservices_permissions" {
  blueprint_identifier = "my_blueprint_identifier"
  entities= {
	"register" = {
		"roles": [
			"Member",
		],
		"users": [],
		"teams": []
	},
	"unregister" = {
		"roles": [
			"Member",
		],
		"users": [],
		"teams": []
	},
	"update" = {
		"roles": [
			"Member",
		],
		"users": ["test-admin-user@test.com"],
		"teams": []
	},
	"update_metadata_properties" = {
		"icon" = {
			"roles": [
				"Member",
			],
			"users": [],
			"teams": []
		},
		"identifier" = {
			"roles": [
				"Member",
			],
			"users": [],
			"teams": ["Team Spiderman"]
		},
		"team" = {
			"roles": [
				"Admin",
			],
			"users": [],
			"teams": []
		},
		"title" = {
			"roles": [
				"Member",
			],
			"users": [],
			"teams": []
		},
	},
}` + "\n```" + `

#### NOTE:

You always need to explicity set ` + "`" + `register|unregister|update|update_metadata_properties` + "`" + `properties

### Allow update ` + "`" + `myStringProperty` + "``" + ` for admins and a specific user and team:

` + "```hcl" + `
resource "port_blueprint_permissions" "microservices_permissions" {
  blueprint_identifier = "my_blueprint_identifier"
  entities = {
	  # all properties from the previous example...
	  "update_properties" = {
		  "myStringProperty" = {
				"roles": [
				  "Admin",
				],
				"users": ["test-admin-user@test.com"],
				"teams": ["Team Spiderman"],
			}
		}
	}
}` + "\n```" + `

### Allow update relations for a specific team for admins and a specific user and team:

` + "```hcl" + `
resource "port_blueprint_permissions" "microservices_permissions" {
  blueprint_identifier = "my_blueprint_identifier"
  entities = {
	  # all properties from the first example...
	  "update_relations" = {
		  "myRelations" = {
			  "roles": [
				  "Admin",
				],
				"users": ["test-admin-user@test.com"],
				"teams": ["Team Spiderman"],
			}
		}
	}
}` + "\n```" + "\n```" + `

## Disclaimer

- Blueprint permissions are created by default when blueprint is first created, this means that you should use this resource when you want to change the default permissions of a blueprint.
- When deleting a blueprint permissions resource using terraform, the blueprint permissions will not be deleted from Port, as they are required for the action to work, instead, the blueprint permissions will be removed from the terraform state.
`

Functions

func BlueprintPermissionsSchema

func BlueprintPermissionsSchema() map[string]schema.Attribute

func NewBlueprintPermissionsResource

func NewBlueprintPermissionsResource() resource.Resource

Types

type BlueprintMetadataPermissionsTFBlock

type BlueprintMetadataPermissionsTFBlock struct {
	Team       *BlueprintPermissionsTFBlock `tfsdk:"team"`
	Icon       *BlueprintPermissionsTFBlock `tfsdk:"icon"`
	Identifier *BlueprintPermissionsTFBlock `tfsdk:"identifier"`
	Title      *BlueprintPermissionsTFBlock `tfsdk:"title"`
}

type BlueprintPermissionsModel

type BlueprintPermissionsModel struct {
	ID                  types.String                       `tfsdk:"id"`
	BlueprintIdentifier types.String                       `tfsdk:"blueprint_identifier"`
	Entities            *EntitiesBlueprintPermissionsModel `tfsdk:"entities"`
}

type BlueprintPermissionsResource

type BlueprintPermissionsResource struct {
	// contains filtered or unexported fields
}

func (*BlueprintPermissionsResource) Configure

func (*BlueprintPermissionsResource) Create

func (*BlueprintPermissionsResource) Delete

func (*BlueprintPermissionsResource) ImportState

func (*BlueprintPermissionsResource) Metadata

func (*BlueprintPermissionsResource) Read

func (*BlueprintPermissionsResource) Schema

func (*BlueprintPermissionsResource) Update

type BlueprintPermissionsTFBlock

type BlueprintPermissionsTFBlock struct {
	Users       []types.String `tfsdk:"users"`
	Roles       []types.String `tfsdk:"roles"`
	Teams       []types.String `tfsdk:"teams"`
	OwnedByTeam types.Bool     `tfsdk:"owned_by_team"`
}

type BlueprintRelationsPermissionsTFBlock

type BlueprintRelationsPermissionsTFBlock map[string]BlueprintPermissionsTFBlock

type EntitiesBlueprintPermissionsModel

type EntitiesBlueprintPermissionsModel struct {
	Register                 *BlueprintPermissionsTFBlock          `tfsdk:"register"`
	Unregister               *BlueprintPermissionsTFBlock          `tfsdk:"unregister"`
	Update                   *BlueprintPermissionsTFBlock          `tfsdk:"update"`
	UpdateProperties         *BlueprintRelationsPermissionsTFBlock `tfsdk:"update_properties"`
	UpdateMetadataProperties *BlueprintMetadataPermissionsTFBlock  `tfsdk:"update_metadata_properties"`
	UpdateRelations          *BlueprintRelationsPermissionsTFBlock `tfsdk:"update_relations"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL