@effortless-aws/cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/dist/cli/index.js +44 -14
- package/package.json +2 -2
- package/dist/cli/index.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# @effortless-aws/cli
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@effortless-aws/cli)
|
|
4
|
+
|
|
5
|
+
CLI and deploy tooling for [effortless-aws](https://www.npmjs.com/package/effortless-aws). Deploys Lambda functions, API Gateway routes, DynamoDB tables, SQS queues, S3 buckets, and CloudFront sites directly via AWS SDK — no CloudFormation, no state files.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D @effortless-aws/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
| Command | Description |
|
|
14
|
+
|---------|-------------|
|
|
15
|
+
| `eff deploy` | Build and deploy all handlers to AWS |
|
|
16
|
+
| `eff build` | Bundle handlers without deploying |
|
|
17
|
+
| `eff status` | Show deployed resources and their status |
|
|
18
|
+
| `eff logs` | Tail CloudWatch logs for a handler |
|
|
19
|
+
| `eff config` | Manage SSM parameters |
|
|
20
|
+
| `eff layer` | Manage shared Lambda layers |
|
|
21
|
+
| `eff cleanup` | Remove orphaned AWS resources |
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Deploy everything
|
|
27
|
+
npx eff deploy
|
|
28
|
+
|
|
29
|
+
# Deploy to a specific stage
|
|
30
|
+
npx eff deploy --stage production
|
|
31
|
+
|
|
32
|
+
# View logs
|
|
33
|
+
npx eff logs --handler hello
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## How it works
|
|
37
|
+
|
|
38
|
+
1. Scans your TypeScript files for exported handler definitions
|
|
39
|
+
2. Bundles each handler with esbuild
|
|
40
|
+
3. Deploys directly via AWS SDK (IAM roles, Lambda functions, API Gateway routes, etc.)
|
|
41
|
+
4. Tags all resources for tracking — no external state files needed
|
|
42
|
+
|
|
43
|
+
## Documentation
|
|
44
|
+
|
|
45
|
+
Full docs: **[effortless-aws.website](https://effortless-aws.website)**
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
MIT
|
package/dist/cli/index.js
CHANGED
|
@@ -1955,19 +1955,47 @@ var ensureFunctionUrl = (functionName) => Effect13.gen(function* () {
|
|
|
1955
1955
|
return { functionUrl: result.FunctionUrl };
|
|
1956
1956
|
});
|
|
1957
1957
|
var addCloudFrontPermission = (functionName, distributionArn) => Effect13.gen(function* () {
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
)
|
|
1958
|
+
const statements = [
|
|
1959
|
+
{
|
|
1960
|
+
statementId: "cloudfront-oac",
|
|
1961
|
+
action: "lambda:InvokeFunctionUrl",
|
|
1962
|
+
authType: "AWS_IAM"
|
|
1963
|
+
},
|
|
1964
|
+
{
|
|
1965
|
+
statementId: "cloudfront-oac-invoke",
|
|
1966
|
+
action: "lambda:InvokeFunction",
|
|
1967
|
+
authType: void 0
|
|
1968
|
+
}
|
|
1969
|
+
];
|
|
1970
|
+
for (const stmt of statements) {
|
|
1971
|
+
yield* lambda_exports.make("add_permission", {
|
|
1972
|
+
FunctionName: functionName,
|
|
1973
|
+
StatementId: stmt.statementId,
|
|
1974
|
+
Action: stmt.action,
|
|
1975
|
+
Principal: "cloudfront.amazonaws.com",
|
|
1976
|
+
SourceArn: distributionArn,
|
|
1977
|
+
...stmt.authType ? { FunctionUrlAuthType: stmt.authType } : {}
|
|
1978
|
+
}).pipe(
|
|
1979
|
+
Effect13.catchIf(
|
|
1980
|
+
(e) => e._tag === "LambdaError" && e.is("ResourceConflictException"),
|
|
1981
|
+
() => Effect13.gen(function* () {
|
|
1982
|
+
yield* Effect13.logDebug(`Permission ${stmt.statementId} exists for ${functionName}, replacing...`);
|
|
1983
|
+
yield* lambda_exports.make("remove_permission", {
|
|
1984
|
+
FunctionName: functionName,
|
|
1985
|
+
StatementId: stmt.statementId
|
|
1986
|
+
});
|
|
1987
|
+
yield* lambda_exports.make("add_permission", {
|
|
1988
|
+
FunctionName: functionName,
|
|
1989
|
+
StatementId: stmt.statementId,
|
|
1990
|
+
Action: stmt.action,
|
|
1991
|
+
Principal: "cloudfront.amazonaws.com",
|
|
1992
|
+
SourceArn: distributionArn,
|
|
1993
|
+
...stmt.authType ? { FunctionUrlAuthType: stmt.authType } : {}
|
|
1994
|
+
});
|
|
1995
|
+
})
|
|
1996
|
+
)
|
|
1997
|
+
);
|
|
1998
|
+
}
|
|
1971
1999
|
});
|
|
1972
2000
|
var deleteLambda = (functionName) => Effect13.gen(function* () {
|
|
1973
2001
|
yield* Effect13.logDebug(`Deleting Lambda function: ${functionName}`);
|
|
@@ -3543,11 +3571,13 @@ var ensureSsrDistribution = (input) => Effect21.gen(function* () {
|
|
|
3543
3571
|
CachedMethods: { Quantity: 2, Items: [...CACHED_METHODS] }
|
|
3544
3572
|
},
|
|
3545
3573
|
Compress: true,
|
|
3574
|
+
SmoothStreaming: false,
|
|
3546
3575
|
CachePolicyId: CACHING_DISABLED_POLICY_ID,
|
|
3547
3576
|
OriginRequestPolicyId: ALL_VIEWER_EXCEPT_HOST_HEADER_POLICY_ID,
|
|
3548
3577
|
ResponseHeadersPolicyId: SECURITY_HEADERS_POLICY_ID,
|
|
3549
3578
|
FunctionAssociations: { Quantity: 0, Items: [] },
|
|
3550
|
-
LambdaFunctionAssociations: { Quantity: 0, Items: [] }
|
|
3579
|
+
LambdaFunctionAssociations: { Quantity: 0, Items: [] },
|
|
3580
|
+
FieldLevelEncryptionId: ""
|
|
3551
3581
|
};
|
|
3552
3582
|
const cacheBehaviors = assetPatterns.length > 0 ? {
|
|
3553
3583
|
Quantity: assetPatterns.length,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effortless-aws/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "CLI and deploy tooling for effortless-aws",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"esbuild": "^0.25.0",
|
|
40
40
|
"glob": "^13.0.0",
|
|
41
41
|
"ts-morph": "^27.0.2",
|
|
42
|
-
"effortless-aws": "0.
|
|
42
|
+
"effortless-aws": "0.17.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@effect-ak/aws-sdk": "1.0.0-rc.3",
|