directoryservice

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 25 Imported by: 0

README

Directory Service

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

Coverage

Metric Value
Operations audited 80 (80 ok)
Feature families 2 (2 ok)
Known gaps 3
Deferred items 1
Resource leaks clean
Known gaps
  • DirectoryDescription (DescribeDirectories/CreateDirectory/CreateMicrosoftAD/ConnectDirectory responses) does not mirror ConnectSettings, DesiredNumberOfDomainControllers, DnsIpv6Addrs, HybridSettings, NetworkType, OsVersion, OwnerDirectoryDescription, RadiusStatus, RegionsInfo, ShareMethod, ShareNotes, ShareStatus, StageReason onto the top-level summary, even though most of that data is independently trackable/retrievable via the dedicated Describe* ops for those sub-resources (DescribeRegions, radius.go, shared_directories.go, hybrid_ad.go). StageLastUpdatedDateTime and DnsIpAddrs were the two highest-value gaps in this set and were fixed this pass (see DescribeDirectories note above); the rest are lower-value summary duplication, not fixed (no bd issue filed).
  • DomainController (DescribeDomainControllers response) is missing DnsIpAddr, DnsIpv6Addr, StatusLastUpdatedDateTime, StatusReason, SubnetId, VpcId -- confirmed against types.DomainController; storedDomainController only tracks ControllerID/DirectoryID/Status/AvailabilityZone/LaunchTime. Not fixed this pass (no bd issue filed); flag if a client asserts on domain-controller IP/subnet/VPC identity.
  • 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
  • Full field-diff of every remaining "ok"-marked op family (conditional forwarders, log subscriptions, event topics, schema extensions, radius, shared directories, hybrid AD, AD assessments, settings) against their SDK response types was NOT repeated this pass beyond the epoch-timestamp sweep already recorded above; this pass's field-diffs concentrated on trusts/regions/certificates/directories because that's where the (now-closed) enum-validation deferred items and the explicitly-flagged StageLastUpdatedDateTime bug class pointed. Given the real gaps found in 3-for-3 families actually field-diffed this pass (Trust, Region, Directory all had missing/wrong wire fields despite being marked "ok"), the remaining "ok" families should NOT be trusted without an independent field-diff next pass.

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(errInvalidParameterException, 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)
	// ErrInvalidCertificate is returned when CertificateData is not a parseable PEM certificate.
	ErrInvalidCertificate = awserr.New("InvalidCertificateException", awserr.ErrInvalidParameter)
)
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 ADAssessmentConfiguration added in v1.2.0

type ADAssessmentConfiguration struct {
	DNSName          string
	VPCID            string
	CustomerDNSIPs   []string
	InstanceIDs      []string
	SecurityGroupIDs []string
	SubnetIDs        []string
}

ADAssessmentConfiguration mirrors the real, optional StartADAssessmentInput.AssessmentConfiguration (types.AssessmentConfiguration). When a caller supplies AssessmentConfiguration at all, DNSName/CustomerDNSIPs/ InstanceIDs/VPCID/SubnetIDs are required members (matching the real SDK's validateAssessmentConfiguration); SecurityGroupIDs is optional.

type ADAssessmentInfo

type ADAssessmentInfo struct {
	StartTime          time.Time
	LastUpdateDateTime time.Time
	AssessmentID       string
	DirectoryID        string
	Status             string
	AssessType         string
	Region             string
	DNSName            string
	VPCID              string
	StatusCode         string
	StatusReason       string
	Version            string
	CustomerDNSIPs     []string
	InstanceIDs        []string
	SecurityGroupIDs   []string
	SubnetIDs          []string
}

ADAssessmentInfo domain type for both DescribeADAssessment (full Assessment shape) and ListADAssessments (AssessmentSummary shape, a strict subset -- see handler_ad_assessments.go for which fields each op actually puts on the wire). DNSName/CustomerDNSIPs/InstanceIDs/SecurityGroupIDs/VPCID/SubnetIDs come from the real, optional StartADAssessmentInput.AssessmentConfiguration (types.AssessmentConfiguration) when the caller supplies it; they are empty for assessments started without one (e.g. UpdateHybridAD's internally-triggered assessment, which has no AssessmentConfiguration input in the real API either). StatusCode/StatusReason/Version are real Assessment members this backend cannot honestly populate: AWS documents them as assessment-engine-internal output (a detailed status code, a human-readable status/error message, and the assessment-framework version) with no request input and no documented deterministic default -- same class of gap as Directory.OsVersion (see PARITY.md). Left always empty rather than invented.

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 ClientAuthenticationType added in v1.2.0

type ClientAuthenticationType string

ClientAuthenticationType matches the AWS ClientAuthenticationType enum.

const (
	ClientAuthenticationTypeSmartCard           ClientAuthenticationType = "SmartCard"
	ClientAuthenticationTypeSmartCardOrPassword ClientAuthenticationType = "SmartCardOrPassword"
)

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
	DNSIPv6Addrs     []string
}

ConditionalForwarder domain type.

type ConnectSettingsInput added in v1.2.0

type ConnectSettingsInput struct {
	CustomerUserName string
	VpcID            string
	SubnetIDs        []string
	CustomerDNSIPs   []string
	CustomerDNSIPsV6 []string
}

ConnectSettingsInput carries the AD Connector settings supplied to ConnectDirectory (matches AWS's DirectoryConnectSettings request shape).

type Directory

type Directory struct {
	LaunchTime                       time.Time
	StageLastUpdatedDateTime         time.Time
	VpcSettings                      *DirectoryVpcSettings
	ConnectSettings                  *DirectoryConnectSettingsDescription
	RegionsInfo                      *RegionsInfo
	RadiusSettings                   *RadiusSettingsDescription
	HybridSettings                   *HybridSettingsDescription
	OwnerDirectoryDescription        *OwnerDirectoryDescription
	DesiredNumberOfDomainControllers *int32
	StageReason                      *string
	DirectoryID                      string
	Name                             string
	ShortName                        string
	Description                      string
	Alias                            string
	AccessURL                        string
	ShareNotes                       string
	Type                             DirectoryType
	Stage                            DirectoryStage
	Size                             DirectorySize
	Edition                          DirectoryEdition
	NetworkType                      NetworkType
	RadiusStatus                     RadiusStatus
	ShareMethod                      ShareMethod
	ShareStatus                      ShareStatus
	OsVersion                        OSVersion
	DNSIPAddrs                       []string
	DNSIPv6Addrs                     []string
	SsoEnabled                       bool
}

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

type DirectoryConnectSettingsDescription added in v1.2.0

type DirectoryConnectSettingsDescription struct {
	CustomerUserName  string
	SecurityGroupID   string
	VpcID             string
	SubnetIDs         []string
	AvailabilityZones []string
	ConnectIPs        []string
	ConnectIPsV6      []string
}

DirectoryConnectSettingsDescription mirrors AWS's DirectoryConnectSettingsDescription, returned only for AD Connector directories. SecurityGroupID and AvailabilityZones are not populated: this backend does not model VPC/subnet-to-AZ or security-group provisioning, so there is no real value to derive them from (see PARITY.md).

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 {
	StatusReason              *string
	LaunchTime                time.Time
	StatusLastUpdatedDateTime time.Time
	ControllerID              string
	DirectoryID               string
	Status                    string
	AvailabilityZone          string
	DNSIPAddr                 string
	DNSIPv6Addr               string
	SubnetID                  string
	VpcID                     string
}

DomainController domain type. StatusReason is never populated: this backend's domain controllers always report Status "Active" and never enter a failed state that would produce a real status-reason message (see PARITY.md).

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 {
	StartTime           time.Time
	LastUpdatedDateTime time.Time
	AssessmentID        string
	InitiatedBy         string
	Status              string
	StatusReason        string
	NewDNSIPs           []string
	NewInstanceIDs      []string
	PreviousDNSIPs      []string
	PreviousInstanceIDs []string
}

HybridADUpdateEntry mirrors types.HybridUpdateInfoEntry, the real per-entry shape DescribeHybridADUpdate returns (nested under UpdateActivities. HybridAdministratorAccount/SelfManagedInstances). NewDNSIPs/NewInstanceIDs and PreviousDNSIPs/PreviousInstanceIDs mirror the real NewValue/ PreviousValue (types.HybridUpdateValue{DnsIps,InstanceIds}).

type HybridSettingsDescription added in v1.2.0

type HybridSettingsDescription struct {
	SelfManagedDNSIPAddrs  []string
	SelfManagedInstanceIDs []string
}

HybridSettingsDescription mirrors AWS's HybridSettingsDescription. Populated once a directory is hybridized via CreateHybridAD (non-nil, initially empty slices) and kept current by UpdateHybridAD's SelfManagedInstancesSettings (CustomerDnsIps/InstanceIds) -- the only real source of this data, since CreateHybridADInput itself carries none (see PARITY.md).

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,
	vpcSettings *DirectoryVpcSettings,
) 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,
	networkType NetworkType,
	connectSettings ConnectSettingsInput,
	tags []Tag,
) (*Directory, error)

ConnectDirectory creates an ADConnector directory. Unlike CreateDirectory and CreateMicrosoftAD, AWS's real ConnectDirectory requires a DirectoryConnectSettings object (CustomerUserName, VpcId, SubnetIds); we enforce the same required fields here.

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, dnsIPv6Addrs []string,
) error

CreateConditionalForwarder creates a conditional forwarder.

func (*InMemoryBackend) CreateDirectory

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

CreateDirectory creates a new Simple AD directory.

func (*InMemoryBackend) CreateHybridAD

func (b *InMemoryBackend) CreateHybridAD(
	ctx context.Context,
	assessmentID, secretArn string,
	tags []Tag,
) (*Directory, error)

CreateHybridAD creates a hybrid directory. Real CreateHybridADInput is {AssessmentId, SecretArn, Tags} -- AWS derives the new directory's Name and other descriptive fields from AssessmentId's own AssessmentConfiguration (DnsName etc.), which this backend cannot capture since StartADAssessment doesn't accept AssessmentConfiguration (a separate, already-tracked gap; see PARITY.md). Rather than fabricating a domain name, this backend derives them from the SAME assessment's snapshotted source-directory fields (SourceDirectoryName etc., captured at StartADAssessment time from the existing directory that was assessed) -- genuinely real data, not invented. SecretArn is real-shape "used once and not stored" (accepted, validated, discarded), matching AWS's own documented behavior.

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, networkType NetworkType, 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, selectiveAuth 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, updateType string,
) ([]HybridADUpdateEntry, []HybridADUpdateEntry, error)

DescribeHybridADUpdate returns update-activity history for a hybrid directory, split by real UpdateType into the two groups real types.HybridUpdateActivities carries (hybridAdministratorAccount/ selfManagedInstances return values, in that order). updateType, if non-empty, filters to a single group (matching the real optional DescribeHybridADUpdateInput.UpdateType request member).

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. certData must be a PEM-encoded X.509 certificate, matching AWS's real CertificateData contract; CommonName and ExpiryDateTime are derived from the parsed certificate (not fabricated), mirroring how AWS Directory Service actually validates and reads the cert.

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,
	cfg *ADAssessmentConfiguration,
) (string, error)

StartADAssessment starts an AD assessment. cfg is the real, optional StartADAssessmentInput.AssessmentConfiguration member.

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, dnsIPv6Addrs []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, adminAccountSecretArn string,
	selfManagedDNSIPs, selfManagedInstanceIDs []string,
) (string, error)

UpdateHybridAD updates a hybrid directory's administrator-account secret and/or self-managed instance settings. Real UpdateHybridADInput requires at least one of HybridAdministratorAccountUpdate (adminAccountSecretArn, used once and not stored, same as CreateHybridAD's SecretArn) or SelfManagedInstancesSettings (selfManagedDNSIPs/selfManagedInstanceIDs, required to have a 1:1 correspondence per the real docs). Real UpdateHybridADOutput is {AssessmentId, DirectoryId} -- AWS triggers a fresh assessment to validate the update. This backend triggers a REAL assessment via startADAssessmentLocked (the same op StartADAssessment uses), since UpdateHybridAD always targets an existing directory -- the one mode this backend's assessment engine genuinely supports.

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 LDAPSType added in v1.2.0

type LDAPSType string

LDAPSType matches the AWS LDAPSType enum.

const (
	LDAPSTypeClient LDAPSType = "Client"
)

type LogSubscription

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

LogSubscription domain type.

type NetworkType added in v1.2.0

type NetworkType string

NetworkType matches the AWS NetworkType enum.

const (
	NetworkTypeDualStack NetworkType = "Dual-stack"
	NetworkTypeIPv4Only  NetworkType = "IPv4"
	NetworkTypeIPv6Only  NetworkType = "IPv6"
)

type OSVersion added in v1.2.0

type OSVersion string

OSVersion matches the AWS OSVersion enum. This backend does not track a directory's underlying OS version (AWS assigns it internally and does not document a deterministic default), so Directory.OsVersion is always left as the zero value; see PARITY.md.

const (
	OSVersionVersion2012 OSVersion = "SERVER_2012"
	OSVersionVersion2019 OSVersion = "SERVER_2019"
)

type OwnerDirectoryDescription added in v1.2.0

type OwnerDirectoryDescription struct {
	RadiusSettings *RadiusSettingsDescription
	VpcSettings    *DirectoryVpcSettings
	AccountID      string
	DirectoryID    string
	NetworkType    NetworkType
	RadiusStatus   RadiusStatus
	DNSIPAddrs     []string
	DNSIPv6Addrs   []string
}

OwnerDirectoryDescription mirrors AWS's OwnerDirectoryDescription, present on the directory-consumer's copy of a shared directory. This backend never populates it: shared directories are tracked only via SharedDirInfo (DescribeSharedDirectories) and are not materialized as a separate Directory entry in the consumer's DescribeDirectories view (see PARITY.md).

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 RadiusSettingsDescription added in v1.2.0

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

RadiusSettingsDescription mirrors AWS's RadiusSettings type as returned on DirectoryDescription.RadiusSettings. RadiusServersIPv6 is not populated: this backend's RADIUS settings storage does not track IPv6 server addresses (see PARITY.md).

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 RadiusStatus added in v1.2.0

type RadiusStatus string

RadiusStatus matches the AWS RadiusStatus enum.

const (
	RadiusStatusCreating  RadiusStatus = "Creating"
	RadiusStatusCompleted RadiusStatus = "Completed"
	RadiusStatusFailed    RadiusStatus = "Failed"
)

type RegionDescription

type RegionDescription struct {
	LaunchTime                 time.Time
	StatusLastUpdatedDateTime  time.Time
	VpcSettings                *DirectoryVpcSettings
	DirectoryID                string
	RegionName                 string
	RegionType                 string
	Status                     string
	DesiredNumberOfDomainCtrls int32
}

RegionDescription domain type.

type RegionsInfo added in v1.2.0

type RegionsInfo struct {
	PrimaryRegion     string
	AdditionalRegions []string
}

RegionsInfo mirrors AWS's RegionsInfo, describing multi-Region replication for a Managed Microsoft AD directory.

type SchemaExtension

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

SchemaExtension domain type.

type SelectiveAuth added in v1.2.0

type SelectiveAuth string

SelectiveAuth matches the AWS SelectiveAuth enum.

const (
	SelectiveAuthEnabled  SelectiveAuth = "Enabled"
	SelectiveAuthDisabled SelectiveAuth = "Disabled"
)

type SettingEntry

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

SettingEntry domain type.

type ShareMethod added in v1.2.0

type ShareMethod string

ShareMethod matches the AWS ShareMethod enum.

const (
	ShareMethodOrganizations ShareMethod = "ORGANIZATIONS"
	ShareMethodHandshake     ShareMethod = "HANDSHAKE"
)

type ShareStatus added in v1.2.0

type ShareStatus string

ShareStatus matches the AWS ShareStatus enum.

const (
	ShareStatusShared            ShareStatus = "Shared"
	ShareStatusPendingAcceptance ShareStatus = "PendingAcceptance"
	ShareStatusRejected          ShareStatus = "Rejected"
	ShareStatusRejecting         ShareStatus = "Rejecting"
	ShareStatusRejectFailed      ShareStatus = "RejectFailed"
	ShareStatusSharing           ShareStatus = "Sharing"
	ShareStatusShareFailed       ShareStatus = "ShareFailed"
	ShareStatusDeleted           ShareStatus = "Deleted"
	ShareStatusDeleting          ShareStatus = "Deleting"
)

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,
		networkType NetworkType,
		vpcSettings *DirectoryVpcSettings,
		tags []Tag,
	) (*Directory, error)
	CreateMicrosoftAD(
		ctx context.Context,
		name, shortName, description, password string,
		edition DirectoryEdition,
		networkType NetworkType,
		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, vpcSettings *DirectoryVpcSettings) 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, dnsIPv6Addrs []string,
	) error
	UpdateConditionalForwarder(
		ctx context.Context, directoryID, remoteDomainName string, dnsIPAddrs, dnsIPv6Addrs []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, selectiveAuth 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, cfg *ADAssessmentConfiguration) (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,
		assessmentID, secretArn string,
		tags []Tag,
	) (*Directory, error)
	UpdateHybridAD(
		ctx context.Context,
		directoryID, adminAccountSecretArn string,
		selfManagedDNSIPs, selfManagedInstanceIDs []string,
	) (assessmentID string, err error)
	DescribeHybridADUpdate(
		ctx context.Context,
		directoryID, updateType string,
	) (hybridAdministratorAccount, selfManagedInstances []HybridADUpdateEntry, err 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,
		networkType NetworkType,
		connectSettings ConnectSettingsInput,
		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 TrustDirection added in v1.2.0

type TrustDirection string

TrustDirection matches the AWS TrustDirection enum.

const (
	TrustDirectionOneWayOutgoing TrustDirection = "One-Way: Outgoing"
	TrustDirectionOneWayIncoming TrustDirection = "One-Way: Incoming"
	TrustDirectionTwoWay         TrustDirection = "Two-Way"
)

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 TrustType added in v1.2.0

type TrustType string

TrustType matches the AWS TrustType enum.

const (
	TrustTypeForest   TrustType = "Forest"
	TrustTypeExternal TrustType = "External"
)

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.

type UpdateType added in v1.2.0

type UpdateType string

UpdateType matches the AWS UpdateType enum.

const (
	UpdateTypeOS      UpdateType = "OS"
	UpdateTypeNetwork UpdateType = "NETWORK"
	UpdateTypeSize    UpdateType = "SIZE"
)

Jump to

Keyboard shortcuts

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