iam

package
v0.119.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountBatches

func CountBatches(size, batchSize int) int

func NewIamBinding

func NewIamBinding(updater ResourceIamUpdater) resource.Resource

Types

type Extractable

type Extractable interface {
	GetAttribute(ctx context.Context, path path.Path, target interface{}) diag.Diagnostics
}

type Policy

type Policy struct {
	Bindings []*access.AccessBinding
}

func (Policy) String

func (p Policy) String() string

type PolicyDelta

type PolicyDelta struct {
	Deltas []*access.AccessBindingDelta
}

type ResourceIamUpdater

type ResourceIamUpdater interface {
	// GetResourceIamPolicy Fetch the existing IAM policy attached to a resource.
	GetResourceIamPolicy(ctx context.Context) (*Policy, error)

	// SetResourceIamPolicy Replaces the existing IAM Policy attached to a resource.
	// Useful for `iam_binding` and `iam_policy` resources
	SetResourceIamPolicy(ctx context.Context, policy *Policy) error

	// UpdateResourceIamPolicy Updates the existing IAM Policy attached to a resource.
	// Useful for `iam_member` resources
	UpdateResourceIamPolicy(ctx context.Context, policy *PolicyDelta) error

	// GetMutexKey A mutex guards against concurrent call to the SetResourceIamPolicy method.
	// The mutex key should be made of the resource type and resource id.
	// For example: `iam-folder-{id}`.
	GetMutexKey() string

	// Initialize Initializing resource from given state
	Initialize(ctx context.Context, state Extractable, diag *diag.Diagnostics)

	// DescribeResource Textual description of this resource to be used in error message.
	// The description should include the unique resource identifier.
	DescribeResource() string

	// Configure Configurate resource with provider data etc.
	Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)

	// GetSchemaAttributes Gets resource iam schema. Usually single field with resource id name alias.
	GetSchemaAttributes() map[string]schema.Attribute

	// GetNameSuffix Gets resource terraform name suffix without leading underscore.
	GetNameSuffix() string

	// GetIdAlias Gets resource id alias that used in resource schema for resource configuration.
	GetIdAlias() string

	// GetId Gets resource id.
	GetId() string
}

type Settable

type Settable interface {
	SetAttribute(ctx context.Context, path path.Path, val interface{}) diag.Diagnostics
}

Jump to

Keyboard shortcuts

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