directoryservice

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 22 Imported by: 0

README

Directory Service

Parity grade: A · SDK aws-sdk-go-v2/service/directoryservice@v1.38.20 · last audited 2026-07-12 (1c6af314f4ed210dbc03be80042c6af2aa07448f)

Coverage

Metric Value
Operations audited 80 (80 ok)
Feature families 2 (2 ok)
Known gaps 2
Deferred items 3
Resource leaks clean
Known gaps
  • RegisterCertificate hardcodes CommonName="example.com" instead of parsing CertificateData's X.509 subject; low-impact emulation shortcut, no wire/error divergence (no bd issue filed -- flag if a client asserts on CommonName)
  • StartADAssessment/CreateTrust/ShareDirectory etc. complete synchronously instead of AWS's async in-progress states (e.g. no "Creating"/"Sharing"/"Verifying" transient states observable by a fast poller); acceptable for emulation, but a client that asserts on an intermediate state would diverge (no bd issue filed)
Deferred
  • RegionType/RegionStatus enum value fidelity for AddRegion/DescribeRegions (values used: "Additional"/"Active" -- not cross-checked against the full RegionType/DirectoryStage enum in aws-sdk-go-v2/service/directoryservice/types/enums.go)
  • TrustState/TrustDirection/TrustType free-form validation (CreateTrust accepts any string for TrustDirection/TrustType rather than validating against the SDK's TrustDirection/TrustType enums)
  • LDAPSType/AuthType/UpdateType free-form validation (same free-string-accepted pattern across LDAPS, ClientAuthentication and UpdateDirectorySetup)

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDirectoryNotFound is returned when a directory does not exist.
	ErrDirectoryNotFound = awserr.New(errEntityNotExistsException, awserr.ErrNotFound)
	// ErrSnapshotNotFound is returned when a snapshot does not exist.
	ErrSnapshotNotFound = awserr.New(errEntityNotExistsException, awserr.ErrNotFound)
	// ErrAliasAlreadyExists is returned when the alias is already taken.
	ErrAliasAlreadyExists = awserr.New(errEntityAlreadyExistsException, awserr.ErrAlreadyExists)
	// ErrInvalidParameter is returned on invalid input.
	ErrInvalidParameter = awserr.New(errClientException, awserr.ErrInvalidParameter)
	// ErrDirectoryLimitExceeded is returned when the directory limit for the region is reached.
	ErrDirectoryLimitExceeded = awserr.New("DirectoryLimitExceededException", awserr.ErrConflict)
	// ErrSnapshotLimitExceeded is returned when the manual snapshot limit for a directory is reached.
	ErrSnapshotLimitExceeded = awserr.New("SnapshotLimitExceededException", awserr.ErrConflict)
	// ErrUnsupportedOperation is returned when an operation is not supported by the directory type.
	ErrUnsupportedOperation = awserr.New("UnsupportedOperationException", awserr.ErrConflict)

	// ErrTrustNotFound is returned when a trust does not exist.
	ErrTrustNotFound = awserr.New(errEntityNotExistsException, awserr.ErrNotFound)
	// ErrCertNotFound is returned when a certificate does not exist.
	ErrCertNotFound = awserr.New(errEntityNotExistsException, awserr.ErrNotFound)
	// ErrConditionalForwarderNotFound is returned when a conditional forwarder does not exist.
	ErrConditionalForwarderNotFound = awserr.New(errEntityNotExistsException, awserr.ErrNotFound)
	// ErrSchemaExtensionNotFound is returned when a schema extension does not exist.
	ErrSchemaExtensionNotFound = awserr.New(errEntityNotExistsException, awserr.ErrNotFound)
	// ErrSharedDirectoryNotFound is returned when a shared directory does not exist.
	ErrSharedDirectoryNotFound = awserr.New(errEntityNotExistsException, awserr.ErrNotFound)
	// ErrAssessmentNotFound is returned when an AD assessment does not exist.
	ErrAssessmentNotFound = awserr.New(errEntityNotExistsException, awserr.ErrNotFound)
)
View Source
var ErrNilAppContext = errors.New("directoryservice: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type ADAssessmentInfo

type ADAssessmentInfo struct {
	StartTime    time.Time
	AssessmentID string
	DirectoryID  string
	Status       string
	AssessType   string
	Region       string
}

ADAssessmentInfo domain type.

type CAEnrollmentPolicy

type CAEnrollmentPolicy struct {
	DirectoryID string
	Enabled     bool
}

CAEnrollmentPolicy domain type.

type CertDetail

type CertDetail struct {
	RegisteredDateTime time.Time
	ExpiryDateTime     time.Time
	CertificateID      string
	DirectoryID        string
	CommonName         string
	CertType           string
	State              string
	CertData           string
}

CertDetail domain type (for describe).

type CertInfo

type CertInfo struct {
	ExpiryDateTime time.Time
	CertificateID  string
	CommonName     string
	CertType       string
	State          string
}

CertInfo domain type (for list).

type ClientAuthInfo

type ClientAuthInfo struct {
	LastUpdatedDateTime time.Time
	DirectoryID         string
	AuthType            string
	Status              string
}

ClientAuthInfo domain type.

type ComputerInfo

type ComputerInfo struct {
	ComputerID   string
	ComputerName string
}

ComputerInfo is returned by CreateComputer.

type ConditionalForwarder

type ConditionalForwarder struct {
	DirectoryID      string
	RemoteDomainName string
	ReplicationScope string
	DNSIPAddrs       []string
}

ConditionalForwarder domain type.

type Directory

type Directory struct {
	LaunchTime  time.Time
	VpcSettings *DirectoryVpcSettings
	DirectoryID string
	Name        string
	ShortName   string
	Description string
	Alias       string
	AccessURL   string
	Type        DirectoryType
	Stage       DirectoryStage
	Size        DirectorySize
	Edition     DirectoryEdition
	SsoEnabled  bool
}

Directory represents an AWS Directory Service directory. LaunchTime is first: time.Time's non-pointer prefix reduces GC pointer bytes.

type DirectoryDataAccessStatus

type DirectoryDataAccessStatus struct {
	DirectoryID string
	Enabled     bool
}

DirectoryDataAccessStatus domain type.

type DirectoryEdition

type DirectoryEdition string

DirectoryEdition matches the AWS DirectoryEdition enum.

const (
	DirectoryEditionEnterprise DirectoryEdition = "Enterprise"
	DirectoryEditionStandard   DirectoryEdition = "Standard"
)

type DirectoryLimits

type DirectoryLimits struct {
	CloudOnlyDirectoriesCurrentCount int32
	CloudOnlyDirectoriesLimit        int32
	CloudOnlyMicrosoftADCurrentCount int32
	CloudOnlyMicrosoftADLimit        int32
	ConnectedDirectoriesCurrentCount int32
	ConnectedDirectoriesLimit        int32
	CloudOnlyDirectoriesLimitReached bool
	CloudOnlyMicrosoftADLimitReached bool
	ConnectedDirectoriesLimitReached bool
}

DirectoryLimits contains directory limit information.

type DirectorySetting

type DirectorySetting struct {
	Name          string
	Value         string
	AllowedValues string
}

DirectorySetting domain type.

type DirectorySize

type DirectorySize string

DirectorySize matches the AWS DirectorySize enum.

const (
	DirectorySizeSmall DirectorySize = "Small"
	DirectorySizeLarge DirectorySize = "Large"
)

type DirectoryStage

type DirectoryStage string

DirectoryStage matches the AWS DirectoryStage enum.

const (
	DirectoryStageRequested DirectoryStage = "Requested"
	DirectoryStageCreating  DirectoryStage = "Creating"
	DirectoryStageActive    DirectoryStage = "Active"
	DirectoryStageDeleted   DirectoryStage = "Deleted"
	DirectoryStageRestoring DirectoryStage = "Restoring"
)

type DirectoryType

type DirectoryType string

DirectoryType matches the AWS DirectoryType enum.

const (
	DirectoryTypeSimpleAD          DirectoryType = "SimpleAD"
	DirectoryTypeMicrosoftAD       DirectoryType = "MicrosoftAD"
	DirectoryTypeADConnector       DirectoryType = "ADConnector"
	DirectoryTypeSharedMicrosoftAD DirectoryType = "SharedMicrosoftAD"
)

type DirectoryVpcSettings

type DirectoryVpcSettings struct {
	VpcID             string
	SubnetIDs         []string
	SecurityGroupIDs  []string
	AvailabilityZones []string
}

DirectoryVpcSettings holds VPC networking settings for a directory.

type DomainController

type DomainController struct {
	LaunchTime       time.Time
	ControllerID     string
	DirectoryID      string
	Status           string
	AvailabilityZone string
}

DomainController domain type.

type EventTopic

type EventTopic struct {
	CreatedDateTime time.Time
	DirectoryID     string
	TopicName       string
	TopicARN        string
	Status          string
}

EventTopic domain type.

type Handler

type Handler struct {
	Backend StorageBackend
	// contains filtered or unexported fields
}

Handler handles DirectoryService HTTP requests.

func NewHandler

func NewHandler(b StorageBackend) *Handler

NewHandler constructs a new Handler.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the operation name from the X-Amz-Target header.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the directory ID from the request body when present.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset resets the backend.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore restores the backend state from a snapshot.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a matcher that accepts DirectoryService requests by X-Amz-Target header.

func (*Handler) Snapshot

func (h *Handler) Snapshot(_ context.Context) []byte

Snapshot returns a JSON snapshot of the backend state for persistence. Delegating this (and Restore below) is what makes the Handler satisfy the unexported persistence.Persistable-shaped interface cli.go's setupPersistence type-asserts services against; without it the backend's otherwise-complete BackendSnapshot/Restore implementation is never registered with the persistence manager and directoryservice state silently fails to survive a snapshot/restore cycle.

type HybridADUpdateEntry

type HybridADUpdateEntry struct {
	RequestID   string
	DirectoryID string
	Status      string
}

HybridADUpdateEntry domain type.

type InMemoryBackend

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

InMemoryBackend implements StorageBackend using in-memory maps, nested per region.

Sixteen resource collections that were previously nested by region (outer key = region, e.g. map[string]map[string]*storedTrust) are now each a single flat *store.Table keyed by the composite "region|id" string (see regionKey above and store_setup.go), with a companion *store.Index grouping entries by region for per-region scans. aliases, ipRoutes, dirDataAccess, caEnrollment, dirSettings and updateInfoEntries remain raw region-nested maps: their values carry no identity of their own to key a store.Table by (see store_setup.go's doc comment for the full rationale).

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend constructs a new InMemoryBackend.

func (*InMemoryBackend) AcceptSharedDirectory

func (b *InMemoryBackend) AcceptSharedDirectory(ctx context.Context, sharedDirectoryID string) (string, error)

AcceptSharedDirectory accepts a shared directory.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the account ID.

func (*InMemoryBackend) AddIpRoutes

func (b *InMemoryBackend) AddIpRoutes(
	ctx context.Context,
	directoryID string,
	routes []IpRoute,
) error

AddIpRoutes adds CIDR IP routes to a directory.

func (*InMemoryBackend) AddRegion

func (b *InMemoryBackend) AddRegion(ctx context.Context, directoryID, regionName string) error

AddRegion adds a region to a directory.

func (*InMemoryBackend) AddTagsToResource

func (b *InMemoryBackend) AddTagsToResource(
	ctx context.Context,
	resourceID string,
	tags []Tag,
) error

AddTagsToResource adds or updates tags on a directory.

func (*InMemoryBackend) BackendSnapshot

func (b *InMemoryBackend) BackendSnapshot() []byte

BackendSnapshot serializes the backend state to JSON, nested by region.

func (*InMemoryBackend) CancelSchemaExtension

func (b *InMemoryBackend) CancelSchemaExtension(ctx context.Context, directoryID, schemaExtensionID string) error

CancelSchemaExtension cancels a schema extension.

func (*InMemoryBackend) ConnectDirectory

func (b *InMemoryBackend) ConnectDirectory(
	ctx context.Context,
	name, shortName, description, _ string,
	size DirectorySize,
	tags []Tag,
) (*Directory, error)

ConnectDirectory creates an ADConnector directory.

func (*InMemoryBackend) CreateAlias

func (b *InMemoryBackend) CreateAlias(ctx context.Context, directoryID, alias string) error

CreateAlias creates an alias for a directory.

func (*InMemoryBackend) CreateComputer

func (b *InMemoryBackend) CreateComputer(
	ctx context.Context,
	directoryID, computerName, _ string,
) (*ComputerInfo, error)

CreateComputer creates a computer account in a directory.

func (*InMemoryBackend) CreateConditionalForwarder

func (b *InMemoryBackend) CreateConditionalForwarder(
	ctx context.Context,
	directoryID, remoteDomainName string,
	dnsIPAddrs []string,
) error

CreateConditionalForwarder creates a conditional forwarder.

func (*InMemoryBackend) CreateDirectory

func (b *InMemoryBackend) CreateDirectory(
	ctx context.Context,
	name, shortName, description, _ string,
	size DirectorySize, vpcSettings *DirectoryVpcSettings, tags []Tag,
) (*Directory, error)

CreateDirectory creates a new Simple AD directory.

func (*InMemoryBackend) CreateHybridAD

func (b *InMemoryBackend) CreateHybridAD(
	ctx context.Context,
	name, shortName, description, _ string,
	edition DirectoryEdition,
	tags []Tag,
) (*Directory, string, error)

CreateHybridAD creates a Hybrid AD directory (stored as MicrosoftAD type).

func (*InMemoryBackend) CreateLogSubscription

func (b *InMemoryBackend) CreateLogSubscription(ctx context.Context, directoryID, logGroupName string) error

CreateLogSubscription creates a log subscription.

func (*InMemoryBackend) CreateMicrosoftAD

func (b *InMemoryBackend) CreateMicrosoftAD(
	ctx context.Context,
	name, shortName, description, _ string,
	edition DirectoryEdition, vpcSettings *DirectoryVpcSettings, tags []Tag,
) (*Directory, error)

CreateMicrosoftAD creates a new Managed Microsoft AD directory.

func (*InMemoryBackend) CreateSnapshot

func (b *InMemoryBackend) CreateSnapshot(
	ctx context.Context,
	directoryID, name string,
) (*Snapshot, error)

CreateSnapshot creates a manual snapshot for a directory.

func (*InMemoryBackend) CreateTrust

func (b *InMemoryBackend) CreateTrust(
	ctx context.Context,
	directoryID, remoteDomainName, _, trustDirection, trustType string,
) (string, error)

CreateTrust creates a trust relationship.

func (*InMemoryBackend) DeleteADAssessment

func (b *InMemoryBackend) DeleteADAssessment(ctx context.Context, directoryID, assessmentID string) error

DeleteADAssessment deletes an AD assessment.

func (*InMemoryBackend) DeleteConditionalForwarder

func (b *InMemoryBackend) DeleteConditionalForwarder(ctx context.Context, directoryID, remoteDomainName string) error

DeleteConditionalForwarder deletes a conditional forwarder.

func (*InMemoryBackend) DeleteDirectory

func (b *InMemoryBackend) DeleteDirectory(ctx context.Context, directoryID string) error

DeleteDirectory deletes a directory and all associated resources.

func (*InMemoryBackend) DeleteLogSubscription

func (b *InMemoryBackend) DeleteLogSubscription(ctx context.Context, directoryID string) error

DeleteLogSubscription deletes a log subscription.

func (*InMemoryBackend) DeleteSnapshot

func (b *InMemoryBackend) DeleteSnapshot(ctx context.Context, snapshotID string) error

DeleteSnapshot deletes a snapshot.

func (*InMemoryBackend) DeleteTrust

func (b *InMemoryBackend) DeleteTrust(ctx context.Context, trustID string) (string, error)

DeleteTrust deletes a trust relationship.

func (*InMemoryBackend) DeregisterCertificate

func (b *InMemoryBackend) DeregisterCertificate(ctx context.Context, directoryID, certID string) error

DeregisterCertificate deregisters a certificate.

func (*InMemoryBackend) DeregisterEventTopic

func (b *InMemoryBackend) DeregisterEventTopic(ctx context.Context, directoryID, topicName string) error

DeregisterEventTopic deregisters an event topic.

func (*InMemoryBackend) DescribeADAssessment

func (b *InMemoryBackend) DescribeADAssessment(
	ctx context.Context,
	directoryID, assessmentID string,
) (*ADAssessmentInfo, error)

DescribeADAssessment returns details of an AD assessment.

func (*InMemoryBackend) DescribeCAEnrollmentPolicy

func (b *InMemoryBackend) DescribeCAEnrollmentPolicy(
	ctx context.Context,
	directoryID string,
) (*CAEnrollmentPolicy, error)

DescribeCAEnrollmentPolicy returns CA enrollment policy for a directory.

func (*InMemoryBackend) DescribeCertificate

func (b *InMemoryBackend) DescribeCertificate(ctx context.Context, directoryID, certID string) (*CertDetail, error)

DescribeCertificate returns details of a certificate.

func (*InMemoryBackend) DescribeClientAuthenticationSettings

func (b *InMemoryBackend) DescribeClientAuthenticationSettings(
	ctx context.Context,
	directoryID, authType string,
	limit int32,
	nextToken string,
) ([]ClientAuthInfo, string, error)

DescribeClientAuthenticationSettings returns client auth settings.

func (*InMemoryBackend) DescribeConditionalForwarders

func (b *InMemoryBackend) DescribeConditionalForwarders(
	ctx context.Context,
	directoryID string,
	remoteDomainNames []string,
) ([]ConditionalForwarder, error)

DescribeConditionalForwarders returns conditional forwarders for a directory.

func (*InMemoryBackend) DescribeDirectories

func (b *InMemoryBackend) DescribeDirectories(
	ctx context.Context,
	directoryIDs []string,
	limit int32,
	nextToken string,
) ([]*Directory, string, error)

DescribeDirectories returns directories, optionally filtered by IDs.

func (*InMemoryBackend) DescribeDirectoryDataAccess

func (b *InMemoryBackend) DescribeDirectoryDataAccess(
	ctx context.Context,
	directoryID string,
) (*DirectoryDataAccessStatus, error)

DescribeDirectoryDataAccess returns data access status for a directory.

func (*InMemoryBackend) DescribeDomainControllers

func (b *InMemoryBackend) DescribeDomainControllers(
	ctx context.Context,
	directoryID string,
	domainControllerIDs []string,
	limit int32,
	nextToken string,
) ([]DomainController, string, error)

DescribeDomainControllers returns domain controllers for a directory.

func (*InMemoryBackend) DescribeEventTopics

func (b *InMemoryBackend) DescribeEventTopics(
	ctx context.Context,
	directoryID string,
	topicNames []string,
) ([]EventTopic, error)

DescribeEventTopics returns event topics for a directory.

func (*InMemoryBackend) DescribeHybridADUpdate

func (b *InMemoryBackend) DescribeHybridADUpdate(
	ctx context.Context,
	directoryID string,
) ([]HybridADUpdateEntry, error)

DescribeHybridADUpdate returns hybrid AD update info for a directory.

func (*InMemoryBackend) DescribeLDAPSSettings

func (b *InMemoryBackend) DescribeLDAPSSettings(
	ctx context.Context,
	directoryID, ldapsType string,
	limit int32,
	nextToken string,
) ([]LDAPSSetting, string, error)

DescribeLDAPSSettings returns LDAPS settings for a directory.

func (*InMemoryBackend) DescribeRegions

func (b *InMemoryBackend) DescribeRegions(
	ctx context.Context,
	directoryID, regionName, nextToken string,
) ([]RegionDescription, string, error)

DescribeRegions returns regions for a directory.

func (*InMemoryBackend) DescribeSettings

func (b *InMemoryBackend) DescribeSettings(
	ctx context.Context,
	directoryID, status, nextToken string,
) ([]SettingEntry, string, error)

DescribeSettings returns directory settings.

func (*InMemoryBackend) DescribeSharedDirectories

func (b *InMemoryBackend) DescribeSharedDirectories(
	ctx context.Context,
	ownerDirID string,
	sharedDirIDs []string,
	limit int32,
	nextToken string,
) ([]SharedDirInfo, string, error)

DescribeSharedDirectories returns shared directories for an owner directory.

func (*InMemoryBackend) DescribeSnapshots

func (b *InMemoryBackend) DescribeSnapshots(
	ctx context.Context,
	directoryID string,
	snapshotIDs []string,
	limit int32,
	nextToken string,
) ([]*Snapshot, string, error)

DescribeSnapshots returns snapshots filtered by directory and/or snapshot IDs.

func (*InMemoryBackend) DescribeTrusts

func (b *InMemoryBackend) DescribeTrusts(
	ctx context.Context,
	directoryID string,
	trustIDs []string,
	limit int32,
	nextToken string,
) ([]TrustInfo, string, error)

DescribeTrusts returns trusts for a directory.

func (*InMemoryBackend) DescribeUpdateDirectory

func (b *InMemoryBackend) DescribeUpdateDirectory(
	ctx context.Context,
	directoryID, updateType, nextToken string,
) ([]UpdateInfoEntry, string, error)

DescribeUpdateDirectory returns update info entries for a directory.

func (*InMemoryBackend) DisableCAEnrollmentPolicy

func (b *InMemoryBackend) DisableCAEnrollmentPolicy(ctx context.Context, directoryID string) error

DisableCAEnrollmentPolicy disables CA enrollment policy.

func (*InMemoryBackend) DisableClientAuthentication

func (b *InMemoryBackend) DisableClientAuthentication(ctx context.Context, directoryID, authType string) error

DisableClientAuthentication disables client authentication.

func (*InMemoryBackend) DisableDirectoryDataAccess

func (b *InMemoryBackend) DisableDirectoryDataAccess(ctx context.Context, directoryID string) error

DisableDirectoryDataAccess disables directory data access.

func (*InMemoryBackend) DisableLDAPS

func (b *InMemoryBackend) DisableLDAPS(ctx context.Context, directoryID, ldapsType string) error

DisableLDAPS disables LDAPS for a directory.

func (*InMemoryBackend) DisableRadius

func (b *InMemoryBackend) DisableRadius(ctx context.Context, directoryID string) error

DisableRadius disables RADIUS for a directory.

func (*InMemoryBackend) DisableSso

func (b *InMemoryBackend) DisableSso(ctx context.Context, directoryID string) error

DisableSso disables single sign-on for a directory.

func (*InMemoryBackend) EnableCAEnrollmentPolicy

func (b *InMemoryBackend) EnableCAEnrollmentPolicy(ctx context.Context, directoryID string) error

EnableCAEnrollmentPolicy enables CA enrollment policy.

func (*InMemoryBackend) EnableClientAuthentication

func (b *InMemoryBackend) EnableClientAuthentication(ctx context.Context, directoryID, authType string) error

EnableClientAuthentication enables client authentication.

func (*InMemoryBackend) EnableDirectoryDataAccess

func (b *InMemoryBackend) EnableDirectoryDataAccess(ctx context.Context, directoryID string) error

EnableDirectoryDataAccess enables directory data access.

func (*InMemoryBackend) EnableLDAPS

func (b *InMemoryBackend) EnableLDAPS(ctx context.Context, directoryID, ldapsType string) error

EnableLDAPS enables LDAPS for a directory.

func (*InMemoryBackend) EnableRadius

func (b *InMemoryBackend) EnableRadius(ctx context.Context, directoryID string, settings RadiusSettingsInput) error

EnableRadius enables RADIUS for a directory.

func (*InMemoryBackend) EnableSso

func (b *InMemoryBackend) EnableSso(ctx context.Context, directoryID string) error

EnableSso enables single sign-on for a directory.

func (*InMemoryBackend) GetDirectoryLimits

func (b *InMemoryBackend) GetDirectoryLimits(ctx context.Context) *DirectoryLimits

GetDirectoryLimits returns directory limits for the region.

func (*InMemoryBackend) GetSnapshotLimits

func (b *InMemoryBackend) GetSnapshotLimits(
	ctx context.Context,
	directoryID string,
) (*SnapshotLimits, error)

GetSnapshotLimits returns snapshot limits for a directory.

func (*InMemoryBackend) ListADAssessments

func (b *InMemoryBackend) ListADAssessments(
	ctx context.Context,
	directoryID string,
	limit int32,
	nextToken string,
) ([]ADAssessmentInfo, string, error)

ListADAssessments returns AD assessments for a directory.

func (*InMemoryBackend) ListCertificates

func (b *InMemoryBackend) ListCertificates(
	ctx context.Context,
	directoryID string,
	limit int32,
	nextToken string,
) ([]CertInfo, string, error)

ListCertificates returns certificates for a directory.

func (*InMemoryBackend) ListIpRoutes

func (b *InMemoryBackend) ListIpRoutes(
	ctx context.Context,
	directoryID string,
	limit int32,
	nextToken string,
) ([]IpRoute, string, error)

ListIpRoutes returns IP routes for a directory.

func (*InMemoryBackend) ListLogSubscriptions

func (b *InMemoryBackend) ListLogSubscriptions(
	ctx context.Context,
	directoryID string,
	limit int32,
	nextToken string,
) ([]LogSubscription, string, error)

ListLogSubscriptions returns log subscriptions.

func (*InMemoryBackend) ListSchemaExtensions

func (b *InMemoryBackend) ListSchemaExtensions(
	ctx context.Context,
	directoryID string,
	limit int32,
	nextToken string,
) ([]SchemaExtension, string, error)

ListSchemaExtensions returns schema extensions for a directory.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(
	ctx context.Context,
	resourceID string,
	limit int32,
	nextToken string,
) ([]Tag, string, error)

ListTagsForResource returns tags for a directory with pagination.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the region.

func (*InMemoryBackend) RegisterCertificate

func (b *InMemoryBackend) RegisterCertificate(
	ctx context.Context,
	directoryID, certData, certType string,
) (string, error)

RegisterCertificate registers a certificate.

func (*InMemoryBackend) RegisterEventTopic

func (b *InMemoryBackend) RegisterEventTopic(ctx context.Context, directoryID, topicName string) error

RegisterEventTopic registers an event topic.

func (*InMemoryBackend) RejectSharedDirectory

func (b *InMemoryBackend) RejectSharedDirectory(ctx context.Context, sharedDirectoryID string) (string, error)

RejectSharedDirectory rejects a shared directory.

func (*InMemoryBackend) RemoveIpRoutes

func (b *InMemoryBackend) RemoveIpRoutes(
	ctx context.Context,
	directoryID string,
	cidrIPs []string,
) error

RemoveIpRoutes removes CIDR IP routes from a directory.

func (*InMemoryBackend) RemoveRegion

func (b *InMemoryBackend) RemoveRegion(ctx context.Context, directoryID string) error

RemoveRegion removes a region from a directory.

func (*InMemoryBackend) RemoveTagsFromResource

func (b *InMemoryBackend) RemoveTagsFromResource(
	ctx context.Context,
	resourceID string,
	tagKeys []string,
) error

RemoveTagsFromResource removes tags from a directory.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state.

func (*InMemoryBackend) ResetUserPassword

func (b *InMemoryBackend) ResetUserPassword(ctx context.Context, directoryID, _, _ string) error

ResetUserPassword resets a user password.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore deserializes backend state from a snapshot.

func (*InMemoryBackend) RestoreFromSnapshot

func (b *InMemoryBackend) RestoreFromSnapshot(ctx context.Context, snapshotID string) error

RestoreFromSnapshot simulates restoring a directory from a snapshot.

func (*InMemoryBackend) ShareDirectory

func (b *InMemoryBackend) ShareDirectory(
	ctx context.Context,
	directoryID, shareMethod, shareNotes, targetID string,
) (string, error)

ShareDirectory shares a directory.

func (*InMemoryBackend) StartADAssessment

func (b *InMemoryBackend) StartADAssessment(ctx context.Context, directoryID string) (string, error)

StartADAssessment starts an AD assessment.

func (*InMemoryBackend) StartSchemaExtension

func (b *InMemoryBackend) StartSchemaExtension(
	ctx context.Context,
	directoryID, description, _ string,
) (string, error)

StartSchemaExtension starts a schema extension.

func (*InMemoryBackend) UnshareDirectory

func (b *InMemoryBackend) UnshareDirectory(ctx context.Context, directoryID, targetID string) (string, error)

UnshareDirectory unshares a directory.

func (*InMemoryBackend) UpdateConditionalForwarder

func (b *InMemoryBackend) UpdateConditionalForwarder(
	ctx context.Context,
	directoryID, remoteDomainName string,
	dnsIPAddrs []string,
) error

UpdateConditionalForwarder updates a conditional forwarder.

func (*InMemoryBackend) UpdateDirectorySetup

func (b *InMemoryBackend) UpdateDirectorySetup(ctx context.Context, directoryID, updateType string, _ bool) error

UpdateDirectorySetup initiates a directory setup update.

func (*InMemoryBackend) UpdateHybridAD

func (b *InMemoryBackend) UpdateHybridAD(ctx context.Context, directoryID string) (string, error)

UpdateHybridAD updates a Hybrid AD directory.

func (*InMemoryBackend) UpdateNumberOfDomainControllers

func (b *InMemoryBackend) UpdateNumberOfDomainControllers(
	ctx context.Context,
	directoryID string,
	desiredNumber int32,
) error

UpdateNumberOfDomainControllers sets the desired domain controller count.

func (*InMemoryBackend) UpdateRadius

func (b *InMemoryBackend) UpdateRadius(ctx context.Context, directoryID string, settings RadiusSettingsInput) error

UpdateRadius updates RADIUS settings for a directory.

func (*InMemoryBackend) UpdateSettings

func (b *InMemoryBackend) UpdateSettings(
	ctx context.Context,
	directoryID string,
	settings []DirectorySetting,
) (string, error)

UpdateSettings updates directory settings.

func (*InMemoryBackend) UpdateTrust

func (b *InMemoryBackend) UpdateTrust(ctx context.Context, trustID, selectiveAuth string) (string, error)

UpdateTrust updates a trust relationship.

func (*InMemoryBackend) VerifyTrust

func (b *InMemoryBackend) VerifyTrust(ctx context.Context, trustID string) (string, error)

VerifyTrust verifies a trust relationship.

type IpRoute

type IpRoute struct {
	DirectoryID string
	CidrIP      string
	Description string
	AddedTime   time.Time
	Status      string
}

IpRoute domain type.

type LDAPSSetting

type LDAPSSetting struct {
	LastUpdatedDateTime       time.Time
	CertificateExpiryDateTime time.Time
	DirectoryID               string
	LDAPSType                 string
	CertificateID             string
	State                     string
}

LDAPSSetting domain type.

type LogSubscription

type LogSubscription struct {
	CreatedTime  time.Time
	DirectoryID  string
	LogGroupName string
}

LogSubscription domain type.

type Provider

type Provider struct{}

Provider implements service.Provider for Amazon Directory Service.

func (*Provider) Init

Init initializes the DirectoryService backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type RadiusInfo

type RadiusInfo struct {
	DirectoryID            string
	AuthenticationProtocol string
	RadiusServers          []string
	RadiusPort             int32
	RadiusRetries          int32
	RadiusTimeout          int32
	UseSameUsername        bool
}

RadiusInfo is returned by describe (currently inferred from directory).

type RadiusSettingsInput

type RadiusSettingsInput struct {
	AuthenticationProtocol string
	DisplayLabel           string
	SharedSecret           string
	RadiusServers          []string
	RadiusPort             int32
	RadiusRetries          int32
	RadiusTimeout          int32
	UseSameUsername        bool
}

RadiusSettingsInput is used for Enable/Update RADIUS.

type RegionDescription

type RegionDescription struct {
	LaunchTime  time.Time
	DirectoryID string
	RegionName  string
	RegionType  string
	Status      string
}

RegionDescription domain type.

type SchemaExtension

type SchemaExtension struct {
	StartTime   time.Time
	EndTime     time.Time
	ExtensionID string
	DirectoryID string
	Description string
	Status      string
}

SchemaExtension domain type.

type SettingEntry

type SettingEntry struct {
	LastUpdatedDateTime time.Time
	DirectoryID         string
	Name                string
	AllowedValues       string
	AppliedValue        string
	RequestedValue      string
	Status              string
}

SettingEntry domain type.

type SharedDirInfo

type SharedDirInfo struct {
	CreatedDateTime     time.Time
	LastUpdatedDateTime time.Time
	SharedDirectoryID   string
	OwnerDirectoryID    string
	OwnerAccountID      string
	SharedAccountID     string
	ShareMethod         string
	ShareStatus         string
	ShareNotes          string
}

SharedDirInfo domain type.

type Snapshot

type Snapshot struct {
	StartTime   time.Time
	SnapshotID  string
	DirectoryID string
	Name        string
	Status      SnapshotStatus
	Type        SnapshotType
}

Snapshot represents an AWS Directory Service snapshot. StartTime is first: time.Time's non-pointer prefix reduces GC pointer bytes.

type SnapshotLimits

type SnapshotLimits struct {
	ManualSnapshotsCurrentCount int32
	ManualSnapshotsLimit        int32
	ManualSnapshotsLimitReached bool
}

SnapshotLimits contains snapshot limit information.

type SnapshotStatus

type SnapshotStatus string

SnapshotStatus matches the AWS SnapshotStatus enum.

const (
	SnapshotStatusCompleted SnapshotStatus = "Completed"
)

type SnapshotType

type SnapshotType string

SnapshotType matches the AWS SnapshotType enum.

const (
	SnapshotTypeManual SnapshotType = "Manual"
)

type StorageBackend

type StorageBackend interface {
	CreateDirectory(
		ctx context.Context,
		name, shortName, description, password string,
		size DirectorySize,
		vpcSettings *DirectoryVpcSettings,
		tags []Tag,
	) (*Directory, error)
	CreateMicrosoftAD(
		ctx context.Context,
		name, shortName, description, password string,
		edition DirectoryEdition,
		vpcSettings *DirectoryVpcSettings,
		tags []Tag,
	) (*Directory, error)
	DeleteDirectory(ctx context.Context, directoryID string) error
	DescribeDirectories(
		ctx context.Context,
		directoryIDs []string,
		limit int32,
		nextToken string,
	) ([]*Directory, string, error)
	CreateAlias(ctx context.Context, directoryID, alias string) error
	EnableSso(ctx context.Context, directoryID string) error
	DisableSso(ctx context.Context, directoryID string) error
	GetDirectoryLimits(ctx context.Context) *DirectoryLimits

	CreateSnapshot(ctx context.Context, directoryID, name string) (*Snapshot, error)
	DeleteSnapshot(ctx context.Context, snapshotID string) error
	DescribeSnapshots(
		ctx context.Context,
		directoryID string,
		snapshotIDs []string,
		limit int32,
		nextToken string,
	) ([]*Snapshot, string, error)
	GetSnapshotLimits(ctx context.Context, directoryID string) (*SnapshotLimits, error)
	RestoreFromSnapshot(ctx context.Context, snapshotID string) error

	AddTagsToResource(ctx context.Context, resourceID string, tags []Tag) error
	RemoveTagsFromResource(ctx context.Context, resourceID string, tagKeys []string) error
	ListTagsForResource(ctx context.Context, resourceID string, limit int32, nextToken string) ([]Tag, string, error)

	AddIpRoutes(ctx context.Context, directoryID string, routes []IpRoute) error
	RemoveIpRoutes(ctx context.Context, directoryID string, cidrIPs []string) error
	ListIpRoutes(ctx context.Context, directoryID string, limit int32, nextToken string) ([]IpRoute, string, error)

	AddRegion(ctx context.Context, directoryID, regionName string) error
	RemoveRegion(ctx context.Context, directoryID string) error
	DescribeRegions(ctx context.Context, directoryID, regionName, nextToken string) ([]RegionDescription, string, error)

	StartSchemaExtension(ctx context.Context, directoryID, description, schemaExtensionBody string) (string, error)
	CancelSchemaExtension(ctx context.Context, directoryID, schemaExtensionID string) error
	ListSchemaExtensions(
		ctx context.Context,
		directoryID string,
		limit int32,
		nextToken string,
	) ([]SchemaExtension, string, error)

	CreateConditionalForwarder(ctx context.Context, directoryID, remoteDomainName string, dnsIPAddrs []string) error
	UpdateConditionalForwarder(ctx context.Context, directoryID, remoteDomainName string, dnsIPAddrs []string) error
	DeleteConditionalForwarder(ctx context.Context, directoryID, remoteDomainName string) error
	DescribeConditionalForwarders(
		ctx context.Context,
		directoryID string,
		remoteDomainNames []string,
	) ([]ConditionalForwarder, error)

	CreateLogSubscription(ctx context.Context, directoryID, logGroupName string) error
	DeleteLogSubscription(ctx context.Context, directoryID string) error
	ListLogSubscriptions(
		ctx context.Context,
		directoryID string,
		limit int32,
		nextToken string,
	) ([]LogSubscription, string, error)

	RegisterEventTopic(ctx context.Context, directoryID, topicName string) error
	DeregisterEventTopic(ctx context.Context, directoryID, topicName string) error
	DescribeEventTopics(ctx context.Context, directoryID string, topicNames []string) ([]EventTopic, error)

	DescribeDomainControllers(
		ctx context.Context,
		directoryID string,
		domainControllerIDs []string,
		limit int32,
		nextToken string,
	) ([]DomainController, string, error)
	UpdateNumberOfDomainControllers(ctx context.Context, directoryID string, desiredNumber int32) error

	CreateTrust(
		ctx context.Context,
		directoryID, remoteDomainName, trustPassword, trustDirection, trustType string,
	) (string, error)
	DeleteTrust(ctx context.Context, trustID string) (string, error)
	DescribeTrusts(
		ctx context.Context,
		directoryID string,
		trustIDs []string,
		limit int32,
		nextToken string,
	) ([]TrustInfo, string, error)
	UpdateTrust(ctx context.Context, trustID, selectiveAuth string) (string, error)
	VerifyTrust(ctx context.Context, trustID string) (string, error)

	ShareDirectory(ctx context.Context, directoryID, shareMethod, shareNotes, targetID string) (string, error)
	UnshareDirectory(ctx context.Context, directoryID, targetID string) (string, error)
	AcceptSharedDirectory(ctx context.Context, sharedDirectoryID string) (string, error)
	RejectSharedDirectory(ctx context.Context, sharedDirectoryID string) (string, error)
	DescribeSharedDirectories(
		ctx context.Context,
		ownerDirID string,
		sharedDirIDs []string,
		limit int32,
		nextToken string,
	) ([]SharedDirInfo, string, error)

	RegisterCertificate(ctx context.Context, directoryID, certData, certType string) (string, error)
	DeregisterCertificate(ctx context.Context, directoryID, certID string) error
	ListCertificates(ctx context.Context, directoryID string, limit int32, nextToken string) ([]CertInfo, string, error)
	DescribeCertificate(ctx context.Context, directoryID, certID string) (*CertDetail, error)
	EnableLDAPS(ctx context.Context, directoryID, ldapsType string) error
	DisableLDAPS(ctx context.Context, directoryID, ldapsType string) error
	DescribeLDAPSSettings(
		ctx context.Context,
		directoryID, ldapsType string,
		limit int32,
		nextToken string,
	) ([]LDAPSSetting, string, error)

	EnableClientAuthentication(ctx context.Context, directoryID, authType string) error
	DisableClientAuthentication(ctx context.Context, directoryID, authType string) error
	DescribeClientAuthenticationSettings(
		ctx context.Context,
		directoryID, authType string,
		limit int32,
		nextToken string,
	) ([]ClientAuthInfo, string, error)

	EnableRadius(ctx context.Context, directoryID string, settings RadiusSettingsInput) error
	DisableRadius(ctx context.Context, directoryID string) error
	UpdateRadius(ctx context.Context, directoryID string, settings RadiusSettingsInput) error

	EnableDirectoryDataAccess(ctx context.Context, directoryID string) error
	DisableDirectoryDataAccess(ctx context.Context, directoryID string) error
	DescribeDirectoryDataAccess(ctx context.Context, directoryID string) (*DirectoryDataAccessStatus, error)

	EnableCAEnrollmentPolicy(ctx context.Context, directoryID string) error
	DisableCAEnrollmentPolicy(ctx context.Context, directoryID string) error
	DescribeCAEnrollmentPolicy(ctx context.Context, directoryID string) (*CAEnrollmentPolicy, error)

	StartADAssessment(ctx context.Context, directoryID string) (string, error)
	DeleteADAssessment(ctx context.Context, directoryID, assessmentID string) error
	DescribeADAssessment(ctx context.Context, directoryID, assessmentID string) (*ADAssessmentInfo, error)
	ListADAssessments(
		ctx context.Context,
		directoryID string,
		limit int32,
		nextToken string,
	) ([]ADAssessmentInfo, string, error)

	CreateHybridAD(
		ctx context.Context,
		name, shortName, description, password string,
		edition DirectoryEdition,
		tags []Tag,
	) (*Directory, string, error)
	UpdateHybridAD(ctx context.Context, directoryID string) (string, error)
	DescribeHybridADUpdate(ctx context.Context, directoryID string) ([]HybridADUpdateEntry, error)

	CreateComputer(ctx context.Context, directoryID, computerName, password string) (*ComputerInfo, error)

	UpdateSettings(ctx context.Context, directoryID string, settings []DirectorySetting) (string, error)
	DescribeSettings(ctx context.Context, directoryID, status, nextToken string) ([]SettingEntry, string, error)
	UpdateDirectorySetup(ctx context.Context, directoryID, updateType string, createSnapshotBeforeUpdate bool) error
	DescribeUpdateDirectory(
		ctx context.Context,
		directoryID, updateType, nextToken string,
	) ([]UpdateInfoEntry, string, error)

	ResetUserPassword(ctx context.Context, directoryID, userName, newPassword string) error

	ConnectDirectory(
		ctx context.Context,
		name, shortName, description, password string,
		size DirectorySize,
		tags []Tag,
	) (*Directory, error)

	AccountID() string
	Region() string
	Reset()
	BackendSnapshot() []byte
	Restore(ctx context.Context, data []byte) error
}

StorageBackend is the interface for DirectoryService storage operations.

type Tag

type Tag struct {
	Key   string
	Value string
}

Tag is a key-value pair.

type TrustInfo

type TrustInfo struct {
	CreatedDateTime      time.Time
	LastUpdatedDateTime  time.Time
	StateLastUpdatedTime time.Time
	TrustID              string
	DirectoryID          string
	RemoteDomainName     string
	TrustDirection       string
	TrustType            string
	TrustState           string
	SelectiveAuth        string
	TrustStateReason     string
}

TrustInfo domain type.

type UpdateInfoEntry

type UpdateInfoEntry struct {
	StartTime           time.Time
	LastUpdatedDateTime time.Time
	DirectoryID         string
	UpdateType          string
	Status              string
	NewValue            string
	PreviousValue       string
	InitiatedBy         string
	Region              string
}

UpdateInfoEntry domain type.

Jump to

Keyboard shortcuts

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