@stacksjs/cloud 0.58.72 → 0.59.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/dist/cloud/ai.d.ts +10 -0
- package/dist/cloud/cdn.d.ts +44 -0
- package/dist/cloud/cli.d.ts +9 -0
- package/dist/cloud/compute.d.ts +17 -0
- package/dist/cloud/deployment.d.ts +14 -0
- package/dist/cloud/dns.d.ts +7 -0
- package/dist/cloud/docs.d.ts +9 -0
- package/dist/cloud/email.d.ts +10 -0
- package/dist/cloud/file-system.d.ts +12 -0
- package/dist/cloud/index.d.ts +41 -0
- package/dist/cloud/jump-box.d.ts +12 -0
- package/dist/cloud/network.d.ts +9 -0
- package/dist/cloud/permissions.d.ts +7 -0
- package/dist/cloud/queue.d.ts +24 -0
- package/dist/cloud/redirects.d.ts +9 -0
- package/dist/cloud/security.d.ts +14 -0
- package/dist/cloud/storage.d.ts +18 -0
- package/dist/edge/origin-request.d.ts +1 -0
- package/dist/helpers.d.ts +69 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -5
- package/dist/types.d.ts +26 -0
- package/package.json +33 -37
- package/src/cloud/aws-sdk-layer/nodejs/package-lock.json +6 -6
- package/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
- package/src/cloud/router-layer/nodejs/package.json +2 -2
- package/src/helpers.ts +7 -5
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { aws_lambda as lambda } from 'aws-cdk-lib';
|
|
2
|
+
import type { Construct } from 'constructs';
|
|
3
|
+
import type { NestedCloudProps } from '../types';
|
|
4
|
+
export interface AiStackProps extends NestedCloudProps {
|
|
5
|
+
}
|
|
6
|
+
export declare class AiStack {
|
|
7
|
+
askAiUrl: lambda.FunctionUrl;
|
|
8
|
+
summarizeAiUrl: lambda.FunctionUrl;
|
|
9
|
+
constructor(scope: Construct, props: AiStackProps);
|
|
10
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { aws_certificatemanager as acm, aws_lambda as lambda, aws_s3 as s3, aws_wafv2 as wafv2 } from 'aws-cdk-lib';
|
|
2
|
+
import { aws_cloudfront as cloudfront, aws_route53 as route53 } from 'aws-cdk-lib';
|
|
3
|
+
import type { Construct } from 'constructs';
|
|
4
|
+
import type { ApplicationLoadBalancer } from 'aws-cdk-lib/aws-elasticloadbalancingv2';
|
|
5
|
+
import type { NestedCloudProps } from '../types';
|
|
6
|
+
export interface CdnStackProps extends NestedCloudProps {
|
|
7
|
+
certificate: acm.Certificate;
|
|
8
|
+
logBucket: s3.Bucket;
|
|
9
|
+
publicBucket: s3.Bucket;
|
|
10
|
+
firewall: wafv2.CfnWebACL;
|
|
11
|
+
originRequestFunction: lambda.Function;
|
|
12
|
+
zone: route53.IHostedZone;
|
|
13
|
+
webServer?: lambda.Function;
|
|
14
|
+
webServerUrl?: lambda.FunctionUrl;
|
|
15
|
+
cliSetupUrl: lambda.FunctionUrl;
|
|
16
|
+
askAiUrl: lambda.FunctionUrl;
|
|
17
|
+
summarizeAiUrl: lambda.FunctionUrl;
|
|
18
|
+
lb?: ApplicationLoadBalancer;
|
|
19
|
+
}
|
|
20
|
+
export declare class CdnStack {
|
|
21
|
+
distribution: cloudfront.Distribution;
|
|
22
|
+
originAccessIdentity: cloudfront.OriginAccessIdentity;
|
|
23
|
+
cdnCachePolicy: cloudfront.CachePolicy;
|
|
24
|
+
apiCachePolicy: cloudfront.CachePolicy | undefined;
|
|
25
|
+
vanityUrl: string;
|
|
26
|
+
realtimeLogConfig: cloudfront.RealtimeLogConfig;
|
|
27
|
+
props: CdnStackProps;
|
|
28
|
+
constructor(scope: Construct, props: CdnStackProps);
|
|
29
|
+
getCookieBehavior(behavior: string | undefined): cloudfront.CacheCookieBehavior | undefined;
|
|
30
|
+
allowedMethods(): cloudfront.AllowedMethods;
|
|
31
|
+
cachedMethods(): cloudfront.CachedMethods;
|
|
32
|
+
allowedMethodsFromString(methods?: 'ALL' | 'GET_HEAD' | 'GET_HEAD_OPTIONS'): cloudfront.AllowedMethods;
|
|
33
|
+
cachedMethodsFromString(methods?: 'GET_HEAD' | 'GET_HEAD_OPTIONS'): cloudfront.CachedMethods;
|
|
34
|
+
shouldDeployApi(): any;
|
|
35
|
+
apiBehaviorOptions(scope: Construct, props: CdnStackProps): Record<string, cloudfront.BehaviorOptions>;
|
|
36
|
+
docsBehaviorOptions(props: CdnStackProps): Record<string, cloudfront.BehaviorOptions>;
|
|
37
|
+
aiBehaviorOptions(scope: Construct, props: CdnStackProps): Record<string, cloudfront.BehaviorOptions>;
|
|
38
|
+
cliSetupBehaviorOptions(scope: Construct, props: CdnStackProps): Record<string, cloudfront.BehaviorOptions>;
|
|
39
|
+
shouldDeployAiEndpoints(): Partial<import("@stacksjs/types").AiOptions>;
|
|
40
|
+
shouldDeployCliSetup(): Partial<import("@stacksjs/types").BinaryOptions>;
|
|
41
|
+
shouldDeployDocs(): boolean;
|
|
42
|
+
additionalBehaviors(scope: Construct, props: CdnStackProps): Record<string, cloudfront.BehaviorOptions>;
|
|
43
|
+
setApiCachePolicy(scope: Construct): cloudfront.CachePolicy;
|
|
44
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { aws_lambda as lambda } from 'aws-cdk-lib';
|
|
2
|
+
import type { Construct } from 'constructs';
|
|
3
|
+
import type { NestedCloudProps } from '../types';
|
|
4
|
+
export interface CliStackProps extends NestedCloudProps {
|
|
5
|
+
}
|
|
6
|
+
export declare class CliStack {
|
|
7
|
+
cliSetupUrl: lambda.FunctionUrl;
|
|
8
|
+
constructor(scope: Construct, props: CliStackProps);
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { aws_certificatemanager as acm, aws_efs as efs } from 'aws-cdk-lib';
|
|
2
|
+
import { aws_ec2 as ec2, aws_ecs as ecs, aws_route53 as route53 } from 'aws-cdk-lib';
|
|
3
|
+
import type { Construct } from 'constructs';
|
|
4
|
+
import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
|
|
5
|
+
import type { NestedCloudProps } from '../types';
|
|
6
|
+
export interface ComputeStackProps extends NestedCloudProps {
|
|
7
|
+
vpc: ec2.Vpc;
|
|
8
|
+
fileSystem: efs.FileSystem;
|
|
9
|
+
zone: route53.IHostedZone;
|
|
10
|
+
certificate: acm.Certificate;
|
|
11
|
+
}
|
|
12
|
+
export declare class ComputeStack {
|
|
13
|
+
lb: elbv2.ApplicationLoadBalancer;
|
|
14
|
+
cluster: ecs.Cluster;
|
|
15
|
+
taskDefinition: ecs.FargateTaskDefinition;
|
|
16
|
+
constructor(scope: Construct, props: ComputeStackProps);
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { aws_cloudfront as cloudfront, aws_s3 as s3 } from 'aws-cdk-lib';
|
|
2
|
+
import type { Construct } from 'constructs';
|
|
3
|
+
import type { NestedCloudProps } from '../types';
|
|
4
|
+
export interface DeploymentStackProps extends NestedCloudProps {
|
|
5
|
+
publicBucket: s3.Bucket;
|
|
6
|
+
privateBucket: s3.Bucket;
|
|
7
|
+
cdn: cloudfront.Distribution;
|
|
8
|
+
}
|
|
9
|
+
export declare class DeploymentStack {
|
|
10
|
+
privateSource: string;
|
|
11
|
+
docsSource: string;
|
|
12
|
+
websiteSource: string;
|
|
13
|
+
constructor(scope: Construct, props: DeploymentStackProps);
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { aws_route53 as route53 } from 'aws-cdk-lib';
|
|
2
|
+
import type { Construct } from 'constructs';
|
|
3
|
+
import type { NestedCloudProps } from '../types';
|
|
4
|
+
export declare class DnsStack {
|
|
5
|
+
zone: route53.IHostedZone;
|
|
6
|
+
constructor(scope: Construct, props: NestedCloudProps);
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { aws_lambda as lambda } from 'aws-cdk-lib';
|
|
2
|
+
import type { Construct } from 'constructs';
|
|
3
|
+
import type { NestedCloudProps } from '../types';
|
|
4
|
+
export interface DocsStackProps extends NestedCloudProps {
|
|
5
|
+
}
|
|
6
|
+
export declare class DocsStack {
|
|
7
|
+
originRequestFunction: lambda.Function;
|
|
8
|
+
constructor(scope: Construct, props: DocsStackProps);
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { aws_route53 as route53, aws_s3 as s3 } from 'aws-cdk-lib';
|
|
2
|
+
import type { Construct } from 'constructs';
|
|
3
|
+
import type { NestedCloudProps } from '../types';
|
|
4
|
+
export interface EmailStackProps extends NestedCloudProps {
|
|
5
|
+
zone: route53.IHostedZone;
|
|
6
|
+
}
|
|
7
|
+
export declare class EmailStack {
|
|
8
|
+
emailBucket: s3.Bucket;
|
|
9
|
+
constructor(scope: Construct, props: EmailStackProps);
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { aws_ec2 as ec2 } from 'aws-cdk-lib';
|
|
2
|
+
import { aws_efs as efs } from 'aws-cdk-lib';
|
|
3
|
+
import type { Construct } from 'constructs';
|
|
4
|
+
import type { NestedCloudProps } from '../types';
|
|
5
|
+
export interface FileSystemStackProps extends NestedCloudProps {
|
|
6
|
+
vpc: ec2.Vpc;
|
|
7
|
+
}
|
|
8
|
+
export declare class FileSystemStack {
|
|
9
|
+
fileSystem: efs.FileSystem;
|
|
10
|
+
accessPoint: efs.AccessPoint;
|
|
11
|
+
constructor(scope: Construct, props: FileSystemStackProps);
|
|
12
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Stack } from 'aws-cdk-lib';
|
|
2
|
+
import type { Construct } from 'constructs';
|
|
3
|
+
import type { CloudOptions } from '../types';
|
|
4
|
+
import { AiStack } from './ai';
|
|
5
|
+
import { CdnStack } from './cdn';
|
|
6
|
+
import { CliStack } from './cli';
|
|
7
|
+
import { DnsStack } from './dns';
|
|
8
|
+
import { DocsStack } from './docs';
|
|
9
|
+
import { StorageStack } from './storage';
|
|
10
|
+
import { SecurityStack } from './security';
|
|
11
|
+
import { DeploymentStack } from './deployment';
|
|
12
|
+
import { JumpBoxStack } from './jump-box';
|
|
13
|
+
import { FileSystemStack } from './file-system';
|
|
14
|
+
import { NetworkStack } from './network';
|
|
15
|
+
import { RedirectsStack } from './redirects';
|
|
16
|
+
import { EmailStack } from './email';
|
|
17
|
+
import { PermissionsStack } from './permissions';
|
|
18
|
+
import { ComputeStack } from './compute';
|
|
19
|
+
import { QueueStack } from './queue';
|
|
20
|
+
export declare class Cloud extends Stack {
|
|
21
|
+
dns: DnsStack;
|
|
22
|
+
security: SecurityStack;
|
|
23
|
+
storage: StorageStack;
|
|
24
|
+
network: NetworkStack;
|
|
25
|
+
fileSystem: FileSystemStack;
|
|
26
|
+
jumpBox: JumpBoxStack;
|
|
27
|
+
docs: DocsStack;
|
|
28
|
+
email: EmailStack;
|
|
29
|
+
redirects: RedirectsStack;
|
|
30
|
+
permissions: PermissionsStack;
|
|
31
|
+
ai: AiStack;
|
|
32
|
+
cli: CliStack;
|
|
33
|
+
api: ComputeStack;
|
|
34
|
+
cdn: CdnStack;
|
|
35
|
+
queue: QueueStack;
|
|
36
|
+
deployment: DeploymentStack;
|
|
37
|
+
scope: Construct;
|
|
38
|
+
props: CloudOptions;
|
|
39
|
+
constructor(scope: Construct, id: string, props: CloudOptions);
|
|
40
|
+
init(): Promise<void>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { aws_efs as efs } from 'aws-cdk-lib';
|
|
2
|
+
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
|
|
3
|
+
import type { Construct } from 'constructs';
|
|
4
|
+
import type { NestedCloudProps } from '../types';
|
|
5
|
+
export interface JumpBoxStackProps extends NestedCloudProps {
|
|
6
|
+
vpc: ec2.Vpc;
|
|
7
|
+
fileSystem: efs.FileSystem;
|
|
8
|
+
}
|
|
9
|
+
export declare class JumpBoxStack {
|
|
10
|
+
jumpBox?: ec2.Instance;
|
|
11
|
+
constructor(scope: Construct, props: JumpBoxStackProps);
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
|
|
2
|
+
import type { Construct } from 'constructs';
|
|
3
|
+
import type { NestedCloudProps } from '../types';
|
|
4
|
+
export interface NetworkStackProps extends NestedCloudProps {
|
|
5
|
+
}
|
|
6
|
+
export declare class NetworkStack {
|
|
7
|
+
vpc: ec2.Vpc;
|
|
8
|
+
constructor(scope: Construct, props: NetworkStackProps);
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Cluster, TaskDefinition } from 'aws-cdk-lib/aws-ecs';
|
|
2
|
+
import type { Construct } from 'constructs';
|
|
3
|
+
import type { NestedCloudProps } from '../types';
|
|
4
|
+
export interface QueueStackProps extends NestedCloudProps {
|
|
5
|
+
cluster: Cluster;
|
|
6
|
+
taskDefinition: TaskDefinition;
|
|
7
|
+
}
|
|
8
|
+
export declare class QueueStack {
|
|
9
|
+
scope: Construct;
|
|
10
|
+
props: QueueStackProps;
|
|
11
|
+
constructor(scope: Construct, props: QueueStackProps);
|
|
12
|
+
init(): Promise<void>;
|
|
13
|
+
cronScheduleFromRate(rate: string): {
|
|
14
|
+
minute?: string;
|
|
15
|
+
hour?: string;
|
|
16
|
+
month?: string;
|
|
17
|
+
weekDay?: string;
|
|
18
|
+
year?: string;
|
|
19
|
+
};
|
|
20
|
+
loadModule(filePath: string): Promise<any>;
|
|
21
|
+
createQueueRule(module: {
|
|
22
|
+
default: any;
|
|
23
|
+
}, file: string): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { aws_route53 as route53 } from 'aws-cdk-lib';
|
|
2
|
+
import type { Construct } from 'constructs';
|
|
3
|
+
import type { NestedCloudProps } from '../types';
|
|
4
|
+
export interface RedirectsStackProps extends NestedCloudProps {
|
|
5
|
+
}
|
|
6
|
+
export declare class RedirectsStack {
|
|
7
|
+
redirectZones: route53.IHostedZone[];
|
|
8
|
+
constructor(scope: Construct, props: RedirectsStackProps);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { aws_route53 as route53 } from 'aws-cdk-lib';
|
|
2
|
+
import { aws_certificatemanager as acm, aws_kms as kms, aws_wafv2 as wafv2 } from 'aws-cdk-lib';
|
|
3
|
+
import type { Construct } from 'constructs';
|
|
4
|
+
import type { NestedCloudProps } from '../types';
|
|
5
|
+
export interface StorageStackProps extends NestedCloudProps {
|
|
6
|
+
zone: route53.IHostedZone;
|
|
7
|
+
}
|
|
8
|
+
export declare class SecurityStack {
|
|
9
|
+
firewall: wafv2.CfnWebACL;
|
|
10
|
+
kmsKey: kms.Key;
|
|
11
|
+
certificate: acm.Certificate;
|
|
12
|
+
constructor(scope: Construct, props: StorageStackProps);
|
|
13
|
+
getFirewallRules(): wafv2.CfnWebACL.RuleProperty[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { aws_kms as kms } from 'aws-cdk-lib';
|
|
2
|
+
import { aws_backup as backup, aws_iam as iam, aws_s3 as s3 } from 'aws-cdk-lib';
|
|
3
|
+
import type { Construct } from 'constructs';
|
|
4
|
+
import type { NestedCloudProps } from '../types';
|
|
5
|
+
export interface StorageStackProps extends NestedCloudProps {
|
|
6
|
+
kmsKey: kms.Key;
|
|
7
|
+
}
|
|
8
|
+
export declare class StorageStack {
|
|
9
|
+
publicBucket: s3.Bucket;
|
|
10
|
+
privateBucket: s3.Bucket;
|
|
11
|
+
logBucket: s3.Bucket;
|
|
12
|
+
bucketPrefix: string;
|
|
13
|
+
vault: backup.BackupVault;
|
|
14
|
+
backupPlan: backup.BackupPlan;
|
|
15
|
+
backupRole: iam.Role;
|
|
16
|
+
constructor(scope: Construct, props: StorageStackProps);
|
|
17
|
+
createBackupRole(scope: Construct): iam.Role;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function handler(event: any, context: any, callback: any): void;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/// <reference types="bun-types" />
|
|
2
|
+
/// <reference types="bun-types" />
|
|
3
|
+
import { _InstanceType as InstanceType } from '@aws-sdk/client-ec2';
|
|
4
|
+
import type { CountryCode } from '@aws-sdk/client-route-53-domains';
|
|
5
|
+
import { ContactType } from '@aws-sdk/client-route-53-domains';
|
|
6
|
+
export { InstanceType };
|
|
7
|
+
export declare function getSecurityGroupId(securityGroupName: string): Promise<import("neverthrow").Err<never, string> | import("neverthrow").Ok<string | undefined, never>>;
|
|
8
|
+
export interface PurchaseOptions {
|
|
9
|
+
domain: string;
|
|
10
|
+
years: number;
|
|
11
|
+
privacy: boolean;
|
|
12
|
+
autoRenew: boolean;
|
|
13
|
+
adminFirstName: string;
|
|
14
|
+
adminLastName: string;
|
|
15
|
+
adminOrganization: string;
|
|
16
|
+
adminAddressLine1: string;
|
|
17
|
+
adminAddressLine2: string;
|
|
18
|
+
adminCity: string;
|
|
19
|
+
adminState: string;
|
|
20
|
+
adminCountry: CountryCode;
|
|
21
|
+
adminZip: string;
|
|
22
|
+
adminPhone: string;
|
|
23
|
+
adminEmail: string;
|
|
24
|
+
techFirstName: string;
|
|
25
|
+
techLastName: string;
|
|
26
|
+
techOrganization: string;
|
|
27
|
+
techAddressLine1: string;
|
|
28
|
+
techAddressLine2: string;
|
|
29
|
+
techCity: string;
|
|
30
|
+
techState: string;
|
|
31
|
+
techCountry: CountryCode;
|
|
32
|
+
techZip: string;
|
|
33
|
+
techPhone: string;
|
|
34
|
+
techEmail: string;
|
|
35
|
+
registrantFirstName: string;
|
|
36
|
+
registrantLastName: string;
|
|
37
|
+
registrantOrganization: string;
|
|
38
|
+
registrantAddressLine1: string;
|
|
39
|
+
registrantAddressLine2: string;
|
|
40
|
+
registrantCity: string;
|
|
41
|
+
registrantState: string;
|
|
42
|
+
registrantCountry: CountryCode;
|
|
43
|
+
registrantZip: string;
|
|
44
|
+
registrantPhone: string;
|
|
45
|
+
registrantEmail: string;
|
|
46
|
+
privacyAdmin: boolean;
|
|
47
|
+
privacyTech: boolean;
|
|
48
|
+
privacyRegistrant: boolean;
|
|
49
|
+
contactType: ContactType;
|
|
50
|
+
verbose: boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare function purchaseDomain(domain: string, options: PurchaseOptions): import("neverthrow").Ok<Promise<import("@aws-sdk/client-route-53-domains").RegisterDomainCommandOutput>, never> | import("neverthrow").Err<never, any>;
|
|
53
|
+
export declare function getJumpBoxInstanceId(name?: string): Promise<string | undefined>;
|
|
54
|
+
export declare function deleteEc2Instance(id: string, stackName?: string): Promise<import("neverthrow").Err<never, string> | import("neverthrow").Ok<string, never>>;
|
|
55
|
+
export declare function deleteJumpBox(stackName?: string): Promise<import("neverthrow").Err<never, string> | import("neverthrow").Ok<string, never>>;
|
|
56
|
+
export declare function deleteIamUsers(): Promise<import("neverthrow").Ok<string, never>>;
|
|
57
|
+
export declare function deleteStacksBuckets(): Promise<import("neverthrow").Err<never, string> | import("neverthrow").Ok<string, never> | import("neverthrow").Err<never, Error>>;
|
|
58
|
+
export declare function deleteStacksFunctions(): Promise<import("neverthrow").Ok<string, never>>;
|
|
59
|
+
export declare function deleteLogGroups(): Promise<import("neverthrow").Err<never, string> | import("neverthrow").Ok<string, never> | import("neverthrow").Err<never, Error>>;
|
|
60
|
+
export declare function deleteParameterStore(): Promise<import("neverthrow").Ok<string, never>>;
|
|
61
|
+
export declare function deleteCdkRemnants(): Promise<import("neverthrow").Err<never, Error> | import("neverthrow").Ok<import("neverthrow").Result<import("bun").Subprocess<import("bun").SpawnOptions.Writable, import("bun").SpawnOptions.Readable, import("bun").SpawnOptions.Readable>, Error>, never>>;
|
|
62
|
+
export declare function hasBeenDeployed(): Promise<import("neverthrow").Err<never, Error> | import("neverthrow").Ok<boolean, never>>;
|
|
63
|
+
export declare function getJumpBoxInstanceProfileName(): Promise<import("neverthrow").Err<never, string> | import("neverthrow").Ok<string | undefined, never>>;
|
|
64
|
+
export declare function addJumpBox(stackName?: string): Promise<import("neverthrow").Err<never, string> | import("neverthrow").Ok<string, never>>;
|
|
65
|
+
export declare function getJumpBoxSecurityGroupName(): Promise<import("neverthrow").Err<never, string> | import("neverthrow").Ok<string | undefined, never>>;
|
|
66
|
+
export declare function getSecurityGroupFromInstanceId(instanceId: string): Promise<string | undefined>;
|
|
67
|
+
export declare function isFirstDeployment(): Promise<boolean>;
|
|
68
|
+
export declare function isFailedState(): Promise<boolean>;
|
|
69
|
+
export declare function getOrCreateTimestamp(): Promise<string>;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
CHANGED
|
@@ -11,9 +11,9 @@ import {ContactType, Route53Domains} from "@aws-sdk/client-route-53-domains";
|
|
|
11
11
|
import {ListBucketsCommand, S3} from "@aws-sdk/client-s3";
|
|
12
12
|
import {config as config2} from "@stacksjs/config";
|
|
13
13
|
import {err, handleError, ok} from "@stacksjs/error-handling";
|
|
14
|
+
import {runCommand} from "@stacksjs/cli";
|
|
14
15
|
import {log} from "@stacksjs/logging";
|
|
15
16
|
import {path as p} from "@stacksjs/path";
|
|
16
|
-
import {rimraf} from "@stacksjs/utils";
|
|
17
17
|
import {slug} from "@stacksjs/strings";
|
|
18
18
|
async function getSecurityGroupId(securityGroupName) {
|
|
19
19
|
const ec2 = new EC2({ region: "us-east-1" });
|
|
@@ -240,10 +240,7 @@ async function deleteParameterStore() {
|
|
|
240
240
|
}
|
|
241
241
|
async function deleteCdkRemnants() {
|
|
242
242
|
try {
|
|
243
|
-
return ok(await rimraf(
|
|
244
|
-
p.cloudPath("cdk.out/"),
|
|
245
|
-
p.cloudPath("cdk.context.json")
|
|
246
|
-
]));
|
|
243
|
+
return ok(await runCommand(`bunx rimraf ${p.cloudPath("cdk.out/")} ${p.cloudPath("cdk.context.json")}`));
|
|
247
244
|
} catch (error) {
|
|
248
245
|
return err(handleError("Error deleting CDK remnants", error));
|
|
249
246
|
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AppEnvType } from '@stacksjs/types';
|
|
2
|
+
import type { StackProps } from 'aws-cdk-lib';
|
|
3
|
+
export interface CloudOptions extends StackProps {
|
|
4
|
+
name: string;
|
|
5
|
+
env: {
|
|
6
|
+
account: string;
|
|
7
|
+
region: string;
|
|
8
|
+
};
|
|
9
|
+
slug: string;
|
|
10
|
+
appEnv: AppEnvType;
|
|
11
|
+
appName: string;
|
|
12
|
+
domain: string;
|
|
13
|
+
timestamp: string;
|
|
14
|
+
}
|
|
15
|
+
export interface NestedCloudProps {
|
|
16
|
+
name: string;
|
|
17
|
+
env: {
|
|
18
|
+
account: string;
|
|
19
|
+
region: string;
|
|
20
|
+
};
|
|
21
|
+
slug: string;
|
|
22
|
+
appEnv: AppEnvType;
|
|
23
|
+
appName: string;
|
|
24
|
+
domain: string;
|
|
25
|
+
timestamp: string;
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/cloud",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.59.1",
|
|
5
5
|
"description": "The Stacks cloud/serverless integration & implementation.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
28
|
"bun": "./src/index.ts",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
29
30
|
"import": "./dist/index.js"
|
|
30
31
|
},
|
|
31
32
|
"./*": {
|
|
@@ -48,26 +49,24 @@
|
|
|
48
49
|
"deploy": "cd ../.. && bun run build && cd ../docs && bun run build && cd ../core/cloud && bunx cdk deploy --require-approval never",
|
|
49
50
|
"build": "bun build.ts",
|
|
50
51
|
"build-edge": "bun build ./src/edge/origin-request.ts --outfile ./dist/origin-request.js",
|
|
51
|
-
"build-layer": "bun ./src/runtime/scripts/build-layer.ts",
|
|
52
|
-
"publish-layer": "bun ./src/runtime/scripts/publish-layer.ts",
|
|
53
|
-
"build-server": "echo 'bun --bun build-server.ts'",
|
|
54
52
|
"typecheck": "bun --bun tsc --noEmit",
|
|
55
53
|
"prepublishOnly": "bun run build"
|
|
56
54
|
},
|
|
57
55
|
"peerDependencies": {
|
|
58
|
-
"@aws-sdk/client-bedrock": "^3.
|
|
59
|
-
"@aws-sdk/client-cloudformation": "^3.
|
|
60
|
-
"@aws-sdk/client-cloudfront": "^3.
|
|
61
|
-
"@aws-sdk/client-cloudwatch-logs": "^3.
|
|
62
|
-
"@aws-sdk/client-ec2": "^3.
|
|
63
|
-
"@aws-sdk/client-efs": "^3.
|
|
64
|
-
"@aws-sdk/client-iam": "^3.
|
|
65
|
-
"@aws-sdk/client-lambda": "^3.
|
|
66
|
-
"@aws-sdk/client-route-53-domains": "^3.
|
|
67
|
-
"@aws-sdk/client-s3": "^3.
|
|
68
|
-
"@aws-sdk/client-ses": "^3.
|
|
69
|
-
"@aws-sdk/client-sesv2": "^3.
|
|
70
|
-
"@aws-sdk/client-ssm": "^3.
|
|
56
|
+
"@aws-sdk/client-bedrock": "^3.525.0",
|
|
57
|
+
"@aws-sdk/client-cloudformation": "^3.526.0",
|
|
58
|
+
"@aws-sdk/client-cloudfront": "^3.525.0",
|
|
59
|
+
"@aws-sdk/client-cloudwatch-logs": "^3.525.0",
|
|
60
|
+
"@aws-sdk/client-ec2": "^3.525.1",
|
|
61
|
+
"@aws-sdk/client-efs": "^3.525.0",
|
|
62
|
+
"@aws-sdk/client-iam": "^3.525.0",
|
|
63
|
+
"@aws-sdk/client-lambda": "^3.525.0",
|
|
64
|
+
"@aws-sdk/client-route-53-domains": "^3.525.0",
|
|
65
|
+
"@aws-sdk/client-s3": "^3.525.0",
|
|
66
|
+
"@aws-sdk/client-ses": "^3.525.0",
|
|
67
|
+
"@aws-sdk/client-sesv2": "^3.527.0",
|
|
68
|
+
"@aws-sdk/client-ssm": "^3.525.0",
|
|
69
|
+
"@stacksjs/cli": "latest",
|
|
71
70
|
"@stacksjs/config": "latest",
|
|
72
71
|
"@stacksjs/env": "latest",
|
|
73
72
|
"@stacksjs/logging": "latest",
|
|
@@ -79,20 +78,20 @@
|
|
|
79
78
|
"@stacksjs/validation": "latest"
|
|
80
79
|
},
|
|
81
80
|
"dependencies": {
|
|
82
|
-
"@aws-sdk/client-bedrock": "^3.
|
|
83
|
-
"@aws-sdk/client-cloudformation": "^3.
|
|
84
|
-
"@aws-sdk/client-cloudfront": "^3.
|
|
85
|
-
"@aws-sdk/client-cloudwatch-logs": "^3.
|
|
86
|
-
"@aws-sdk/client-dynamodb": "3.
|
|
87
|
-
"@aws-sdk/client-ec2": "^3.
|
|
88
|
-
"@aws-sdk/client-efs": "^3.
|
|
89
|
-
"@aws-sdk/client-iam": "^3.
|
|
90
|
-
"@aws-sdk/client-lambda": "^3.
|
|
91
|
-
"@aws-sdk/client-route-53-domains": "^3.
|
|
92
|
-
"@aws-sdk/client-s3": "^3.
|
|
93
|
-
"@aws-sdk/client-ses": "^3.
|
|
94
|
-
"@aws-sdk/client-sesv2": "^3.
|
|
95
|
-
"@aws-sdk/client-ssm": "^3.
|
|
81
|
+
"@aws-sdk/client-bedrock": "^3.525.0",
|
|
82
|
+
"@aws-sdk/client-cloudformation": "^3.526.0",
|
|
83
|
+
"@aws-sdk/client-cloudfront": "^3.525.0",
|
|
84
|
+
"@aws-sdk/client-cloudwatch-logs": "^3.525.0",
|
|
85
|
+
"@aws-sdk/client-dynamodb": "3.525.0",
|
|
86
|
+
"@aws-sdk/client-ec2": "^3.525.1",
|
|
87
|
+
"@aws-sdk/client-efs": "^3.525.0",
|
|
88
|
+
"@aws-sdk/client-iam": "^3.525.0",
|
|
89
|
+
"@aws-sdk/client-lambda": "^3.525.0",
|
|
90
|
+
"@aws-sdk/client-route-53-domains": "^3.525.0",
|
|
91
|
+
"@aws-sdk/client-s3": "^3.525.0",
|
|
92
|
+
"@aws-sdk/client-ses": "^3.525.0",
|
|
93
|
+
"@aws-sdk/client-sesv2": "^3.527.0",
|
|
94
|
+
"@aws-sdk/client-ssm": "^3.525.0",
|
|
96
95
|
"@stacksjs/config": "latest",
|
|
97
96
|
"@stacksjs/dns": "latest",
|
|
98
97
|
"@stacksjs/env": "latest",
|
|
@@ -102,18 +101,15 @@
|
|
|
102
101
|
"@stacksjs/storage": "latest",
|
|
103
102
|
"@stacksjs/utils": "latest",
|
|
104
103
|
"@stacksjs/validation": "latest",
|
|
105
|
-
"aws-cdk": "^2.
|
|
106
|
-
"aws-cdk-lib": "^2.
|
|
107
|
-
"aws4fetch": "^1.0.
|
|
104
|
+
"aws-cdk": "^2.131.0",
|
|
105
|
+
"aws-cdk-lib": "^2.131.0",
|
|
106
|
+
"aws4fetch": "^1.0.18",
|
|
108
107
|
"constructs": "^10.3.0"
|
|
109
108
|
},
|
|
110
109
|
"devDependencies": {
|
|
111
|
-
"@oclif/plugin-plugins": "^4.2.2",
|
|
112
110
|
"@stacksjs/cli": "latest",
|
|
113
111
|
"@stacksjs/development": "latest",
|
|
114
112
|
"@stacksjs/env": "latest",
|
|
115
|
-
"jszip": "^3.10.1",
|
|
116
|
-
"oclif": "^4.4.12",
|
|
117
113
|
"source-map-support": "^0.5.21"
|
|
118
114
|
}
|
|
119
115
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aws-sdk-layer",
|
|
3
|
-
"version": "0.58.
|
|
3
|
+
"version": "0.58.73",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "aws-sdk-layer",
|
|
9
|
-
"version": "0.58.
|
|
9
|
+
"version": "0.58.73",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"aws-sdk": "^2.
|
|
12
|
+
"aws-sdk": "^2.1571.0"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"node_modules/available-typed-arrays": {
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"node_modules/aws-sdk": {
|
|
27
|
-
"version": "2.
|
|
28
|
-
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.
|
|
29
|
-
"integrity": "sha512-
|
|
27
|
+
"version": "2.1571.0",
|
|
28
|
+
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1571.0.tgz",
|
|
29
|
+
"integrity": "sha512-Hixs1aD+7IwsP/Bkb7StFCrOC9ejmw8zBv8xVqEtEughRX6AF8bLKFRoJRbD4V6TrM+gPGpCqoFlpa84HLHkSA==",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"buffer": "4.9.2",
|
|
32
32
|
"events": "1.1.1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aws-sdk-layer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"aws-sdk": "^2.
|
|
13
|
+
"aws-sdk": "^2.1571.0"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stacks-router-layer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@stacksjs/router": "^0.58.
|
|
13
|
+
"@stacksjs/router": "^0.58.73"
|
|
14
14
|
}
|
|
15
15
|
}
|
package/src/helpers.ts
CHANGED
|
@@ -11,9 +11,9 @@ import { ContactType, Route53Domains } from '@aws-sdk/client-route-53-domains'
|
|
|
11
11
|
import { ListBucketsCommand, S3 } from '@aws-sdk/client-s3'
|
|
12
12
|
import { config } from '@stacksjs/config'
|
|
13
13
|
import { err, handleError, ok } from '@stacksjs/error-handling'
|
|
14
|
+
import { runCommand } from '@stacksjs/cli'
|
|
14
15
|
import { log } from '@stacksjs/logging'
|
|
15
16
|
import { path as p } from '@stacksjs/path'
|
|
16
|
-
import { rimraf } from '@stacksjs/utils'
|
|
17
17
|
import { slug } from '@stacksjs/strings'
|
|
18
18
|
|
|
19
19
|
const appEnv = config.app.env === 'local' ? 'dev' : config.app.env
|
|
@@ -387,10 +387,12 @@ export async function deleteParameterStore() {
|
|
|
387
387
|
|
|
388
388
|
export async function deleteCdkRemnants() {
|
|
389
389
|
try {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
390
|
+
// TODO: use $ once we can use CDK past Bun v1.0.8
|
|
391
|
+
return ok(
|
|
392
|
+
await runCommand(
|
|
393
|
+
`bunx rimraf ${p.cloudPath('cdk.out/')} ${p.cloudPath('cdk.context.json')}`,
|
|
394
|
+
),
|
|
395
|
+
)
|
|
394
396
|
}
|
|
395
397
|
catch (error) {
|
|
396
398
|
return err(handleError('Error deleting CDK remnants', error as Error))
|