@anvil-cloud/sdk 0.0.13 → 0.0.14

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.
@@ -0,0 +1,49 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ import * as enums from "../types/enums";
3
+ /**
4
+ * An Anvil-managed AWS Interface VPC Endpoint. Creates one ENI per private subnet with private DNS enabled — standard AWS service hostnames resolve to ENI IPs inside the VPC automatically. Includes a dedicated security group with zero rules by default. Use grantEndpointAccess on compute resources to open the network path. IAM permissions are managed separately via grantPermissions.
5
+ */
6
+ export declare class VpcEndpoint extends pulumi.ComponentResource {
7
+ /**
8
+ * Returns true if the given object is an instance of VpcEndpoint. This is designed to work even
9
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
10
+ */
11
+ static isInstance(obj: any): obj is VpcEndpoint;
12
+ /**
13
+ * The first DNS name assigned to the endpoint, e.g. vpce-xxx.ssm.ap-southeast-2.vpce.amazonaws.com. With private DNS enabled, normal consumers use the standard AWS SDK hostname — this is exposed for debugging and multi-VPC architectures only.
14
+ */
15
+ readonly dnsName: pulumi.Output<string>;
16
+ /**
17
+ * The ID of the VPC endpoint, e.g. vpce-0abc1234567890abc. Use this to reference the endpoint in IAM condition keys such as aws:SourceVpce.
18
+ */
19
+ readonly endpointId: pulumi.Output<string>;
20
+ /**
21
+ * The ID of the dedicated security group attached to this endpoint. Zero rules by default. Ingress rules are added when compute resources call grantEndpointAccess.
22
+ */
23
+ readonly securityGroupId: pulumi.Output<string>;
24
+ /**
25
+ * Create a VpcEndpoint resource with the given unique name, arguments, and options.
26
+ *
27
+ * @param name The _unique_ name of the resource.
28
+ * @param args The arguments to use to populate this resource's properties.
29
+ * @param opts A bag of options that control this resource's behavior.
30
+ */
31
+ constructor(name: string, args: VpcEndpointArgs, opts?: pulumi.ComponentResourceOptions);
32
+ }
33
+ /**
34
+ * The set of arguments for constructing a VpcEndpoint resource.
35
+ */
36
+ export interface VpcEndpointArgs {
37
+ /**
38
+ * The IDs of the private subnets to attach the endpoint to. AWS places one ENI per subnet. Pass all private subnet IDs from your VPC — typically one per AZ.
39
+ */
40
+ privateSubnetIds: pulumi.Input<pulumi.Input<string>[]>;
41
+ /**
42
+ * The AWS service to route privately. The full com.amazonaws.{region}.{service} name is constructed at deploy time from the resolved region — you never write it manually.
43
+ */
44
+ service: pulumi.Input<enums.aws.AwsVpcEndpointService>;
45
+ /**
46
+ * The ID of the VPC to create the endpoint in. Accepts both Anvil-managed VPC IDs and imported VPC IDs.
47
+ */
48
+ vpcId: pulumi.Input<string>;
49
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.VpcEndpoint = void 0;
6
+ const pulumi = require("@pulumi/pulumi");
7
+ const utilities = require("../utilities");
8
+ /**
9
+ * An Anvil-managed AWS Interface VPC Endpoint. Creates one ENI per private subnet with private DNS enabled — standard AWS service hostnames resolve to ENI IPs inside the VPC automatically. Includes a dedicated security group with zero rules by default. Use grantEndpointAccess on compute resources to open the network path. IAM permissions are managed separately via grantPermissions.
10
+ */
11
+ class VpcEndpoint extends pulumi.ComponentResource {
12
+ /**
13
+ * Returns true if the given object is an instance of VpcEndpoint. This is designed to work even
14
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
15
+ */
16
+ static isInstance(obj) {
17
+ if (obj === undefined || obj === null) {
18
+ return false;
19
+ }
20
+ return obj['__pulumiType'] === VpcEndpoint.__pulumiType;
21
+ }
22
+ /**
23
+ * Create a VpcEndpoint resource with the given unique name, arguments, and options.
24
+ *
25
+ * @param name The _unique_ name of the resource.
26
+ * @param args The arguments to use to populate this resource's properties.
27
+ * @param opts A bag of options that control this resource's behavior.
28
+ */
29
+ constructor(name, args, opts) {
30
+ let resourceInputs = {};
31
+ opts = opts || {};
32
+ if (!opts.id) {
33
+ if (args?.privateSubnetIds === undefined && !opts.urn) {
34
+ throw new Error("Missing required property 'privateSubnetIds'");
35
+ }
36
+ if (args?.service === undefined && !opts.urn) {
37
+ throw new Error("Missing required property 'service'");
38
+ }
39
+ if (args?.vpcId === undefined && !opts.urn) {
40
+ throw new Error("Missing required property 'vpcId'");
41
+ }
42
+ resourceInputs["privateSubnetIds"] = args?.privateSubnetIds;
43
+ resourceInputs["service"] = args?.service;
44
+ resourceInputs["vpcId"] = args?.vpcId;
45
+ resourceInputs["dnsName"] = undefined /*out*/;
46
+ resourceInputs["endpointId"] = undefined /*out*/;
47
+ resourceInputs["securityGroupId"] = undefined /*out*/;
48
+ }
49
+ else {
50
+ resourceInputs["dnsName"] = undefined /*out*/;
51
+ resourceInputs["endpointId"] = undefined /*out*/;
52
+ resourceInputs["securityGroupId"] = undefined /*out*/;
53
+ }
54
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
55
+ super(VpcEndpoint.__pulumiType, name, resourceInputs, opts, true /*remote*/);
56
+ }
57
+ }
58
+ exports.VpcEndpoint = VpcEndpoint;
59
+ /** @internal */
60
+ VpcEndpoint.__pulumiType = 'anvil:aws:VpcEndpoint';
61
+ //# sourceMappingURL=vpcEndpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vpcEndpoint.js","sourceRoot":"","sources":["../../aws/vpcEndpoint.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AAIzC,0CAA0C;AAE1C;;GAEG;AACH,MAAa,WAAY,SAAQ,MAAM,CAAC,iBAAiB;IAIrD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,WAAW,CAAC,YAAY,CAAC;IAC5D,CAAC;IAeD;;;;;;OAM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,CAAC;QACnE,KAAK,CAAC,WAAW,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACjF,CAAC;;AA7DL,kCA8DC;AA7DG,gBAAgB;AACO,wBAAY,GAAG,uBAAuB,CAAC"}
package/bin/grants.d.ts CHANGED
@@ -4,22 +4,12 @@ import * as pulumi from '@pulumi/pulumi';
4
4
  * Compute resources (Lambda, SvelteKitSite, etc.) satisfy this interface.
5
5
  */
6
6
  export interface GrantTarget {
7
- /**
8
- * The logical resource name passed to the constructor.
9
- */
10
7
  grantName(): string;
11
- /**
12
- * The ARN of the IAM execution role attached to this compute resource.
13
- */
14
8
  grantRoleArn(): pulumi.Output<string>;
15
9
  }
16
10
  /**
17
11
  * Optional metadata for grant methods.
18
12
  */
19
13
  export interface GrantOptions {
20
- /**
21
- * Documents why this grant is needed.
22
- * Stored as a tag on the generated IAM policy resource for audit purposes.
23
- */
24
14
  justification?: string;
25
15
  }
package/bin/grants.js CHANGED
@@ -12,8 +12,6 @@ const aws = require("@pulumi/aws");
12
12
  * Creates a scoped IAM RolePolicy granting the specified actions on the
13
13
  * specified resource ARNs to the target's execution role.
14
14
  *
15
- * This is the core engine that all resource-specific grant methods delegate to.
16
- *
17
15
  * @internal
18
16
  */
19
17
  function createGrant(parent, name, target, actions, resourceArns, opts) {
@@ -27,13 +25,10 @@ function createGrant(parent, name, target, actions, resourceArns, opts) {
27
25
  },
28
26
  ],
29
27
  }));
30
- // Extract role name from ARN (everything after the last "/")
31
28
  const roleName = target.grantRoleArn().apply((arn) => {
32
29
  const idx = arn.lastIndexOf('/');
33
30
  return idx >= 0 ? arn.substring(idx + 1) : arn;
34
31
  });
35
- // Justification is stored in the resource name suffix for audit trail.
36
- // Future: compliance audit trail (Pro tier) will capture this metadata separately.
37
32
  const policyName = opts?.justification
38
33
  ? `${name}-${sanitize(opts.justification)}`
39
34
  : name;
@@ -43,7 +38,7 @@ function createGrant(parent, name, target, actions, resourceArns, opts) {
43
38
  }, { parent });
44
39
  }
45
40
  exports.createGrant = createGrant;
46
- /** @internal Sanitize a string for use in resource names. */
41
+ /** @internal */
47
42
  function sanitize(s) {
48
43
  return s
49
44
  .toLowerCase()
@@ -52,10 +47,6 @@ function sanitize(s) {
52
47
  }
53
48
  /**
54
49
  * Builds the list of ARNs for a grant based on a base ARN and optional path scoping.
55
- *
56
- * - No paths: grants access to the entire resource (baseArn + baseArn/*)
57
- * - With paths: grants access to baseArn (for list operations) + each scoped path
58
- *
59
50
  * @internal
60
51
  */
61
52
  function buildResourceArns(baseArn, paths) {
package/bin/grants.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"grants.js","sourceRoot":"","sources":["../grants.ts"],"names":[],"mappings":";AAAA,uBAAuB;AACvB,4EAA4E;AAC5E,EAAE;AACF,uEAAuE;AACvE,+EAA+E;;;AAE/E,yCAAyC;AACzC,mCAAmC;AA6BnC;;;;;;;GAOG;AACH,SAAgB,WAAW,CACzB,MAAuB,EACvB,IAAY,EACZ,MAAmB,EACnB,OAAiB,EACjB,YAAqC,EACrC,IAAmB;IAEnB,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAC7D,IAAI,CAAC,SAAS,CAAC;QACb,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE;YACT;gBACE,MAAM,EAAE,OAAO;gBACf,MAAM,EAAE,OAAO;gBACf,QAAQ,EAAE,IAAI;aACf;SACF;KACF,CAAC,CACH,CAAC;IAEF,6DAA6D;IAC7D,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnD,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG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AAC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAC/B,OAA8B,EAC9B,KAAgB;IAEhB,MAAM,IAAI,GAA4B,CAAC,OAAO,CAAC,CAAC;IAEhD,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QAChC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAA,GAAG,OAAO,IAAI,CAAC,CAAC;KAC7C;SAAM;QACL,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE;YACrB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAA,GAAG,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;SAChD;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAfD,8CAeC"}
package/bin/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvil-cloud/sdk",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "scripts": {
5
5
  "build": "tsc && cp package.json bin/"
6
6
  },
@@ -1,3 +1,61 @@
1
+ export declare const AwsVpcEndpointService: {
2
+ /**
3
+ * AWS Systems Manager. Required alongside ssmmessages and ec2messages for full SSM functionality including Session Manager and Run Command.
4
+ */
5
+ readonly Ssm: "ssm";
6
+ /**
7
+ * SSM Session Manager messaging. Required alongside ssm and ec2messages.
8
+ */
9
+ readonly Ssmmessages: "ssmmessages";
10
+ /**
11
+ * SSM Run Command messaging. Required alongside ssm and ssmmessages.
12
+ */
13
+ readonly Ec2messages: "ec2messages";
14
+ /**
15
+ * AWS Secrets Manager. Allows compute resources to call GetSecretValue and other Secrets Manager APIs without traversing the public internet.
16
+ */
17
+ readonly Secretsmanager: "secretsmanager";
18
+ /**
19
+ * ECR control plane — authentication, image manifests, and repository metadata. Required alongside ecr.dkr for private image pulls.
20
+ */
21
+ readonly Ecr_api: "ecr.api";
22
+ /**
23
+ * ECR data plane — image layer pulls. Required alongside ecr.api for private image pulls.
24
+ */
25
+ readonly Ecr_dkr: "ecr.dkr";
26
+ /**
27
+ * Amazon Simple Queue Service. Covers all SQS operations including SendMessage, ReceiveMessage, and DeleteMessage — all are client-initiated HTTPS, one endpoint covers all operations.
28
+ */
29
+ readonly Sqs: "sqs";
30
+ /**
31
+ * Amazon Simple Notification Service. Allows compute resources to publish to SNS topics without traversing the public internet.
32
+ */
33
+ readonly Sns: "sns";
34
+ /**
35
+ * AWS Lambda invoke. Allows private invocation of Lambda functions from within the VPC.
36
+ */
37
+ readonly Lambda: "lambda";
38
+ /**
39
+ * Amazon CloudWatch Logs. Required for compute resources in private subnets to ship logs to CloudWatch without a NAT Gateway.
40
+ */
41
+ readonly Logs: "logs";
42
+ /**
43
+ * Amazon CloudWatch Metrics. Required for compute resources in private subnets to publish custom metrics without a NAT Gateway.
44
+ */
45
+ readonly Monitoring: "monitoring";
46
+ /**
47
+ * AWS Key Management Service. Required for compute resources that perform envelope encryption, use KMS-managed secrets, or interact with services that call KMS on their behalf.
48
+ */
49
+ readonly Kms: "kms";
50
+ /**
51
+ * AWS Security Token Service. Required for IAM role assumption and temporary credential generation within private subnets.
52
+ */
53
+ readonly Sts: "sts";
54
+ };
55
+ /**
56
+ * The AWS service to route privately via an Interface VPC Endpoint. Each value maps to the com.amazonaws.{region}.{suffix} endpoint service name.
57
+ */
58
+ export type AwsVpcEndpointService = (typeof AwsVpcEndpointService)[keyof typeof AwsVpcEndpointService];
1
59
  export declare const LambdaArchitecture: {
2
60
  /**
3
61
  * Graviton — 20% cheaper, better performance. Default.
@@ -51,3 +109,21 @@ export declare const LambdaRuntime: {
51
109
  readonly Nodejs22_x: "nodejs22.x";
52
110
  };
53
111
  export type LambdaRuntime = (typeof LambdaRuntime)[keyof typeof LambdaRuntime];
112
+ export declare const S3FlowLogLifecycle: {
113
+ /**
114
+ * Auto-tiered: Standard (0-30d) → Standard-IA (30-90d) → Glacier Instant Retrieval (90d+). Suitable for compliance retention at minimal long-term cost.
115
+ */
116
+ readonly Standard: "standard";
117
+ };
118
+ export type S3FlowLogLifecycle = (typeof S3FlowLogLifecycle)[keyof typeof S3FlowLogLifecycle];
119
+ export declare const VpcNatType: {
120
+ /**
121
+ * AWS managed NAT Gateway. One per AZ for true HA. ~$32/month per AZ plus $0.045/GB data processed.
122
+ */
123
+ readonly Gateway: "gateway";
124
+ /**
125
+ * fck-nat EC2 instance. Single instance regardless of AZ count. ~$4-6/month for t4g.small. Accepted single point of failure tradeoff for cost savings.
126
+ */
127
+ readonly Fck_nat: "fck-nat";
128
+ };
129
+ export type VpcNatType = (typeof VpcNatType)[keyof typeof VpcNatType];
@@ -2,7 +2,61 @@
2
2
  // *** WARNING: this file was generated by pulumi-language-nodejs. ***
3
3
  // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.LambdaRuntime = exports.LambdaLogRetention = exports.LambdaArchitecture = void 0;
5
+ exports.VpcNatType = exports.S3FlowLogLifecycle = exports.LambdaRuntime = exports.LambdaLogRetention = exports.LambdaArchitecture = exports.AwsVpcEndpointService = void 0;
6
+ exports.AwsVpcEndpointService = {
7
+ /**
8
+ * AWS Systems Manager. Required alongside ssmmessages and ec2messages for full SSM functionality including Session Manager and Run Command.
9
+ */
10
+ Ssm: "ssm",
11
+ /**
12
+ * SSM Session Manager messaging. Required alongside ssm and ec2messages.
13
+ */
14
+ Ssmmessages: "ssmmessages",
15
+ /**
16
+ * SSM Run Command messaging. Required alongside ssm and ssmmessages.
17
+ */
18
+ Ec2messages: "ec2messages",
19
+ /**
20
+ * AWS Secrets Manager. Allows compute resources to call GetSecretValue and other Secrets Manager APIs without traversing the public internet.
21
+ */
22
+ Secretsmanager: "secretsmanager",
23
+ /**
24
+ * ECR control plane — authentication, image manifests, and repository metadata. Required alongside ecr.dkr for private image pulls.
25
+ */
26
+ Ecr_api: "ecr.api",
27
+ /**
28
+ * ECR data plane — image layer pulls. Required alongside ecr.api for private image pulls.
29
+ */
30
+ Ecr_dkr: "ecr.dkr",
31
+ /**
32
+ * Amazon Simple Queue Service. Covers all SQS operations including SendMessage, ReceiveMessage, and DeleteMessage — all are client-initiated HTTPS, one endpoint covers all operations.
33
+ */
34
+ Sqs: "sqs",
35
+ /**
36
+ * Amazon Simple Notification Service. Allows compute resources to publish to SNS topics without traversing the public internet.
37
+ */
38
+ Sns: "sns",
39
+ /**
40
+ * AWS Lambda invoke. Allows private invocation of Lambda functions from within the VPC.
41
+ */
42
+ Lambda: "lambda",
43
+ /**
44
+ * Amazon CloudWatch Logs. Required for compute resources in private subnets to ship logs to CloudWatch without a NAT Gateway.
45
+ */
46
+ Logs: "logs",
47
+ /**
48
+ * Amazon CloudWatch Metrics. Required for compute resources in private subnets to publish custom metrics without a NAT Gateway.
49
+ */
50
+ Monitoring: "monitoring",
51
+ /**
52
+ * AWS Key Management Service. Required for compute resources that perform envelope encryption, use KMS-managed secrets, or interact with services that call KMS on their behalf.
53
+ */
54
+ Kms: "kms",
55
+ /**
56
+ * AWS Security Token Service. Required for IAM role assumption and temporary credential generation within private subnets.
57
+ */
58
+ Sts: "sts",
59
+ };
6
60
  exports.LambdaArchitecture = {
7
61
  /**
8
62
  * Graviton — 20% cheaper, better performance. Default.
@@ -53,4 +107,20 @@ exports.LambdaRuntime = {
53
107
  */
54
108
  Nodejs22_x: "nodejs22.x",
55
109
  };
110
+ exports.S3FlowLogLifecycle = {
111
+ /**
112
+ * Auto-tiered: Standard (0-30d) → Standard-IA (30-90d) → Glacier Instant Retrieval (90d+). Suitable for compliance retention at minimal long-term cost.
113
+ */
114
+ Standard: "standard",
115
+ };
116
+ exports.VpcNatType = {
117
+ /**
118
+ * AWS managed NAT Gateway. One per AZ for true HA. ~$32/month per AZ plus $0.045/GB data processed.
119
+ */
120
+ Gateway: "gateway",
121
+ /**
122
+ * fck-nat EC2 instance. Single instance regardless of AZ count. ~$4-6/month for t4g.small. Accepted single point of failure tradeoff for cost savings.
123
+ */
124
+ Fck_nat: "fck-nat",
125
+ };
56
126
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../types/enums/aws/index.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAGpE,QAAA,kBAAkB,GAAG;IAC9B;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;OAEG;IACH,MAAM,EAAE,QAAQ;CACV,CAAC;AAIE,QAAA,kBAAkB,GAAG;IAC9B;;OAEG;IACH,qBAAqB,EAAE,IAAI;IAC3B;;OAEG;IACH,sBAAsB,EAAE,KAAK;IAC7B;;OAEG;IACH,sBAAsB,EAAE,KAAK;IAC7B;;OAEG;IACH,qBAAqB,EAAE,IAAI;IAC3B;;OAEG;IACH,qBAAqB,EAAE,IAAI;IAC3B;;OAEG;IACH,qBAAqB,EAAE,IAAI;IAC3B;;OAEG;IACH,qBAAqB,EAAE,IAAI;CACrB,CAAC;AAIE,QAAA,aAAa,GAAG;IACzB;;OAEG;IACH,UAAU,EAAE,YAAY;IACxB;;OAEG;IACH,UAAU,EAAE,YAAY;CAClB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../types/enums/aws/index.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAGpE,QAAA,qBAAqB,GAAG;IACjC;;OAEG;IACH,GAAG,EAAE,KAAK;IACV;;OAEG;IACH,WAAW,EAAE,aAAa;IAC1B;;OAEG;IACH,WAAW,EAAE,aAAa;IAC1B;;OAEG;IACH,cAAc,EAAE,gBAAgB;IAChC;;OAEG;IACH,OAAO,EAAE,SAAS;IAClB;;OAEG;IACH,OAAO,EAAE,SAAS;IAClB;;OAEG;IACH,GAAG,EAAE,KAAK;IACV;;OAEG;IACH,GAAG,EAAE,KAAK;IACV;;OAEG;IACH,MAAM,EAAE,QAAQ;IAChB;;OAEG;IACH,IAAI,EAAE,MAAM;IACZ;;OAEG;IACH,UAAU,EAAE,YAAY;IACxB;;OAEG;IACH,GAAG,EAAE,KAAK;IACV;;OAEG;IACH,GAAG,EAAE,KAAK;CACJ,CAAC;AAOE,QAAA,kBAAkB,GAAG;IAC9B;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;OAEG;IACH,MAAM,EAAE,QAAQ;CACV,CAAC;AAIE,QAAA,kBAAkB,GAAG;IAC9B;;OAEG;IACH,qBAAqB,EAAE,IAAI;IAC3B;;OAEG;IACH,sBAAsB,EAAE,KAAK;IAC7B;;OAEG;IACH,sBAAsB,EAAE,KAAK;IAC7B;;OAEG;IACH,qBAAqB,EAAE,IAAI;IAC3B;;OAEG;IACH,qBAAqB,EAAE,IAAI;IAC3B;;OAEG;IACH,qBAAqB,EAAE,IAAI;IAC3B;;OAEG;IACH,qBAAqB,EAAE,IAAI;CACrB,CAAC;AAIE,QAAA,aAAa,GAAG;IACzB;;OAEG;IACH,UAAU,EAAE,YAAY;IACxB;;OAEG;IACH,UAAU,EAAE,YAAY;CAClB,CAAC;AAIE,QAAA,kBAAkB,GAAG;IAC9B;;OAEG;IACH,QAAQ,EAAE,UAAU;CACd,CAAC;AAIE,QAAA,UAAU,GAAG;IACtB;;OAEG;IACH,OAAO,EAAE,SAAS;IAClB;;OAEG;IACH,OAAO,EAAE,SAAS;CACZ,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import * as pulumi from "@pulumi/pulumi";
2
2
  import * as inputs from "../types/input";
3
+ import * as enums from "../types/enums";
3
4
  import * as pulumiAws from "@pulumi/aws";
4
5
  import * as pulumiGcp from "@pulumi/gcp";
5
6
  export declare namespace aws {
@@ -522,6 +523,51 @@ export declare namespace aws {
522
523
  interface LambdaTransformArgsArgs {
523
524
  lambda?: pulumi.Input<inputs.aws.LambdaOverridesArgs>;
524
525
  }
526
+ interface LambdaVpcArgsArgs {
527
+ /**
528
+ * CIDR-scoped egress rules. One SG rule per port per CIDR. Use for peered VPCs or on-premise ranges.
529
+ */
530
+ cidrs?: pulumi.Input<pulumi.Input<inputs.aws.LambdaVpcCidrArgsArgs>[]>;
531
+ /**
532
+ * Only needed for imported VPCs with NAT. Omit when using an Anvil Vpc component.
533
+ */
534
+ hasNat?: pulumi.Input<boolean>;
535
+ /**
536
+ * The IDs of the private subnets to attach the Lambda to. Always private — Lambda must never be placed in public subnets.
537
+ */
538
+ privateSubnetIds: pulumi.Input<pulumi.Input<string>[]>;
539
+ /**
540
+ * VPC endpoints this Lambda needs access to. Anvil wires both SG rules automatically.
541
+ */
542
+ vpcEndpoints?: pulumi.Input<pulumi.Input<inputs.aws.LambdaVpcEndpointArgsArgs>[]>;
543
+ /**
544
+ * The ID of the VPC to place the Lambda in.
545
+ */
546
+ vpcId: pulumi.Input<string>;
547
+ }
548
+ interface LambdaVpcCidrArgsArgs {
549
+ /**
550
+ * TCP ports to allow. Required — be explicit.
551
+ */
552
+ ports: pulumi.Input<pulumi.Input<number>[]>;
553
+ /**
554
+ * IPv4 CIDR block, e.g. 10.0.0.0/8
555
+ */
556
+ range: pulumi.Input<string>;
557
+ }
558
+ /**
559
+ * A VPC endpoint to grant this Lambda access to.
560
+ */
561
+ interface LambdaVpcEndpointArgsArgs {
562
+ /**
563
+ * The endpoint's ID. Use ep.endpointId. Used for SG rule naming.
564
+ */
565
+ endpointId: pulumi.Input<string>;
566
+ /**
567
+ * The endpoint's security group ID. Use ep.securityGroupId.
568
+ */
569
+ securityGroupId: pulumi.Input<string>;
570
+ }
525
571
  interface PABTransformArgs {
526
572
  /**
527
573
  * Whether Amazon S3 should block public ACLs for this bucket. Defaults to <span pulumi-lang-nodejs="`false`" pulumi-lang-dotnet="`False`" pulumi-lang-go="`false`" pulumi-lang-python="`false`" pulumi-lang-yaml="`false`" pulumi-lang-java="`false`">`false`</span>. Enabling this setting does not affect existing policies or ACLs. When set to <span pulumi-lang-nodejs="`true`" pulumi-lang-dotnet="`True`" pulumi-lang-go="`true`" pulumi-lang-python="`true`" pulumi-lang-yaml="`true`" pulumi-lang-java="`true`">`true`</span> causes the following behavior:
@@ -557,6 +603,48 @@ export declare namespace aws {
557
603
  */
558
604
  skipDestroy?: pulumi.Input<boolean>;
559
605
  }
606
+ interface VpcBastionArgsArgs {
607
+ /**
608
+ * Source IP CIDRs allowed to initiate SSM sessions via IAM policy condition. Omit to allow any authenticated IAM principal. Example: ['203.0.113.0/32'] to restrict to your office IP.
609
+ */
610
+ allowedCidrs?: pulumi.Input<pulumi.Input<string>[]>;
611
+ /**
612
+ * EC2 instance type for the bastion host. Default: 't4g.nano' — the bastion is purely a jump box with minimal resource requirements.
613
+ */
614
+ instanceType?: pulumi.Input<string>;
615
+ }
616
+ interface VpcCloudWatchFlowLogArgsArgs {
617
+ /**
618
+ * Number of days to retain flow log data in CloudWatch Logs. Common values: 7, 14, 30, 90.
619
+ */
620
+ retention: pulumi.Input<number>;
621
+ }
622
+ interface VpcFlowLogsArgsArgs {
623
+ /**
624
+ * Enable flow log delivery to a CloudWatch Log Group. Use for fast querying with CloudWatch Logs Insights and active debugging of connection issues.
625
+ */
626
+ cloudwatch?: pulumi.Input<inputs.aws.VpcCloudWatchFlowLogArgsArgs>;
627
+ /**
628
+ * Enable flow log delivery to a dedicated S3 bucket with auto-tiered lifecycle policy. Use for compliance retention and audit evidence.
629
+ */
630
+ s3?: pulumi.Input<inputs.aws.VpcS3FlowLogArgsArgs>;
631
+ }
632
+ interface VpcNatArgsArgs {
633
+ /**
634
+ * EC2 instance type for the fck-nat instance. Only applies when natType is 'fck-nat'. Default: 't4g.small'.
635
+ */
636
+ instanceType?: pulumi.Input<string>;
637
+ /**
638
+ * Type of NAT to provision. 'gateway' provisions one AWS managed NAT Gateway per AZ. 'fck-nat' provisions a single fck-nat EC2 instance shared across all AZs.
639
+ */
640
+ natType: pulumi.Input<enums.aws.VpcNatType>;
641
+ }
642
+ interface VpcS3FlowLogArgsArgs {
643
+ /**
644
+ * Storage tiering policy for flow log retention.
645
+ */
646
+ lifecycle: pulumi.Input<enums.aws.S3FlowLogLifecycle>;
647
+ }
560
648
  }
561
649
  export declare namespace gcp {
562
650
  interface BucketOverridesArgs {
package/grants.ts CHANGED
@@ -12,14 +12,7 @@ import * as aws from '@pulumi/aws';
12
12
  * Compute resources (Lambda, SvelteKitSite, etc.) satisfy this interface.
13
13
  */
14
14
  export interface GrantTarget {
15
- /**
16
- * The logical resource name passed to the constructor.
17
- */
18
15
  grantName(): string;
19
-
20
- /**
21
- * The ARN of the IAM execution role attached to this compute resource.
22
- */
23
16
  grantRoleArn(): pulumi.Output<string>;
24
17
  }
25
18
 
@@ -27,10 +20,6 @@ export interface GrantTarget {
27
20
  * Optional metadata for grant methods.
28
21
  */
29
22
  export interface GrantOptions {
30
- /**
31
- * Documents why this grant is needed.
32
- * Stored as a tag on the generated IAM policy resource for audit purposes.
33
- */
34
23
  justification?: string;
35
24
  }
36
25
 
@@ -38,8 +27,6 @@ export interface GrantOptions {
38
27
  * Creates a scoped IAM RolePolicy granting the specified actions on the
39
28
  * specified resource ARNs to the target's execution role.
40
29
  *
41
- * This is the core engine that all resource-specific grant methods delegate to.
42
- *
43
30
  * @internal
44
31
  */
45
32
  export function createGrant(
@@ -63,14 +50,11 @@ export function createGrant(
63
50
  })
64
51
  );
65
52
 
66
- // Extract role name from ARN (everything after the last "/")
67
53
  const roleName = target.grantRoleArn().apply((arn) => {
68
54
  const idx = arn.lastIndexOf('/');
69
55
  return idx >= 0 ? arn.substring(idx + 1) : arn;
70
56
  });
71
57
 
72
- // Justification is stored in the resource name suffix for audit trail.
73
- // Future: compliance audit trail (Pro tier) will capture this metadata separately.
74
58
  const policyName = opts?.justification
75
59
  ? `${name}-${sanitize(opts.justification)}`
76
60
  : name;
@@ -85,7 +69,7 @@ export function createGrant(
85
69
  );
86
70
  }
87
71
 
88
- /** @internal Sanitize a string for use in resource names. */
72
+ /** @internal */
89
73
  function sanitize(s: string): string {
90
74
  return s
91
75
  .toLowerCase()
@@ -95,10 +79,6 @@ function sanitize(s: string): string {
95
79
 
96
80
  /**
97
81
  * Builds the list of ARNs for a grant based on a base ARN and optional path scoping.
98
- *
99
- * - No paths: grants access to the entire resource (baseArn + baseArn/*)
100
- * - With paths: grants access to baseArn (for list operations) + each scoped path
101
- *
102
82
  * @internal
103
83
  */
104
84
  export function buildResourceArns(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvil-cloud/sdk",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "scripts": {
5
5
  "build": "tsc && cp package.json bin/"
6
6
  },
package/tsconfig.json CHANGED
@@ -17,6 +17,8 @@
17
17
  "aws/index.ts",
18
18
  "aws/lambda.ts",
19
19
  "aws/svelteKitSite.ts",
20
+ "aws/vpc.ts",
21
+ "aws/vpcEndpoint.ts",
20
22
  "gcp/function.ts",
21
23
  "gcp/index.ts",
22
24
  "gcp/storageBucket.ts",
@@ -2,6 +2,66 @@
2
2
  // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
3
 
4
4
 
5
+ export const AwsVpcEndpointService = {
6
+ /**
7
+ * AWS Systems Manager. Required alongside ssmmessages and ec2messages for full SSM functionality including Session Manager and Run Command.
8
+ */
9
+ Ssm: "ssm",
10
+ /**
11
+ * SSM Session Manager messaging. Required alongside ssm and ec2messages.
12
+ */
13
+ Ssmmessages: "ssmmessages",
14
+ /**
15
+ * SSM Run Command messaging. Required alongside ssm and ssmmessages.
16
+ */
17
+ Ec2messages: "ec2messages",
18
+ /**
19
+ * AWS Secrets Manager. Allows compute resources to call GetSecretValue and other Secrets Manager APIs without traversing the public internet.
20
+ */
21
+ Secretsmanager: "secretsmanager",
22
+ /**
23
+ * ECR control plane — authentication, image manifests, and repository metadata. Required alongside ecr.dkr for private image pulls.
24
+ */
25
+ Ecr_api: "ecr.api",
26
+ /**
27
+ * ECR data plane — image layer pulls. Required alongside ecr.api for private image pulls.
28
+ */
29
+ Ecr_dkr: "ecr.dkr",
30
+ /**
31
+ * Amazon Simple Queue Service. Covers all SQS operations including SendMessage, ReceiveMessage, and DeleteMessage — all are client-initiated HTTPS, one endpoint covers all operations.
32
+ */
33
+ Sqs: "sqs",
34
+ /**
35
+ * Amazon Simple Notification Service. Allows compute resources to publish to SNS topics without traversing the public internet.
36
+ */
37
+ Sns: "sns",
38
+ /**
39
+ * AWS Lambda invoke. Allows private invocation of Lambda functions from within the VPC.
40
+ */
41
+ Lambda: "lambda",
42
+ /**
43
+ * Amazon CloudWatch Logs. Required for compute resources in private subnets to ship logs to CloudWatch without a NAT Gateway.
44
+ */
45
+ Logs: "logs",
46
+ /**
47
+ * Amazon CloudWatch Metrics. Required for compute resources in private subnets to publish custom metrics without a NAT Gateway.
48
+ */
49
+ Monitoring: "monitoring",
50
+ /**
51
+ * AWS Key Management Service. Required for compute resources that perform envelope encryption, use KMS-managed secrets, or interact with services that call KMS on their behalf.
52
+ */
53
+ Kms: "kms",
54
+ /**
55
+ * AWS Security Token Service. Required for IAM role assumption and temporary credential generation within private subnets.
56
+ */
57
+ Sts: "sts",
58
+ } as const;
59
+
60
+ /**
61
+ * The AWS service to route privately via an Interface VPC Endpoint. Each value maps to the com.amazonaws.{region}.{suffix} endpoint service name.
62
+ */
63
+ export type AwsVpcEndpointService = (typeof AwsVpcEndpointService)[keyof typeof AwsVpcEndpointService];
64
+
5
65
  export const LambdaArchitecture = {
6
66
  /**
7
67
  * Graviton — 20% cheaper, better performance. Default.
@@ -60,3 +120,25 @@ export const LambdaRuntime = {
60
120
  } as const;
61
121
 
62
122
  export type LambdaRuntime = (typeof LambdaRuntime)[keyof typeof LambdaRuntime];
123
+
124
+ export const S3FlowLogLifecycle = {
125
+ /**
126
+ * Auto-tiered: Standard (0-30d) → Standard-IA (30-90d) → Glacier Instant Retrieval (90d+). Suitable for compliance retention at minimal long-term cost.
127
+ */
128
+ Standard: "standard",
129
+ } as const;
130
+
131
+ export type S3FlowLogLifecycle = (typeof S3FlowLogLifecycle)[keyof typeof S3FlowLogLifecycle];
132
+
133
+ export const VpcNatType = {
134
+ /**
135
+ * AWS managed NAT Gateway. One per AZ for true HA. ~$32/month per AZ plus $0.045/GB data processed.
136
+ */
137
+ Gateway: "gateway",
138
+ /**
139
+ * fck-nat EC2 instance. Single instance regardless of AZ count. ~$4-6/month for t4g.small. Accepted single point of failure tradeoff for cost savings.
140
+ */
141
+ Fck_nat: "fck-nat",
142
+ } as const;
143
+
144
+ export type VpcNatType = (typeof VpcNatType)[keyof typeof VpcNatType];