efs

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 23 Imported by: 0

README

EFS

Parity grade: A · SDK aws-sdk-go-v2/service/efs@v1.48.0 · last audited 2026-08-30 (2516ed984b0172a43275ab37c70f0cac8f6bc807)

Coverage

Metric Value
PARITY entries audited 31 (31 ok)
Feature families 9 (9 ok)
Known gaps 4
Deferred items 2
Resource leaks clean
Known gaps
  • FIXED (gopherstack-jkma triage, 2026-09-07): errtargetaudit's module-conditional genericProtocolCodes (gopherstack-udkm) surfaced 8 ops emitting ValidationException that efs@v1.44.4 declares nowhere in the module (only CreateReplicationConfiguration/ DescribeBackupPolicy/DescribeReplicationConfigurations/PutBackupPolicy declare it, and none of the 8 are among them). All 8 -- CreateAccessPoint, PutAccountPreferences, UpdateFileSystem, PutLifecycleConfiguration, CreateMountTarget, UpdateFileSystemProtection, TagResource, CreateTags -- instead declare the generic BadRequest ("Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter"), matching this file's own PutFileSystemPolicy precedent (fix #4 below: InvalidPolicyException over ValidationException). Added ErrBadRequest and swapped every backend-level ErrValidation raise reachable from these 8 ops (access_points.go, account_preferences.go, file_systems.go's applyThroughputModeChange/UpdateFileSystem, lifecycle_config.go's validateLifecyclePolicies, mount_targets.go, replication.go, tags.go's shared validateTags). validateTags is also reachable from CreateFileSystem (which already declares BadRequest), so CreateFileSystem's tag validation incidentally gained the same fix as a side effect of fixing the shared helper -- not separately investigated beyond confirming BadRequest is correct for it too. The wire-layer BadRequest checks already in handler_*.go (required-field checks done before the backend call) were untouched, only the backend-level ones were wrong.
  • DeleteFileSystem rejects (FileSystemInUse) while access points exist for the file system. efs@v1.44.4 types/errors.go's FileSystemInUse doc is scoped strictly to mount targets ("Returned if a file system has mount targets"), and api_op_DeleteFileSystem.go's own doc lists only mount targets and an active replication configuration as blockers -- access points are never mentioned. This may be an over-restriction, but the behavior is tested (TestDeleteFileSystem_RequiresEmptyState) and a prior audit (2026-09-04) left it rather than remove tested behavior on weak evidence. Not changed this pass either (gopherstack-g8sg): confirming/removing it is a real-AWS-behavior judgment call outside what the SDK doc text alone can settle, left for deliberate review.
  • gopherstack-ne9h (2026-09-11, fixed): FileSystemLimitExceeded / AccessPointLimitExceeded (account-level Service Quota 403s) are now enforced. services/efs/limits.go adds the same named-constant + WithResourceLimits quota-config model services/ses/limits.go and services/glue/limits.go use: CreateFileSystem and CreateReplicationConfiguration (the latter implicitly creates a destination file system) enforce a 1,000-per-account/region file-system cap (FileSystemLimitExceeded), and CreateAccessPoint enforces a 10,000-per-file-system access-point cap (AccessPointLimitExceeded) -- both values from https://docs.aws.amazon.com/efs/latest/ug/limits.html's "Amazon EFS quotas that you can increase" table (WebFetch'd 2026-09-11). Both exceptions carry httpStatusCode 403 per aws-sdk-go@v1.55.8/models/apis/elasticfilesystem/2015-02-01/api-2.json's shapes entries (unlike SecurityGroupLimitExceeded's 400), confirmed by a real-SDK-client round-trip test (limits_realclient_test.go) that both typed exceptions decode correctly through aws-sdk-go-v2/service/efs's REST-JSON deserializer. Deliberately left unenforced, same pass: ThroughputLimitExceeded (CreateFileSystem/CreateReplicationConfiguration/ UpdateFileSystem) overlaps the ProvisionedThroughputInMibps 1-1024 structural bound already enforced as BadRequest, and the currently published per-file-system throughput quota is region-dependent (3-10 GiBps) rather than the flat 1024 MiB/s the SDK doc string still cites -- picking either number to also raise a second, distinct exception would be guessing, not citing. NetworkInterfaceLimitExceeded/NoFreeAddressesInSubnet/IpAddressInUse (CreateMountTarget) depend on real subnet CIDR occupancy and account-wide ENI counts, which are EC2/VPC quotas efs's own limits page never publishes a number for -- gopherstack has no subnet-IP-occupancy model to check them against without fabricating a threshold. Also confirmed not a gap: the mount-targets-per-VPC hard cap of 1,400 (same "cannot change" table as the already-enforced 1-per-AZ/5-security-groups rules) has no distinct SDK exception of its own (would still be MountTargetConflict) and would need new cross-file-system-per-VPC indexing this pass didn't build; a candidate follow-up, not fabricated here. See limits.go's doc comment for the full per-op citations.
  • DescribeTags (the legacy GET-only op, distinct from the resource-tags family) does not apply Marker/MaxItems pagination server-side -- always returns the full tag set in one page. Low priority: EFS caps tags per resource at 50 (maxTagsPerResource), so a single page is always sufficient in practice; a real client would never actually see a second page from real AWS either at that low a cap.
Deferred
  • DescribeTags pagination (Marker/MaxItems) -- see gaps; capped at 50 tags/resource so unreachable in practice.
  • ThroughputLimitExceeded / NetworkInterfaceLimitExceeded / NoFreeAddressesInSubnet / IpAddressInUse / mount-targets-per-VPC (1,400) -- see gaps entry dated 2026-09-11 for why each is left unenforced now that FileSystemLimitExceeded/AccessPointLimitExceeded are done.

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a requested resource does not exist.
	ErrNotFound = awserr.New("FileSystemNotFound", awserr.ErrNotFound)
	// ErrAlreadyExists is returned when a resource with the same token already exists but args differ.
	ErrAlreadyExists = awserr.New("FileSystemAlreadyExists", awserr.ErrConflict)
	// ErrCreationTokenExists is returned when the same creation token with identical args is reused.
	ErrCreationTokenExists = awserr.New("FileSystemAlreadyExists", errTokenIdentical)
	// ErrReplicationConfigExists is returned by CreateReplicationConfiguration when a
	// replication configuration already exists for the source file system.
	// CreateReplicationConfiguration's own deserializeOpError (efs@v1.44.4
	// deserializers.go) has no FileSystemAlreadyExists case -- unlike CreateFileSystem,
	// it has ConflictException instead.
	ErrReplicationConfigExists = awserr.New("ConflictException", awserr.ErrConflict)
	// ErrMountTargetNotFound is returned when a requested mount target does not exist.
	ErrMountTargetNotFound = awserr.New("MountTargetNotFound", awserr.ErrNotFound)
	// ErrAccessPointNotFound is returned when a requested access point does not exist.
	ErrAccessPointNotFound = awserr.New("AccessPointNotFound", awserr.ErrNotFound)
	// ErrPolicyNotFound is returned when no resource policy is configured for a file system.
	ErrPolicyNotFound = awserr.New("PolicyNotFound", awserr.ErrNotFound)
	// ErrInvalidPolicy is returned when a file system policy document is malformed or too large.
	ErrInvalidPolicy = awserr.New("InvalidPolicyException", awserr.ErrInvalidParameter)
	// ErrValidation is returned when input validation fails.
	ErrValidation = awserr.New("ValidationException", awserr.ErrInvalidParameter)
	// ErrBadRequest is returned for malformed input on ops whose declared error model has
	// BadRequest instead of ValidationException -- efs@v1.44.4 declares ValidationException
	// on only 4 of its 31 ops (CreateReplicationConfiguration, DescribeBackupPolicy,
	// DescribeReplicationConfigurations, PutBackupPolicy); every other op's generic bad-input
	// code is BadRequest ("Returned if the request is malformed or contains an error such as
	// an invalid parameter value or a missing required parameter" -- types/errors.go).
	ErrBadRequest = awserr.New("BadRequest", awserr.ErrInvalidParameter)
	// ErrFileSystemInUse is returned when attempting to delete a file system that has mount targets.
	ErrFileSystemInUse = awserr.New("FileSystemInUse", awserr.ErrConflict)
	// ErrMountTargetConflict is returned when a duplicate mount target is created in the same
	// subnet, or (with an EC2Resolver wired, see crossservice.go) when the requested subnet
	// violates the "one VPC, one mount target per Availability Zone" rule (efs@v1.44.4
	// types/errors.go: "Returned if the mount target would violate one of the specified
	// restrictions based on the file system's existing mount targets").
	ErrMountTargetConflict = awserr.New("MountTargetConflict", awserr.ErrConflict)
	// ErrSubnetNotFound is returned by CreateMountTarget, with an EC2Resolver wired, when
	// SubnetId does not exist (efs@v1.44.4 types/errors.go: "Returned if there is no subnet
	// with ID SubnetId provided in the request").
	ErrSubnetNotFound = awserr.New("SubnetNotFound", awserr.ErrNotFound)
	// ErrIncorrectFileSystemLifeCycleState is returned when an operation requires the
	// file system to be in the "available" lifecycle state (botocore efs/service-2.json:
	// "Returned if the file system's lifecycle state is not \"available\"").
	ErrIncorrectFileSystemLifeCycleState = awserr.New("IncorrectFileSystemLifeCycleState", awserr.ErrConflict)
	// ErrSecurityGroupLimitExceeded is returned when too many security groups are specified.
	ErrSecurityGroupLimitExceeded = awserr.New("SecurityGroupLimitExceeded", awserr.ErrConflict)
	// ErrTooManyRequests is returned when a throughput change cooldown is violated.
	ErrTooManyRequests = awserr.New("TooManyRequests", errThrottled)
	// ErrFileSystemLimitExceeded is returned when an account has reached its file
	// system quota (efs@v1.48.0 types/errors.go: "Returned if the Amazon Web
	// Services account has already created the maximum number of file systems
	// allowed per account").
	ErrFileSystemLimitExceeded = awserr.New("FileSystemLimitExceeded", awserr.ErrConflict)
	// ErrAccessPointLimitExceeded is returned when a file system has reached its
	// access point quota (efs@v1.48.0 types/errors.go: "Returned if the Amazon Web
	// Services account has already created the maximum number of access points
	// allowed per file system").
	ErrAccessPointLimitExceeded = awserr.New("AccessPointLimitExceeded", awserr.ErrConflict)
)
View Source
var ErrNilAppContext = errors.New("appContext must not be nil")

ErrNilAppContext is returned when Init is called with a nil application context.

Functions

This section is empty.

Types

type AccessPoint

type AccessPoint struct {
	AccessPointID  string         `json:"accessPointId"`
	AccessPointArn string         `json:"accessPointArn"`
	FileSystemID   string         `json:"fileSystemId"`
	ClientToken    string         `json:"clientToken,omitempty"`
	Name           string         `json:"name,omitempty"`
	LifeCycleState string         `json:"lifeCycleState"`
	Tags           *tags.Tags     `json:"tags,omitempty"`
	PosixUser      *PosixUser     `json:"posixUser,omitempty"`
	RootDirectory  *RootDirectory `json:"rootDirectory,omitempty"`
	OwnerID        string         `json:"ownerId"`
	// contains filtered or unexported fields
}

AccessPoint represents an EFS access point.

The Tags field is backend-owned. Callers must treat the returned pointer as read-only; mutate tags only via TagResource.

type AccountPreferences

type AccountPreferences struct {
	ResourceIDType string `json:"ResourceIdType"`
}

AccountPreferences represents EFS account preferences.

type CreateAccessPointRequest

type CreateAccessPointRequest struct {
	Tags          map[string]string
	PosixUser     *PosixUser
	RootDirectory *RootDirectory
	FileSystemID  string
	ClientToken   string
}

CreateAccessPointRequest holds parameters for creating an EFS access point.

type CreateFileSystemRequest

type CreateFileSystemRequest struct {
	Tags                     map[string]string
	Backup                   *bool
	CreationToken            string
	PerformanceMode          string
	ThroughputMode           string
	KmsKeyID                 string
	AvailabilityZoneName     string
	ProvisionedThroughputMib float64
	Encrypted                bool
}

CreateFileSystemRequest holds parameters for creating an EFS file system.

type CreateMountTargetRequest

type CreateMountTargetRequest struct {
	FileSystemID   string
	SubnetID       string
	IPAddress      string
	IPAddressType  string
	IPv6Address    string
	SecurityGroups []string
}

CreateMountTargetRequest holds parameters for creating an EFS mount target.

type CreationInfo

type CreationInfo struct {
	Permissions string `json:"Permissions"`
	OwnerUID    int64  `json:"OwnerUid"`
	OwnerGID    int64  `json:"OwnerGid"`
}

CreationInfo specifies the POSIX IDs and permissions to apply to the access point's RootDirectory when it does not exist.

type EC2Resolver

type EC2Resolver interface {
	SubnetExists(id string) bool
	SubnetVPC(id string) string
	SubnetAZ(id string) string
}

EC2Resolver lets this backend validate CreateMountTarget's SubnetId against the real services/ec2 backend so it can enforce api_op_CreateMountTarget.go's documented placement rule: "you can create mount targets for a file system in only one VPC, and there can be only one mount target per Availability Zone" -- if the file system already has one or more mount targets, a new subnet "Must belong to the same VPC as the subnets of the existing mount targets" and "Must not be in the same Availability Zone as any of the subnets of the existing mount targets". Mirrors services/elb's EC2Resolver. Wired in by cli.go's wireComputeAndObservabilityIntegrations. A nil resolver (the default) accepts every subnet ID unvalidated -- e.g. isolated unit tests with no EC2 backend wired.

type FileSystem

type FileSystem struct {
	CreationTime                   time.Time  `json:"creationTime"`
	Tags                           *tags.Tags `json:"tags,omitempty"`
	LastThroughputChange           time.Time  `json:"lastThroughputChange,omitzero"`
	PerformanceMode                string     `json:"performanceMode"`
	FileSystemArn                  string     `json:"fileSystemArn"`
	CreationToken                  string     `json:"creationToken"`
	Name                           string     `json:"name,omitempty"`
	FileSystemID                   string     `json:"fileSystemId"`
	ThroughputMode                 string     `json:"throughputMode"`
	LifeCycleState                 string     `json:"lifeCycleState"`
	AccountID                      string     `json:"accountId"`
	Region                         string     `json:"region"`
	KmsKeyID                       string     `json:"kmsKeyId,omitempty"`
	AvailabilityZoneName           string     `json:"availabilityZoneName,omitempty"`
	AvailabilityZoneID             string     `json:"availabilityZoneId,omitempty"`
	ReplicationOverwriteProtection string     `json:"replicationOverwriteProtection,omitempty"`
	ProvisionedThroughputMib       float64    `json:"provisionedThroughputMib,omitempty"`
	NumberOfMountTargets           int32      `json:"numberOfMountTargets"`
	Encrypted                      bool       `json:"encrypted"`
}

FileSystem represents an EFS file system.

The Tags field is backend-owned. Callers must treat the returned pointer as read-only; mutate tags only via TagResource / CreateFileSystem.

type Handler

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

Handler is the Echo HTTP handler for AWS EFS operations (REST-JSON protocol).

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a new EFS handler.

func (*Handler) ChaosOperations

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

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

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

ChaosRegions returns all regions this EFS instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

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

ExtractOperation extracts the EFS operation name from the REST path.

func (*Handler) ExtractResource

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

ExtractResource extracts the primary resource identifier from the URL path.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations returns the list of supported EFS operations.

func (*Handler) Handler

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

Handler returns the Echo handler function for EFS requests.

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 clears all backend state.

func (*Handler) Restore

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

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

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

RouteMatcher returns a function that matches AWS EFS REST requests.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable by delegating to the backend.

type InMemoryBackend

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

InMemoryBackend is the in-memory store for EFS resources.

The four resource collections below (fileSystems, mountTargets, accessPoints, replicationConfigs) were previously nested by region (outer key = region) so that same-named resources in different regions were fully isolated. Phase 3.3 flattens each into a single *store.Table[T] keyed by the composite "region|id" string (see regionKey in store_setup.go), with a companion *store.Index grouping entries by region for the old per-region scans, and -- for fileSystemsByARN/mountTargetsByARN/accessPointsByARN/ accessPointsByClientToken -- an unregistered derived-cache *store.Table (same pattern as services/ecs's taskDefByArn) providing O(1) region-scoped lookup by the resource's own ARN/ClientToken. accountPreferences is account-level state in AWS and so is not region-nested.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new in-memory EFS backend.

func (*InMemoryBackend) AddAccessPointInternal

func (b *InMemoryBackend) AddAccessPointInternal(ap *AccessPoint)

AddAccessPointInternal inserts a pre-built AccessPoint directly into the backend (test seed helper).

func (*InMemoryBackend) AddFileSystemInternal

func (b *InMemoryBackend) AddFileSystemInternal(fs *FileSystem)

AddFileSystemInternal inserts a pre-built FileSystem directly into the backend (test seed helper).

func (*InMemoryBackend) AddMountTargetInternal

func (b *InMemoryBackend) AddMountTargetInternal(mt *MountTarget)

AddMountTargetInternal inserts a pre-built MountTarget directly into the backend (test seed helper).

func (*InMemoryBackend) CreateAccessPoint

func (b *InMemoryBackend) CreateAccessPoint(
	ctx context.Context,
	req CreateAccessPointRequest,
) (*AccessPoint, error)

CreateAccessPoint creates an access point for a file system. Supports ClientToken idempotency.

func (*InMemoryBackend) CreateFileSystem

func (b *InMemoryBackend) CreateFileSystem(
	ctx context.Context,
	req CreateFileSystemRequest,
) (*FileSystem, error)

CreateFileSystem creates a new EFS file system.

func (*InMemoryBackend) CreateMountTarget

func (b *InMemoryBackend) CreateMountTarget(
	ctx context.Context,
	req CreateMountTargetRequest,
) (*MountTarget, error)

CreateMountTarget creates a mount target for a file system. Returns ErrMountTargetConflict if a mount target already exists in the same subnet.

func (*InMemoryBackend) CreateReplicationConfiguration

func (b *InMemoryBackend) CreateReplicationConfiguration(
	ctx context.Context,
	sourceFileSystemID string,
	destinations []ReplicationDestination,
) (*ReplicationConfiguration, error)

CreateReplicationConfiguration creates a replication configuration for a file system.

func (*InMemoryBackend) CreateTags

func (b *InMemoryBackend) CreateTags(ctx context.Context, fileSystemID string, kv map[string]string) error

CreateTags adds tags to a file system (legacy operation, delegates to TagResource).

func (*InMemoryBackend) DeleteAccessPoint

func (b *InMemoryBackend) DeleteAccessPoint(ctx context.Context, accessPointID string) error

DeleteAccessPoint deletes an access point by ID.

func (*InMemoryBackend) DeleteFileSystem

func (b *InMemoryBackend) DeleteFileSystem(ctx context.Context, fileSystemID string) error

DeleteFileSystem deletes a file system by ID. Returns ErrFileSystemInUse if mount targets, access points, or a replication configuration exist for it.

func (*InMemoryBackend) DeleteFileSystemPolicy

func (b *InMemoryBackend) DeleteFileSystemPolicy(ctx context.Context, fileSystemID string) error

DeleteFileSystemPolicy removes the resource-based policy from a file system.

func (*InMemoryBackend) DeleteMountTarget

func (b *InMemoryBackend) DeleteMountTarget(ctx context.Context, mountTargetID string) error

DeleteMountTarget deletes a mount target by ID.

func (*InMemoryBackend) DeleteReplicationConfiguration

func (b *InMemoryBackend) DeleteReplicationConfiguration(
	ctx context.Context,
	sourceFileSystemID string,
) error

DeleteReplicationConfiguration deletes the replication configuration for a file system. The destination file system (if tracked) becomes a standalone writable file system with ReplicationOverwriteProtection set to ENABLED.

func (*InMemoryBackend) DeleteTags

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

DeleteTags removes tags from a file system by key (legacy operation).

func (*InMemoryBackend) DescribeAccessPoints

func (b *InMemoryBackend) DescribeAccessPoints(
	ctx context.Context,
	fileSystemID, accessPointID, marker string, maxItems int,
) ([]*AccessPoint, string, error)

DescribeAccessPoints returns access points, optionally filtered by file system ID or access point ID.

func (*InMemoryBackend) DescribeAccountPreferences

func (b *InMemoryBackend) DescribeAccountPreferences() AccountPreferences

DescribeAccountPreferences returns the current account preferences.

func (*InMemoryBackend) DescribeBackupPolicy

func (b *InMemoryBackend) DescribeBackupPolicy(ctx context.Context, fileSystemID string) (string, error)

DescribeBackupPolicy returns the backup policy for a file system.

func (*InMemoryBackend) DescribeFileSystemPolicy

func (b *InMemoryBackend) DescribeFileSystemPolicy(ctx context.Context, fileSystemID string) (string, error)

DescribeFileSystemPolicy returns the resource-based policy for a file system.

func (*InMemoryBackend) DescribeFileSystems

func (b *InMemoryBackend) DescribeFileSystems(
	ctx context.Context,
	fileSystemID, creationToken, marker string,
	maxItems int,
) ([]*FileSystem, string, error)

DescribeFileSystems returns file systems, optionally filtered by ID or creation token, with pagination support.

func (*InMemoryBackend) DescribeLifecycleConfiguration

func (b *InMemoryBackend) DescribeLifecycleConfiguration(
	ctx context.Context,
	fileSystemID string,
) ([]LifecyclePolicy, error)

DescribeLifecycleConfiguration returns lifecycle policies for a file system.

func (*InMemoryBackend) DescribeMountTargetSecurityGroups

func (b *InMemoryBackend) DescribeMountTargetSecurityGroups(
	ctx context.Context,
	mountTargetID string,
) ([]string, error)

DescribeMountTargetSecurityGroups returns the security groups for a mount target.

func (*InMemoryBackend) DescribeMountTargets

func (b *InMemoryBackend) DescribeMountTargets(
	ctx context.Context,
	fileSystemID, mountTargetID, marker string, maxItems int,
) ([]*MountTarget, string, error)

DescribeMountTargets returns mount targets, optionally filtered by file system ID or mount target ID.

func (*InMemoryBackend) DescribeReplicationConfigurations

func (b *InMemoryBackend) DescribeReplicationConfigurations(
	ctx context.Context,
	fileSystemID, marker string,
	maxItems int,
) ([]*ReplicationConfiguration, string, error)

DescribeReplicationConfigurations returns replication configurations, optionally filtered by file system ID. marker/maxItems apply cursor-based pagination (wire names NextToken/MaxResults) over the unfiltered list, matching the pagination convention used by DescribeFileSystems/DescribeMountTargets/ DescribeAccessPoints (see paginate in store.go). A single-ID match (whether by source or destination file system) is never paginated, same as the describeByIDOrFilter convention those ops use.

func (*InMemoryBackend) ListTagsForResource

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

ListTagsForResource lists tags for a resource by ID or ARN.

func (*InMemoryBackend) ModifyMountTargetSecurityGroups

func (b *InMemoryBackend) ModifyMountTargetSecurityGroups(
	ctx context.Context,
	mountTargetID string,
	securityGroups []string,
) error

ModifyMountTargetSecurityGroups replaces the security groups for a mount target. Enforces a maximum of 5 security groups.

func (*InMemoryBackend) PutAccountPreferences

func (b *InMemoryBackend) PutAccountPreferences(resourceIDType string) (AccountPreferences, error)

PutAccountPreferences sets the account-level resource ID preference.

func (*InMemoryBackend) PutBackupPolicy

func (b *InMemoryBackend) PutBackupPolicy(ctx context.Context, fileSystemID, status string) error

PutBackupPolicy sets the backup policy status for a file system. Valid values: ENABLED, ENABLING, DISABLED, DISABLING.

func (*InMemoryBackend) PutFileSystemPolicy

func (b *InMemoryBackend) PutFileSystemPolicy(ctx context.Context, fileSystemID, policy string) error

PutFileSystemPolicy sets the resource-based policy for a file system. The policy must be valid JSON and no larger than 20 KB.

func (*InMemoryBackend) PutLifecycleConfiguration

func (b *InMemoryBackend) PutLifecycleConfiguration(
	ctx context.Context,
	fileSystemID string,
	policies []LifecyclePolicy,
) ([]LifecyclePolicy, error)

PutLifecycleConfiguration sets lifecycle policies for a file system.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the AWS region this backend is configured for.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all stored resources, returning the backend to its empty initial state. A resource-limit override set via WithResourceLimits is preserved.

func (*InMemoryBackend) Restore

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

Restore loads backend state from a JSON snapshot produced by Snapshot.

func (*InMemoryBackend) SetEC2Resolver

func (b *InMemoryBackend) SetEC2Resolver(r EC2Resolver)

SetEC2Resolver wires the backend to validate CreateMountTarget subnets against the real services/ec2 backend -- see EC2Resolver's doc comment. Called from cli.go's wireComputeAndObservabilityIntegrations.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(ctx context.Context, resourceID string, kv map[string]string) error

TagResource adds or updates tags on a resource (file system or access point) by ARN or ID.

func (*InMemoryBackend) TaggedResources added in v1.2.0

func (b *InMemoryBackend) TaggedResources() []TaggedEntry

TaggedResources returns every EFS resource ARN that currently has at least one tag, across every taggable EFS resource kind (file systems, access points).

func (*InMemoryBackend) UntagResource

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

UntagResource removes tags from a resource (file system or access point) by ARN or ID.

func (*InMemoryBackend) UpdateFileSystem

func (b *InMemoryBackend) UpdateFileSystem(
	ctx context.Context,
	fileSystemID string,
	req UpdateFileSystemRequest,
) (*FileSystem, error)

UpdateFileSystem updates throughput settings for a file system. Enforces a 24-hour cooldown between throughput mode changes.

func (*InMemoryBackend) UpdateFileSystemProtection

func (b *InMemoryBackend) UpdateFileSystemProtection(
	ctx context.Context,
	fileSystemID, replicationOverwriteProtection string,
) error

UpdateFileSystemProtection sets the replication overwrite protection for a file system.

func (*InMemoryBackend) WithResourceLimits

func (b *InMemoryBackend) WithResourceLimits(l ResourceLimits) *InMemoryBackend

WithResourceLimits overrides the resource caps enforced by FileSystemLimitExceeded/AccessPointLimitExceeded (see limits.go) and returns the backend for chaining. A zero field in l keeps its real-EFS default. The override survives Reset(), matching services/ses's WithEmailTTL/configuredEmailTTL precedent.

type LifecyclePolicy

type LifecyclePolicy struct {
	TransitionToIA                  string `json:"TransitionToIA,omitempty"`
	TransitionToPrimaryStorageClass string `json:"TransitionToPrimaryStorageClass,omitempty"`
	TransitionToArchive             string `json:"TransitionToArchive,omitempty"`
}

LifecyclePolicy represents an EFS lifecycle management policy.

type MountTarget

type MountTarget struct {
	MountTargetID        string   `json:"mountTargetId"`
	MountTargetArn       string   `json:"mountTargetArn"`
	FileSystemID         string   `json:"fileSystemId"`
	SubnetID             string   `json:"subnetId"`
	VpcID                string   `json:"vpcId"`
	AvailabilityZoneName string   `json:"availabilityZoneName"`
	AvailabilityZoneID   string   `json:"availabilityZoneId"`
	NetworkInterfaceID   string   `json:"networkInterfaceId"`
	IPAddress            string   `json:"ipAddress"`
	IPAddressType        string   `json:"ipAddressType,omitempty"`
	IPv6Address          string   `json:"ipv6Address,omitempty"`
	LifeCycleState       string   `json:"lifeCycleState"`
	OwnerID              string   `json:"ownerId"`
	SecurityGroups       []string `json:"securityGroups,omitempty"`
	// contains filtered or unexported fields
}

MountTarget represents an EFS mount target.

type PosixUser

type PosixUser struct {
	SecondaryGids []int64 `json:"SecondaryGids,omitempty"`
	UID           int64   `json:"Uid"`
	GID           int64   `json:"Gid"`
}

PosixUser represents the POSIX identity used for all file system operations by NFS clients using the access point.

type Provider

type Provider struct{}

Provider implements service.Provider for AWS EFS.

func (*Provider) Init

Init initializes the EFS service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type ReplicationConfiguration

type ReplicationConfiguration struct {
	OriginalSourceFileSystemARN string                   `json:"OriginalSourceFileSystemArn"`
	SourceFileSystemARN         string                   `json:"SourceFileSystemArn"`
	SourceFileSystemID          string                   `json:"SourceFileSystemId"`
	SourceFileSystemRegion      string                   `json:"SourceFileSystemRegion"`
	SourceFileSystemOwnerID     string                   `json:"SourceFileSystemOwnerId"`
	Destinations                []ReplicationDestination `json:"Destinations"`
	CreationTime                int64                    `json:"CreationTime"`
}

ReplicationConfiguration represents an EFS replication configuration.

type ReplicationDestination

type ReplicationDestination struct {
	FileSystemID            string `json:"FileSystemId,omitempty"`
	FileSystemArn           string `json:"FileSystemArn,omitempty"`
	Region                  string `json:"Region,omitempty"`
	AvailabilityZoneName    string `json:"AvailabilityZoneName,omitempty"`
	KmsKeyID                string `json:"KmsKeyId,omitempty"`
	OwnerID                 string `json:"OwnerId,omitempty"`
	Status                  string `json:"Status,omitempty"`
	StatusMessage           string `json:"StatusMessage,omitempty"`
	RoleArn                 string `json:"RoleArn,omitempty"`
	LastReplicatedTimestamp int64  `json:"LastReplicatedTimestamp,omitempty"`
}

ReplicationDestination represents a destination in an EFS replication configuration.

LastReplicatedTimestamp is wire-encoded as epoch-seconds (matching the real SDK's types.Destination.LastReplicatedTimestamp *time.Time, which serializes as a JSON number under the restjson1 protocol), stored here as an int64 unix timestamp so a zero value naturally omits via omitempty -- mirroring the ReplicationConfiguration.CreationTime convention below.

This struct is reused for both directions: unmarshaling the request body (shaped like the real SDK's request-side types.DestinationToCreate, which has FileSystemId/Region/AvailabilityZoneName/KmsKeyId/RoleArn) and internal storage. FileSystemArn/AvailabilityZoneName/KmsKeyID are request-only / internal-bookkeeping fields -- the real response-side types.Destination has none of the three (deserializers.go's awsRestjson1_deserializeDocumentDestination declares no case for any of them). The response wire is built explicitly by destinationToResponse in handler_replication.go rather than by marshaling this struct directly, so json tags here only need to be correct for request unmarshaling.

type ResourceLimits

type ResourceLimits struct {
	FileSystemsPerAccount  int
	AccessPointsPerFileSys int
}

ResourceLimits overrides the resource caps a *InMemoryBackend enforces with FileSystemLimitExceeded/AccessPointLimitExceeded. A zero field keeps its real-EFS default (see WithResourceLimits in store.go) -- used by tests that need to trip a 1,000/10,000-sized cap without actually creating that many resources.

type RootDirectory

type RootDirectory struct {
	CreationInfo *CreationInfo `json:"CreationInfo,omitempty"`
	Path         string        `json:"Path,omitempty"`
}

RootDirectory specifies the directory on the Amazon EFS file system that the access point provides access to.

type TaggedEntry added in v1.2.0

type TaggedEntry struct {
	Tags map[string]string
	ARN  string
}

TaggedEntry pairs a resource ARN with its tag map, for cross-service tag enumeration by the Resource Groups Tagging API (see cli.go's wireTaggingEFS).

type UpdateFileSystemRequest

type UpdateFileSystemRequest struct {
	ThroughputMode           string  `json:"ThroughputMode,omitempty"`
	ProvisionedThroughputMib float64 `json:"ProvisionedThroughputInMibps,omitempty"`
}

UpdateFileSystemRequest holds parameters for updating an EFS file system.

Jump to

Keyboard shortcuts

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