agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

13
cdk/node_modules/aws-cdk-lib/aws-efs/.jsiirc.json generated vendored Normal file
View File

@@ -0,0 +1,13 @@
{
"targets": {
"java": {
"package": "software.amazon.awscdk.services.efs"
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.EFS"
},
"python": {
"module": "aws_cdk.aws_efs"
}
}
}

301
cdk/node_modules/aws-cdk-lib/aws-efs/README.md generated vendored Normal file
View File

@@ -0,0 +1,301 @@
# Amazon Elastic File System Construct Library
[Amazon Elastic File System](https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html) (Amazon EFS) provides a simple, scalable,
fully managed elastic NFS file system for use with AWS Cloud services and on-premises resources.
Amazon EFS provides file storage in the AWS Cloud. With Amazon EFS, you can create a file system,
mount the file system on an Amazon EC2 instance, and then read and write data to and from your file system.
This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
## File Systems
Amazon EFS provides elastic, shared file storage that is POSIX-compliant. The file system you create
supports concurrent read and write access from multiple Amazon EC2 instances and is accessible from
all of the Availability Zones in the AWS Region where it is created. Learn more about [EFS file systems](https://docs.aws.amazon.com/efs/latest/ug/creating-using.html)
### Create an Amazon EFS file system
A Virtual Private Cloud (VPC) is required to create an Amazon EFS file system.
The following example creates a file system that is encrypted at rest, running in `General Purpose`
performance mode, and `Bursting` throughput mode and does not transition files to the Infrequent
Access (IA) storage class.
```ts
const fileSystem = new efs.FileSystem(this, 'MyEfsFileSystem', {
vpc: new ec2.Vpc(this, 'VPC'),
lifecyclePolicy: efs.LifecyclePolicy.AFTER_14_DAYS, // files are not transitioned to infrequent access (IA) storage by default
performanceMode: efs.PerformanceMode.GENERAL_PURPOSE, // default
outOfInfrequentAccessPolicy: efs.OutOfInfrequentAccessPolicy.AFTER_1_ACCESS, // files are not transitioned back from (infrequent access) IA to primary storage by default
transitionToArchivePolicy: efs.LifecyclePolicy.AFTER_14_DAYS, // files are not transitioned to Archive by default
replicationOverwriteProtection: efs.ReplicationOverwriteProtection.ENABLED, // Set to `DISABLED` if you want to create a read-only file system for use as a replication destination
});
```
⚠️ An Amazon EFS file system's performance mode can't be MAX_IO when its throughputMode is ELASTIC.
⚠️ An Amazon EFS file system's performance mode can't be changed after the file system has been created.
Updating this property will replace the file system.
Any file system that has been created outside the stack can be imported into your CDK app.
Use the `fromFileSystemAttributes()` API to import an existing file system.
Here is an example of giving a role write permissions on a file system.
```ts
import * as iam from 'aws-cdk-lib/aws-iam';
const importedFileSystem = efs.FileSystem.fromFileSystemAttributes(this, 'existingFS', {
fileSystemId: 'fs-12345678', // You can also use fileSystemArn instead of fileSystemId.
securityGroup: ec2.SecurityGroup.fromSecurityGroupId(this, 'SG', 'sg-123456789', {
allowAllOutbound: false,
}),
});
```
### One Zone file system
To initialize a One Zone file system use the `oneZone` property:
```ts
declare const vpc: ec2.Vpc;
new efs.FileSystem(this, 'OneZoneFileSystem', {
vpc,
oneZone: true,
})
```
⚠️ One Zone file systems are not compatible with the MAX_IO performance mode.
⚠️ When `oneZone` is enabled, the file system is automatically placed in the first availability zone of the VPC.
To specify a different availability zone:
```ts
declare const vpc: ec2.Vpc;
new efs.FileSystem(this, 'OneZoneFileSystem', {
vpc,
oneZone: true,
vpcSubnets: {
availabilityZones: ['us-east-1b'],
},
})
```
⚠️ When `oneZone` is enabled, mount targets will be created only in the specified availability zone.
This is to prevent deployment failures due to cross-AZ configurations.
⚠️ When `oneZone` is enabled, `vpcSubnets` can be specified with
`availabilityZones` that contains exactly one single zone.
### Replicating file systems
You can create a replica of your EFS file system in the AWS Region of your preference.
```ts
declare const vpc: ec2.Vpc;
// auto generate a regional replication destination file system
new efs.FileSystem(this, 'RegionalReplicationFileSystem', {
vpc,
replicationConfiguration: efs.ReplicationConfiguration.regionalFileSystem('us-west-2'),
});
// auto generate a one zone replication destination file system
new efs.FileSystem(this, 'OneZoneReplicationFileSystem', {
vpc,
replicationConfiguration: efs.ReplicationConfiguration.oneZoneFileSystem('us-east-1', 'us-east-1a'),
});
const destinationFileSystem = new efs.FileSystem(this, 'DestinationFileSystem', {
vpc,
// set as the read-only file system for use as a replication destination
replicationOverwriteProtection: efs.ReplicationOverwriteProtection.DISABLED,
});
// specify the replication destination file system
new efs.FileSystem(this, 'ReplicationFileSystem', {
vpc,
replicationConfiguration: efs.ReplicationConfiguration.existingFileSystem(destinationFileSystem),
});
```
**Note**: EFS now supports only one replication destination and thus allows specifying just one `replicationConfiguration` for each file system.
> Visit [Replicating file systems](https://docs.aws.amazon.com/efs/latest/ug/efs-replication.html) for more details.
### IAM to control file system data access
You can use both IAM identity policies and resource policies to control client access to Amazon EFS resources in a way that is scalable and optimized for cloud environments. Using IAM, you can permit clients to perform specific actions on a file system, including read-only, write, and root access.
```ts
import * as iam from 'aws-cdk-lib/aws-iam';
const myFileSystemPolicy = new iam.PolicyDocument({
statements: [new iam.PolicyStatement({
actions: [
'elasticfilesystem:ClientWrite',
'elasticfilesystem:ClientMount',
],
principals: [new iam.AccountRootPrincipal()],
resources: ['*'],
conditions: {
Bool: {
'elasticfilesystem:AccessedViaMountTarget': 'true',
},
},
})],
});
const fileSystem = new efs.FileSystem(this, 'MyEfsFileSystem', {
vpc: new ec2.Vpc(this, 'VPC'),
fileSystemPolicy: myFileSystemPolicy,
});
```
Alternatively, a resource policy can be added later using `addToResourcePolicy(statement)`. Note that this will not work with imported FileSystem.
```ts
import * as iam from 'aws-cdk-lib/aws-iam';
declare const statement: iam.PolicyStatement;
const fileSystem = new efs.FileSystem(this, 'MyEfsFileSystem', {
vpc: new ec2.Vpc(this, 'VPC'),
});
fileSystem.addToResourcePolicy(statement);
```
### Permissions
If you need to grant file system permissions to another resource, you can use the `.grant()` API.
As an example, the following code gives `elasticfilesystem:Backup` permissions to an IAM role.
```ts fixture=with-filesystem-instance
const role = new iam.Role(this, 'Role', {
assumedBy: new iam.AnyPrincipal(),
});
fileSystem.grant(role, 'elasticfilesystem:Backup');
```
APIs for clients also include `.grantRead()`, `.grantReadWrite()`, and `.grantRootAccess()`. Using these APIs grants access to clients.
Also, by default, the file system policy is updated to only allow access to clients using IAM authentication and deny access to anonymous clients.
```ts fixture=with-filesystem-instance
const role = new iam.Role(this, 'ClientRole', {
assumedBy: new iam.AnyPrincipal(),
});
fileSystem.grantRead(role);
```
You can control this behavior with `allowAnonymousAccess`. The following example continues to allow anonymous client access.
```ts
import * as iam from 'aws-cdk-lib/aws-iam';
const role = new iam.Role(this, 'ClientRole', {
assumedBy: new iam.AnyPrincipal(),
});
const fileSystem = new efs.FileSystem(this, 'MyEfsFileSystem', {
vpc: new ec2.Vpc(this, 'VPC'),
allowAnonymousAccess: true,
});
fileSystem.grantRead(role);
```
### Access Point
An access point is an application-specific view into an EFS file system that applies an operating
system user and group, and a file system path, to any file system request made through the access
point. The operating system user and group override any identity information provided by the NFS
client. The file system path is exposed as the access point's root directory. Applications using
the access point can only access data in its own directory and below. To learn more, see [Mounting a File System Using EFS Access Points](https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html).
Use the `addAccessPoint` API to create an access point from a fileSystem.
```ts fixture=with-filesystem-instance
fileSystem.addAccessPoint('MyAccessPoint', {
// create a unique access point via an optional client token
clientToken: 'client-token',
});
```
By default, when you create an access point, the root(`/`) directory is exposed to the client
connecting to the access point. You can specify a custom path with the `path` property.
If `path` does not exist, it will be created with the settings defined in the `creationInfo`.
See [Creating Access Points](https://docs.aws.amazon.com/efs/latest/ug/create-access-point.html) for more details.
Any access point that has been created outside the stack can be imported into your CDK app.
Use the `fromAccessPointAttributes()` API to import an existing access point.
```ts
efs.AccessPoint.fromAccessPointAttributes(this, 'ap', {
accessPointId: 'fsap-1293c4d9832fo0912',
fileSystem: efs.FileSystem.fromFileSystemAttributes(this, 'efs', {
fileSystemId: 'fs-099d3e2f',
securityGroup: ec2.SecurityGroup.fromSecurityGroupId(this, 'sg', 'sg-51530134'),
}),
});
```
⚠️ Notice: When importing an Access Point using `fromAccessPointAttributes()`, you must make sure
the mount targets are deployed and their lifecycle state is `available`. Otherwise, you may encounter
the following error when deploying:
> EFS file system <ARN of efs> referenced by access point <ARN of access point of EFS> has
> mount targets created in all availability zones the function will execute in, but not all
> are in the available life cycle state yet. Please wait for them to become available and
> try the request again.
### Connecting
To control who can access the EFS, use the `.connections` attribute. EFS has
a fixed default port, so you don't need to specify the port:
```ts fixture=with-filesystem-instance
fileSystem.connections.allowDefaultPortFrom(instance);
```
Learn more about [managing file system network accessibility](https://docs.aws.amazon.com/efs/latest/ug/manage-fs-access.html)
### Mounting the file system using User Data
After you create a file system, you can create mount targets. Then you can mount the file system on
EC2 instances, containers, and Lambda functions in your virtual private cloud (VPC).
The following example automatically mounts a file system during instance launch.
```ts fixture=with-filesystem-instance
fileSystem.connections.allowDefaultPortFrom(instance);
instance.userData.addCommands("yum check-update -y", // Ubuntu: apt-get -y update
"yum upgrade -y", // Ubuntu: apt-get -y upgrade
"yum install -y amazon-efs-utils", // Ubuntu: apt-get -y install amazon-efs-utils
"yum install -y nfs-utils", // Ubuntu: apt-get -y install nfs-common
"file_system_id_1=" + fileSystem.fileSystemId,
"efs_mount_point_1=/mnt/efs/fs1",
"mkdir -p \"${efs_mount_point_1}\"",
"test -f \"/sbin/mount.efs\" && echo \"${file_system_id_1}:/ ${efs_mount_point_1} efs defaults,_netdev\" >> /etc/fstab || " +
"echo \"${file_system_id_1}.efs." + Stack.of(this).region + ".amazonaws.com:/ ${efs_mount_point_1} nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0\" >> /etc/fstab",
"mount -a -t efs,nfs4 defaults");
```
Learn more about [mounting EFS file systems](https://docs.aws.amazon.com/efs/latest/ug/mounting-fs.html)
### Deleting
Since file systems are stateful resources, by default the file system will not be deleted when your
stack is deleted.
You can configure the file system to be destroyed on stack deletion by setting a `removalPolicy`
```ts
const fileSystem = new efs.FileSystem(this, 'EfsFileSystem', {
vpc: new ec2.Vpc(this, 'VPC'),
removalPolicy: RemovalPolicy.DESTROY,
});
```

1
cdk/node_modules/aws-cdk-lib/aws-efs/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export * from './lib';

1
cdk/node_modules/aws-cdk-lib/aws-efs/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});var _noFold;exports.AccessPoint=void 0,Object.defineProperty(exports,_noFold="AccessPoint",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").AccessPoint;return Object.defineProperty(exports,_noFold="AccessPoint",{enumerable:!0,configurable:!0,value}),value}}),exports.LifecyclePolicy=void 0,Object.defineProperty(exports,_noFold="LifecyclePolicy",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").LifecyclePolicy;return Object.defineProperty(exports,_noFold="LifecyclePolicy",{enumerable:!0,configurable:!0,value}),value}}),exports.OutOfInfrequentAccessPolicy=void 0,Object.defineProperty(exports,_noFold="OutOfInfrequentAccessPolicy",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").OutOfInfrequentAccessPolicy;return Object.defineProperty(exports,_noFold="OutOfInfrequentAccessPolicy",{enumerable:!0,configurable:!0,value}),value}}),exports.PerformanceMode=void 0,Object.defineProperty(exports,_noFold="PerformanceMode",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").PerformanceMode;return Object.defineProperty(exports,_noFold="PerformanceMode",{enumerable:!0,configurable:!0,value}),value}}),exports.ThroughputMode=void 0,Object.defineProperty(exports,_noFold="ThroughputMode",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").ThroughputMode;return Object.defineProperty(exports,_noFold="ThroughputMode",{enumerable:!0,configurable:!0,value}),value}}),exports.ReplicationOverwriteProtection=void 0,Object.defineProperty(exports,_noFold="ReplicationOverwriteProtection",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").ReplicationOverwriteProtection;return Object.defineProperty(exports,_noFold="ReplicationOverwriteProtection",{enumerable:!0,configurable:!0,value}),value}}),exports.ReplicationConfiguration=void 0,Object.defineProperty(exports,_noFold="ReplicationConfiguration",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").ReplicationConfiguration;return Object.defineProperty(exports,_noFold="ReplicationConfiguration",{enumerable:!0,configurable:!0,value}),value}}),exports.FileSystem=void 0,Object.defineProperty(exports,_noFold="FileSystem",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").FileSystem;return Object.defineProperty(exports,_noFold="FileSystem",{enumerable:!0,configurable:!0,value}),value}}),exports.CfnAccessPoint=void 0,Object.defineProperty(exports,_noFold="CfnAccessPoint",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").CfnAccessPoint;return Object.defineProperty(exports,_noFold="CfnAccessPoint",{enumerable:!0,configurable:!0,value}),value}}),exports.CfnFileSystem=void 0,Object.defineProperty(exports,_noFold="CfnFileSystem",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").CfnFileSystem;return Object.defineProperty(exports,_noFold="CfnFileSystem",{enumerable:!0,configurable:!0,value}),value}}),exports.CfnMountTarget=void 0,Object.defineProperty(exports,_noFold="CfnMountTarget",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").CfnMountTarget;return Object.defineProperty(exports,_noFold="CfnMountTarget",{enumerable:!0,configurable:!0,value}),value}});

View File

@@ -0,0 +1,185 @@
import type { Construct } from 'constructs';
import type { IFileSystem } from './efs-file-system';
import type { IResource } from '../../core';
import { Resource } from '../../core';
import type { AccessPointReference, IAccessPointRef, IFileSystemRef } from '../../interfaces/generated/aws-efs-interfaces.generated';
/**
* Represents an EFS AccessPoint
*/
export interface IAccessPoint extends IAccessPointRef, IResource {
/**
* The ID of the AccessPoint
*
* @attribute
*/
readonly accessPointId: string;
/**
* The ARN of the AccessPoint
*
* @attribute
*/
readonly accessPointArn: string;
/**
* The EFS file system
*/
readonly fileSystem: IFileSystem;
}
/**
* Permissions as POSIX ACL
*/
export interface Acl {
/**
* Specifies the POSIX user ID to apply to the RootDirectory. Accepts values from 0 to 2^32 (4294967295).
*/
readonly ownerUid: string;
/**
* Specifies the POSIX group ID to apply to the RootDirectory. Accepts values from 0 to 2^32 (4294967295).
*/
readonly ownerGid: string;
/**
* Specifies the POSIX permissions to apply to the RootDirectory, in the format of an octal number representing
* the file's mode bits.
*/
readonly permissions: string;
}
/**
* Represents the PosixUser
*/
export interface PosixUser {
/**
* The POSIX user ID used for all file system operations using this access point.
*/
readonly uid: string;
/**
* The POSIX group ID used for all file system operations using this access point.
*/
readonly gid: string;
/**
* Secondary POSIX group IDs used for all file system operations using this access point.
*
* @default - None
*/
readonly secondaryGids?: string[];
}
/**
* Options to create an AccessPoint
*/
export interface AccessPointOptions {
/**
* Specifies the POSIX IDs and permissions to apply when creating the access point's root directory. If the
* root directory specified by `path` does not exist, EFS creates the root directory and applies the
* permissions specified here. If the specified `path` does not exist, you must specify `createAcl`.
*
* @default - None. The directory specified by `path` must exist.
*/
readonly createAcl?: Acl;
/**
* Specifies the path on the EFS file system to expose as the root directory to NFS clients using the access point
* to access the EFS file system
*
* @default '/'
*/
readonly path?: string;
/**
* The full POSIX identity, including the user ID, group ID, and any secondary group IDs, on the access point
* that is used for all file system operations performed by NFS clients using the access point.
*
* Specify this to enforce a user identity using an access point.
*
* @see - [Enforcing a User Identity Using an Access Point](https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html)
*
* @default - user identity not enforced
*/
readonly posixUser?: PosixUser;
/**
* The opaque string specified in the request to ensure idempotent creation.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-accesspoint.html#cfn-efs-accesspoint-clienttoken
*
* @default - No client token
*/
readonly clientToken?: string;
}
/**
* Properties for the AccessPoint
*/
export interface AccessPointProps extends AccessPointOptions {
/**
* The efs filesystem
*/
readonly fileSystem: IFileSystemRef;
}
/**
* Attributes that can be specified when importing an AccessPoint
*/
export interface AccessPointAttributes {
/**
* The ID of the AccessPoint
* One of this, or `accessPointArn` is required
*
* @default - determined based on accessPointArn
*/
readonly accessPointId?: string;
/**
* The ARN of the AccessPoint
* One of this, or `accessPointId` is required
*
* @default - determined based on accessPointId
*/
readonly accessPointArn?: string;
/**
* The EFS file system
*
* @default - no EFS file system
*/
readonly fileSystem?: IFileSystemRef;
}
declare abstract class AccessPointBase extends Resource implements IAccessPoint {
/**
* The ARN of the Access Point
* @attribute
*/
abstract readonly accessPointArn: string;
/**
* The ID of the Access Point
* @attribute
*/
abstract readonly accessPointId: string;
/**
* The file system of the access point
*/
abstract readonly fileSystem: IFileSystem;
get accessPointRef(): AccessPointReference;
}
/**
* Represents the AccessPoint
*/
export declare class AccessPoint extends AccessPointBase {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
/**
* Import an existing Access Point by attributes
*/
static fromAccessPointAttributes(scope: Construct, id: string, attrs: AccessPointAttributes): IAccessPoint;
/**
* Import an existing Access Point by id
*/
static fromAccessPointId(scope: Construct, id: string, accessPointId: string): IAccessPoint;
/**
* The ARN of the Access Point
* @attribute
*/
readonly accessPointArn: string;
/**
* The ID of the Access Point
* @attribute
*/
readonly accessPointId: string;
private readonly _fileSystem;
/**
* The file system of the access point
*/
get fileSystem(): IFileSystem;
constructor(scope: Construct, id: string, props: AccessPointProps);
}
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,60 @@
export interface MetricWithDims<D> {
readonly namespace: string;
readonly metricName: string;
readonly statistic: string;
readonly dimensionsMap: D;
}
export declare class EFSMetrics {
static burstCreditBalanceAverage(this: void, dimensions: {
FileSystemId: string;
}): MetricWithDims<{
FileSystemId: string;
}>;
static clientConnectionsSum(this: void, dimensions: {
FileSystemId: string;
}): MetricWithDims<{
FileSystemId: string;
}>;
static dataReadIoBytesAverage(this: void, dimensions: {
FileSystemId: string;
}): MetricWithDims<{
FileSystemId: string;
}>;
static dataWriteIoBytesAverage(this: void, dimensions: {
FileSystemId: string;
}): MetricWithDims<{
FileSystemId: string;
}>;
static metadataIoBytesAverage(this: void, dimensions: {
FileSystemId: string;
}): MetricWithDims<{
FileSystemId: string;
}>;
static meteredIoBytesAverage(this: void, dimensions: {
FileSystemId: string;
}): MetricWithDims<{
FileSystemId: string;
}>;
static percentIoLimitAverage(this: void, dimensions: {
FileSystemId: string;
}): MetricWithDims<{
FileSystemId: string;
}>;
static permittedThroughputAverage(this: void, dimensions: {
FileSystemId: string;
}): MetricWithDims<{
FileSystemId: string;
}>;
static totalIoBytesSum(this: void, dimensions: {
FileSystemId: string;
}): MetricWithDims<{
FileSystemId: string;
}>;
static storageBytesAverage(this: void, dimensions: {
FileSystemId: string;
StorageClass: string;
}): MetricWithDims<{
FileSystemId: string;
StorageClass: string;
}>;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EFSMetrics=void 0;class EFSMetrics{static burstCreditBalanceAverage(dimensions){return{namespace:"AWS/EFS",metricName:"BurstCreditBalance",dimensionsMap:dimensions,statistic:"Average"}}static clientConnectionsSum(dimensions){return{namespace:"AWS/EFS",metricName:"ClientConnections",dimensionsMap:dimensions,statistic:"Sum"}}static dataReadIoBytesAverage(dimensions){return{namespace:"AWS/EFS",metricName:"DataReadIOBytes",dimensionsMap:dimensions,statistic:"Average"}}static dataWriteIoBytesAverage(dimensions){return{namespace:"AWS/EFS",metricName:"DataWriteIOBytes",dimensionsMap:dimensions,statistic:"Average"}}static metadataIoBytesAverage(dimensions){return{namespace:"AWS/EFS",metricName:"MetadataIOBytes",dimensionsMap:dimensions,statistic:"Average"}}static meteredIoBytesAverage(dimensions){return{namespace:"AWS/EFS",metricName:"MeteredIOBytes",dimensionsMap:dimensions,statistic:"Average"}}static percentIoLimitAverage(dimensions){return{namespace:"AWS/EFS",metricName:"PercentIOLimit",dimensionsMap:dimensions,statistic:"Average"}}static permittedThroughputAverage(dimensions){return{namespace:"AWS/EFS",metricName:"PermittedThroughput",dimensionsMap:dimensions,statistic:"Average"}}static totalIoBytesSum(dimensions){return{namespace:"AWS/EFS",metricName:"TotalIOBytes",dimensionsMap:dimensions,statistic:"Sum"}}static storageBytesAverage(dimensions){return{namespace:"AWS/EFS",metricName:"StorageBytes",dimensionsMap:dimensions,statistic:"Average"}}}exports.EFSMetrics=EFSMetrics;

View File

@@ -0,0 +1,574 @@
import type { Construct, IDependable } from 'constructs';
import type { AccessPointOptions } from './access-point';
import { AccessPoint } from './access-point';
import { CfnFileSystem } from './efs.generated';
import * as ec2 from '../../aws-ec2';
import * as iam from '../../aws-iam';
import type * as kms from '../../aws-kms';
import type { RemovalPolicy, Size } from '../../core';
import { Resource } from '../../core';
import type { FileSystemReference, IFileSystemRef } from '../../interfaces/generated/aws-efs-interfaces.generated';
/**
* EFS Lifecycle Policy, if a file is not accessed for given days, it will move to EFS Infrequent Access
* or Archive storage.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-filesystem.html#cfn-elasticfilesystem-filesystem-lifecyclepolicies
*/
export declare enum LifecyclePolicy {
/**
* After 1 day of not being accessed.
*/
AFTER_1_DAY = "AFTER_1_DAY",
/**
* After 7 days of not being accessed.
*/
AFTER_7_DAYS = "AFTER_7_DAYS",
/**
* After 14 days of not being accessed.
*/
AFTER_14_DAYS = "AFTER_14_DAYS",
/**
* After 30 days of not being accessed.
*/
AFTER_30_DAYS = "AFTER_30_DAYS",
/**
* After 60 days of not being accessed.
*/
AFTER_60_DAYS = "AFTER_60_DAYS",
/**
* After 90 days of not being accessed.
*/
AFTER_90_DAYS = "AFTER_90_DAYS",
/**
* After 180 days of not being accessed.
*/
AFTER_180_DAYS = "AFTER_180_DAYS",
/**
* After 270 days of not being accessed.
*/
AFTER_270_DAYS = "AFTER_270_DAYS",
/**
* After 365 days of not being accessed.
*/
AFTER_365_DAYS = "AFTER_365_DAYS"
}
/**
* EFS Out Of Infrequent Access Policy, if a file is accessed given times, it will move back to primary
* storage class.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-efs-filesystem-lifecyclepolicy.html#cfn-efs-filesystem-lifecyclepolicy-transitiontoprimarystorageclass
*/
export declare enum OutOfInfrequentAccessPolicy {
/**
* After 1 access
*/
AFTER_1_ACCESS = "AFTER_1_ACCESS"
}
/**
* EFS Performance mode.
*
* @see https://docs.aws.amazon.com/efs/latest/ug/performance.html#performancemodes
*/
export declare enum PerformanceMode {
/**
* General Purpose is ideal for latency-sensitive use cases, like web serving
* environments, content management systems, home directories, and general file serving.
* Recommended for the majority of Amazon EFS file systems.
*/
GENERAL_PURPOSE = "generalPurpose",
/**
* File systems in the Max I/O mode can scale to higher levels of aggregate
* throughput and operations per second. This scaling is done with a tradeoff
* of slightly higher latencies for file metadata operations.
* Highly parallelized applications and workloads, such as big data analysis,
* media processing, and genomics analysis, can benefit from this mode.
*/
MAX_IO = "maxIO"
}
/**
* EFS Throughput mode.
*
* @see https://docs.aws.amazon.com/efs/latest/ug/performance.html#throughput-modes
*/
export declare enum ThroughputMode {
/**
* This mode scales as the size of the file system in the standard storage class grows.
*/
BURSTING = "bursting",
/**
* This mode can instantly provision the throughput of the file system (in MiB/s) independent of the amount of data stored.
*/
PROVISIONED = "provisioned",
/**
* This mode scales the throughput automatically regardless of file system size.
*/
ELASTIC = "elastic"
}
/**
* The status of the file system's replication overwrite protection.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-efs-filesystem-filesystemprotection.html
*/
export declare enum ReplicationOverwriteProtection {
/**
* Enable the filesystem's replication overwrite protection.
*/
ENABLED = "ENABLED",
/**
* Disable the filesystem's replication overwrite protection.
*/
DISABLED = "DISABLED"
}
/**
* Represents an Amazon EFS file system
*/
export interface IFileSystem extends IFileSystemRef, ec2.IConnectable, iam.IResourceWithPolicy {
/**
* The ID of the file system, assigned by Amazon EFS.
*
* @attribute
*/
readonly fileSystemId: string;
/**
* The ARN of the file system.
*
* @attribute
*/
readonly fileSystemArn: string;
/**
* Dependable that can be depended upon to ensure the mount targets of the filesystem are ready
*/
readonly mountTargetsAvailable: IDependable;
/**
* Grant the actions defined in actions to the given grantee
* on this File System resource.
*/
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Grant read permissions for this file system to an IAM principal.
* @param grantee The principal to grant read to
*/
grantRead(grantee: iam.IGrantable): iam.Grant;
/**
* Grant read and write permissions for this file system to an IAM principal.
* @param grantee The principal to grant read and write to
*/
grantReadWrite(grantee: iam.IGrantable): iam.Grant;
/**
* As root user, grant read and write permissions for this file system to an IAM principal.
* @param grantee The principal to grant root access to
*/
grantRootAccess(grantee: iam.IGrantable): iam.Grant;
}
/**
* Properties of EFS FileSystem.
*/
export interface FileSystemProps {
/**
* VPC to launch the file system in.
*/
readonly vpc: ec2.IVpc;
/**
* Security Group to assign to this file system.
*
* @default - creates new security group which allows all outbound traffic
*/
readonly securityGroup?: ec2.ISecurityGroup;
/**
* Which subnets to place the mount target in the VPC.
*
* @default - the Vpc default strategy if not specified
*/
readonly vpcSubnets?: ec2.SubnetSelection;
/**
* Defines if the data at rest in the file system is encrypted or not.
*
* @default - If your application has the '@aws-cdk/aws-efs:defaultEncryptionAtRest' feature flag set, the default is true, otherwise, the default is false.
* @link https://docs.aws.amazon.com/cdk/latest/guide/featureflags.html
*/
readonly encrypted?: boolean;
/**
* The file system's name.
*
* @default - CDK generated name
*/
readonly fileSystemName?: string;
/**
* The KMS key used for encryption. This is required to encrypt the data at rest if @encrypted is set to true.
*
* @default - if 'encrypted' is true, the default key for EFS (/aws/elasticfilesystem) is used
*/
readonly kmsKey?: kms.IKeyRef;
/**
* A policy used by EFS lifecycle management to transition files to the Infrequent Access (IA) storage class.
*
* @default - None. EFS will not transition files to the IA storage class.
*/
readonly lifecyclePolicy?: LifecyclePolicy;
/**
* A policy used by EFS lifecycle management to transition files from Infrequent Access (IA) storage class to
* primary storage class.
*
* @default - None. EFS will not transition files from IA storage to primary storage.
*/
readonly outOfInfrequentAccessPolicy?: OutOfInfrequentAccessPolicy;
/**
* The number of days after files were last accessed in primary storage (the Standard storage class) at which to move them to Archive storage.
* Metadata operations such as listing the contents of a directory don't count as file access events.
*
* @default - None. EFS will not transition files to Archive storage class.
*/
readonly transitionToArchivePolicy?: LifecyclePolicy;
/**
* The performance mode that the file system will operate under.
* An Amazon EFS file system's performance mode can't be changed after the file system has been created.
* Updating this property will replace the file system.
*
* @default PerformanceMode.GENERAL_PURPOSE
*/
readonly performanceMode?: PerformanceMode;
/**
* Enum to mention the throughput mode of the file system.
*
* @default ThroughputMode.BURSTING
*/
readonly throughputMode?: ThroughputMode;
/**
* Provisioned throughput for the file system.
* This is a required property if the throughput mode is set to PROVISIONED.
* Must be at least 1MiB/s.
*
* @default - none, errors out
*/
readonly provisionedThroughputPerSecond?: Size;
/**
* The removal policy to apply to the file system.
*
* @default RemovalPolicy.RETAIN
*/
readonly removalPolicy?: RemovalPolicy;
/**
* Whether to enable automatic backups for the file system.
*
* @default false
*/
readonly enableAutomaticBackups?: boolean;
/**
* File system policy is an IAM resource policy used to control NFS access to an EFS file system.
*
* @default none
*/
readonly fileSystemPolicy?: iam.PolicyDocument;
/**
* Allow access from anonymous client that doesn't use IAM authentication.
*
* @default false when using `grantRead`, `grantWrite`, `grantRootAccess`
* or set `@aws-cdk/aws-efs:denyAnonymousAccess` feature flag, otherwise true
*/
readonly allowAnonymousAccess?: boolean;
/**
* Whether this is a One Zone file system.
* If enabled, `performanceMode` must be set to `GENERAL_PURPOSE` and `vpcSubnets` cannot be set.
*
* @default false
* @link https://docs.aws.amazon.com/efs/latest/ug/availability-durability.html#file-system-type
*/
readonly oneZone?: boolean;
/**
* Whether to enable the filesystem's replication overwrite protection or not.
* Set false if you want to create a read-only filesystem for use as a replication destination.
*
* @see https://docs.aws.amazon.com/efs/latest/ug/replication-use-cases.html#replicate-existing-destination
*
* @default ReplicationOverwriteProtection.ENABLED
*/
readonly replicationOverwriteProtection?: ReplicationOverwriteProtection;
/**
* Replication configuration for the file system.
*
* @default - no replication
*/
readonly replicationConfiguration?: ReplicationConfiguration;
}
/**
* Properties that describe an existing EFS file system.
*/
export interface FileSystemAttributes {
/**
* The security group of the file system
*/
readonly securityGroup: ec2.ISecurityGroup;
/**
* The File System's ID.
*
* @default - determined based on fileSystemArn
*/
readonly fileSystemId?: string;
/**
* The File System's Arn.
*
* @default - determined based on fileSystemId
*/
readonly fileSystemArn?: string;
}
/**
* Properties for the ReplicationConfiguration.
*/
export interface ReplicationConfigurationProps {
/**
* The existing destination file system for the replication.
*
* @default - None
*/
readonly destinationFileSystem?: IFileSystemRef;
/**
* AWS KMS key used to protect the encrypted file system.
*
* @default - use service-managed KMS key for Amazon EFS
*/
readonly kmsKey?: kms.IKey;
/**
* The AWS Region in which the destination file system is located.
*
* @default - the region of the stack
*/
readonly region?: string;
/**
* The availability zone name of the destination file system.
* One zone file system is used as the destination file system when this property is set.
*
* @default - no availability zone is set
*/
readonly availabilityZone?: string;
}
/**
* Properties for configuring ReplicationConfiguration to replicate
* to a new One Zone file system.
*/
export interface OneZoneFileSystemProps {
/**
* AWS KMS key used to protect the encrypted file system.
*
* @default - use service-managed KMS key for Amazon EFS
*/
readonly kmsKey?: kms.IKey;
/**
* The AWS Region in which the destination file system is located.
*/
readonly region: string;
/**
* The availability zone name of the destination file system.
* One zone file system is used as the destination file system when this property is set.
*/
readonly availabilityZone: string;
}
/**
* Properties for configuring ReplicationConfiguration to replicate
* to a new Regional file system.
*/
export interface RegionalFileSystemProps {
/**
* AWS KMS key used to protect the encrypted file system.
*
* @default - use service-managed KMS key for Amazon EFS
*/
readonly kmsKey?: kms.IKey;
/**
* The AWS Region in which the destination file system is located.
*
* @default - the region of the stack
*/
readonly region?: string;
}
/**
* Properties for configuring ReplicationConfiguration to replicate
* to an existing file system.
*/
export interface ExistingFileSystemProps {
/**
* The existing destination file system for the replication.
*/
readonly destinationFileSystem: IFileSystemRef;
}
/**
* EFS Replication Configuration
*/
export declare abstract class ReplicationConfiguration {
/**
* Specify the existing destination file system for the replication.
*
* @param destinationFileSystem The existing destination file system for the replication
*/
static existingFileSystem(destinationFileSystem: IFileSystemRef): ReplicationConfiguration;
/**
* Create a new regional destination file system for the replication.
*
* @param region The AWS Region in which the destination file system is located. Default is the region of the stack.
* @param kmsKey AWS KMS key used to protect the encrypted file system. Default is service-managed KMS key for Amazon EFS.
*/
static regionalFileSystem(region?: string, kmsKey?: kms.IKey): ReplicationConfiguration;
/**
* Create a new one zone destination file system for the replication.
*
* @param region The AWS Region in which the specified availability zone belongs to.
* @param availabilityZone The availability zone name of the destination file system.
* @param kmsKey AWS KMS key used to protect the encrypted file system. Default is service-managed KMS key for Amazon EFS.
*/
static oneZoneFileSystem(region: string, availabilityZone: string, kmsKey?: kms.IKey): ReplicationConfiguration;
private readonly _destinationFileSystem?;
/**
* The existing destination file system for the replication.
*/
get destinationFileSystem(): IFileSystem | undefined;
/**
* @internal
*/
get _destinationFileSystemRef(): IFileSystemRef | undefined;
/**
* AWS KMS key used to protect the encrypted file system.
*/
readonly kmsKey?: kms.IKey;
/**
* The AWS Region in which the destination file system is located.
*/
readonly region?: string;
/**
* The availability zone name of the destination file system.
* One zone file system is used as the destination file system when this property is set.
*/
readonly availabilityZone?: string;
constructor(options: ReplicationConfigurationProps);
}
declare abstract class FileSystemBase extends Resource implements IFileSystem {
/**
* The security groups/rules used to allow network connections to the file system.
*/
abstract readonly connections: ec2.Connections;
/**
* @attribute
*/
abstract readonly fileSystemId: string;
/**
* @attribute
*/
abstract readonly fileSystemArn: string;
/**
* Dependable that can be depended upon to ensure the mount targets of the filesystem are ready
*/
abstract readonly mountTargetsAvailable: IDependable;
get fileSystemRef(): FileSystemReference;
/**
* @internal
*/
protected _resource?: CfnFileSystem;
/**
* @internal
*/
protected _fileSystemPolicy?: iam.PolicyDocument;
/**
* @internal
*/
protected _grantedClient: boolean;
/**
* Grant the actions defined in actions to the given grantee
* on this File System resource.
*
* [disable-awslint:no-grants]
*
* @param grantee Principal to grant right to
* @param actions The actions to grant
*/
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Grant the client actions defined in actions to the given grantee on this File System resource.
* If this method is used and the allowAnonymousAccess props are not specified,
* anonymous access to this file system is prohibited.
*
* @param grantee The principal to grant right to
* @param actions The client actions to grant
* @param conditions The conditions to grant
*/
private _grantClient;
/**
* Grant read permissions for this file system to an IAM principal.
*
* [disable-awslint:no-grants]
*
* @param grantee The principal to grant read to
*/
grantRead(grantee: iam.IGrantable): iam.Grant;
/**
* Grant read and write permissions for this file system to an IAM principal.
*
* [disable-awslint:no-grants]
*
* @param grantee The principal to grant read and write to
*/
grantReadWrite(grantee: iam.IGrantable): iam.Grant;
/**
* As root user, grant read and write permissions for this file system to an IAM principal.
*
* [disable-awslint:no-grants]
*
* @param grantee The principal to grant root access to
*/
grantRootAccess(grantee: iam.IGrantable): iam.Grant;
/**
* Adds a statement to the resource policy associated with this file system.
* A resource policy will be automatically created upon the first call to `addToResourcePolicy`.
*
* Note that this does not work with imported file systems.
*
* @param statement The policy statement to add
*/
addToResourcePolicy(statement: iam.PolicyStatement): iam.AddToResourcePolicyResult;
}
/**
* The Elastic File System implementation of IFileSystem.
* It creates a new, empty file system in Amazon Elastic File System (Amazon EFS).
* It also creates mount target (AWS::EFS::MountTarget) implicitly to mount the
* EFS file system on an Amazon Elastic Compute Cloud (Amazon EC2) instance or another resource.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-filesystem.html
*
* @resource AWS::EFS::FileSystem
*/
export declare class FileSystem extends FileSystemBase {
/**
* Uniquely identifies this class.
*/
static readonly PROPERTY_INJECTION_ID: string;
/**
* The default port File System listens on.
*/
static readonly DEFAULT_PORT: number;
/**
* Import an existing File System from the given properties.
*/
static fromFileSystemAttributes(scope: Construct, id: string, attrs: FileSystemAttributes): IFileSystem;
/**
* The security groups/rules used to allow network connections to the file system.
*/
readonly connections: ec2.Connections;
/**
* @attribute
*/
readonly fileSystemId: string;
/**
* @attribute
*/
readonly fileSystemArn: string;
readonly mountTargetsAvailable: IDependable;
private readonly _mountTargetsAvailable;
private readonly props;
/**
* Constructor for creating a new EFS FileSystem.
*/
constructor(scope: Construct, id: string, props: FileSystemProps);
private oneZoneValidation;
/**
* create access point from this filesystem
*/
addAccessPoint(id: string, accessPointOptions?: AccessPointOptions): AccessPoint;
}
export {};

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

3
cdk/node_modules/aws-cdk-lib/aws-efs/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export * from './access-point';
export * from './efs-file-system';
export * from './efs.generated';

1
cdk/node_modules/aws-cdk-lib/aws-efs/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});var _noFold;exports.AccessPoint=void 0,Object.defineProperty(exports,_noFold="AccessPoint",{enumerable:!0,configurable:!0,get:()=>{var value=require("./access-point").AccessPoint;return Object.defineProperty(exports,_noFold="AccessPoint",{enumerable:!0,configurable:!0,value}),value}}),exports.LifecyclePolicy=void 0,Object.defineProperty(exports,_noFold="LifecyclePolicy",{enumerable:!0,configurable:!0,get:()=>{var value=require("./efs-file-system").LifecyclePolicy;return Object.defineProperty(exports,_noFold="LifecyclePolicy",{enumerable:!0,configurable:!0,value}),value}}),exports.OutOfInfrequentAccessPolicy=void 0,Object.defineProperty(exports,_noFold="OutOfInfrequentAccessPolicy",{enumerable:!0,configurable:!0,get:()=>{var value=require("./efs-file-system").OutOfInfrequentAccessPolicy;return Object.defineProperty(exports,_noFold="OutOfInfrequentAccessPolicy",{enumerable:!0,configurable:!0,value}),value}}),exports.PerformanceMode=void 0,Object.defineProperty(exports,_noFold="PerformanceMode",{enumerable:!0,configurable:!0,get:()=>{var value=require("./efs-file-system").PerformanceMode;return Object.defineProperty(exports,_noFold="PerformanceMode",{enumerable:!0,configurable:!0,value}),value}}),exports.ThroughputMode=void 0,Object.defineProperty(exports,_noFold="ThroughputMode",{enumerable:!0,configurable:!0,get:()=>{var value=require("./efs-file-system").ThroughputMode;return Object.defineProperty(exports,_noFold="ThroughputMode",{enumerable:!0,configurable:!0,value}),value}}),exports.ReplicationOverwriteProtection=void 0,Object.defineProperty(exports,_noFold="ReplicationOverwriteProtection",{enumerable:!0,configurable:!0,get:()=>{var value=require("./efs-file-system").ReplicationOverwriteProtection;return Object.defineProperty(exports,_noFold="ReplicationOverwriteProtection",{enumerable:!0,configurable:!0,value}),value}}),exports.ReplicationConfiguration=void 0,Object.defineProperty(exports,_noFold="ReplicationConfiguration",{enumerable:!0,configurable:!0,get:()=>{var value=require("./efs-file-system").ReplicationConfiguration;return Object.defineProperty(exports,_noFold="ReplicationConfiguration",{enumerable:!0,configurable:!0,value}),value}}),exports.FileSystem=void 0,Object.defineProperty(exports,_noFold="FileSystem",{enumerable:!0,configurable:!0,get:()=>{var value=require("./efs-file-system").FileSystem;return Object.defineProperty(exports,_noFold="FileSystem",{enumerable:!0,configurable:!0,value}),value}}),exports.CfnAccessPoint=void 0,Object.defineProperty(exports,_noFold="CfnAccessPoint",{enumerable:!0,configurable:!0,get:()=>{var value=require("./efs.generated").CfnAccessPoint;return Object.defineProperty(exports,_noFold="CfnAccessPoint",{enumerable:!0,configurable:!0,value}),value}}),exports.CfnFileSystem=void 0,Object.defineProperty(exports,_noFold="CfnFileSystem",{enumerable:!0,configurable:!0,get:()=>{var value=require("./efs.generated").CfnFileSystem;return Object.defineProperty(exports,_noFold="CfnFileSystem",{enumerable:!0,configurable:!0,value}),value}}),exports.CfnMountTarget=void 0,Object.defineProperty(exports,_noFold="CfnMountTarget",{enumerable:!0,configurable:!0,get:()=>{var value=require("./efs.generated").CfnMountTarget;return Object.defineProperty(exports,_noFold="CfnMountTarget",{enumerable:!0,configurable:!0,value}),value}});