@anvil-cloud/sdk 0.0.12 → 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.
package/aws/index.ts CHANGED
@@ -20,6 +20,16 @@ export type SvelteKitSite = import("./svelteKitSite").SvelteKitSite;
20
20
  export const SvelteKitSite: typeof import("./svelteKitSite").SvelteKitSite = null as any;
21
21
  utilities.lazyLoad(exports, ["SvelteKitSite"], () => require("./svelteKitSite"));
22
22
 
23
+ export { VpcArgs } from "./vpc";
24
+ export type Vpc = import("./vpc").Vpc;
25
+ export const Vpc: typeof import("./vpc").Vpc = null as any;
26
+ utilities.lazyLoad(exports, ["Vpc"], () => require("./vpc"));
27
+
28
+ export { VpcEndpointArgs } from "./vpcEndpoint";
29
+ export type VpcEndpoint = import("./vpcEndpoint").VpcEndpoint;
30
+ export const VpcEndpoint: typeof import("./vpcEndpoint").VpcEndpoint = null as any;
31
+ utilities.lazyLoad(exports, ["VpcEndpoint"], () => require("./vpcEndpoint"));
32
+
23
33
 
24
34
  // Export enums:
25
35
  export * from "../types/enums/aws";
@@ -34,6 +44,10 @@ const _module = {
34
44
  return new Lambda(name, <any>undefined, { urn })
35
45
  case "anvil:aws:SvelteKitSite":
36
46
  return new SvelteKitSite(name, <any>undefined, { urn })
47
+ case "anvil:aws:Vpc":
48
+ return new Vpc(name, <any>undefined, { urn })
49
+ case "anvil:aws:VpcEndpoint":
50
+ return new VpcEndpoint(name, <any>undefined, { urn })
37
51
  default:
38
52
  throw new Error(`unknown resource type ${type}`);
39
53
  }
package/aws/lambda.ts CHANGED
@@ -44,6 +44,10 @@ export class Lambda extends pulumi.ComponentResource {
44
44
  * The ARN of the Lambda's IAM execution role.
45
45
  */
46
46
  declare public /*out*/ readonly roleArn: pulumi.Output<string>;
47
+ /**
48
+ * The ID of the dedicated security group created for this Lambda. Only populated when vpc is set. Use this to grant other resources access to this Lambda via the grant system.
49
+ */
50
+ declare public /*out*/ readonly securityGroupId: pulumi.Output<string | undefined>;
47
51
 
48
52
  /**
49
53
  * Create a Lambda resource with the given unique name, arguments, and options.
@@ -80,11 +84,13 @@ export class Lambda extends pulumi.ComponentResource {
80
84
  resourceInputs["functionName"] = undefined /*out*/;
81
85
  resourceInputs["functionUrl"] = undefined /*out*/;
82
86
  resourceInputs["roleArn"] = undefined /*out*/;
87
+ resourceInputs["securityGroupId"] = undefined /*out*/;
83
88
  } else {
84
89
  resourceInputs["arn"] = undefined /*out*/;
85
90
  resourceInputs["functionName"] = undefined /*out*/;
86
91
  resourceInputs["functionUrl"] = undefined /*out*/;
87
92
  resourceInputs["roleArn"] = undefined /*out*/;
93
+ resourceInputs["securityGroupId"] = undefined /*out*/;
88
94
  }
89
95
  opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
90
96
  super(Lambda.__pulumiType, name, resourceInputs, opts, true /*remote*/);
@@ -169,7 +175,7 @@ export interface LambdaArgs {
169
175
  */
170
176
  url?: pulumi.Input<boolean>;
171
177
  /**
172
- * VPC ID to place the Lambda in for access to private resources (RDS, ElastiCache, etc.).
178
+ * Places the Lambda inside a VPC for access to private resources such as RDS or ElastiCache. Anvil creates a dedicated security group with zero inbound and zero outbound rules. Nothing is reachable until explicitly granted via the grant system.
173
179
  */
174
- vpc?: pulumi.Input<string>;
180
+ vpc?: pulumi.Input<inputs.aws.LambdaVpcArgsArgs>;
175
181
  }
package/aws/vpc.ts ADDED
@@ -0,0 +1,159 @@
1
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
2
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
+
4
+ import * as pulumi from "@pulumi/pulumi";
5
+ import * as inputs from "../types/input";
6
+ import * as outputs from "../types/output";
7
+ import * as enums from "../types/enums";
8
+ import * as utilities from "../utilities";
9
+
10
+ export class Vpc extends pulumi.ComponentResource {
11
+ /** @internal */
12
+ public static readonly __pulumiType = 'anvil:aws:Vpc';
13
+
14
+ /**
15
+ * Returns true if the given object is an instance of Vpc. This is designed to work even
16
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
17
+ */
18
+ public static isInstance(obj: any): obj is Vpc {
19
+ if (obj === undefined || obj === null) {
20
+ return false;
21
+ }
22
+ return obj['__pulumiType'] === Vpc.__pulumiType;
23
+ }
24
+
25
+ /**
26
+ * The resolved Availability Zone names, e.g. ['ap-southeast-2a']. Consumed by RDS Multi-AZ, ECS spread, and other downstream components.
27
+ */
28
+ declare public readonly availabilityZones: pulumi.Output<string[]>;
29
+ /**
30
+ * The EC2 instance ID of the bastion host. Use with: aws ssm start-session --target <bastionInstanceId>. Only populated when bastion is enabled.
31
+ */
32
+ declare public /*out*/ readonly bastionInstanceId: pulumi.Output<string | undefined>;
33
+ /**
34
+ * The security group ID of the bastion host. Use to grant the bastion access to private resources, e.g. db.grant(network.bastion, { access: 'readWrite' }). Only populated when bastion is enabled.
35
+ */
36
+ declare public /*out*/ readonly bastionSecurityGroupId: pulumi.Output<string | undefined>;
37
+ /**
38
+ * The ID of the VPC default security group. All rules removed — not used by Anvil components.
39
+ */
40
+ declare public /*out*/ readonly defaultSecurityGroupId: pulumi.Output<string>;
41
+ /**
42
+ * The IDs of the private subnets, one per AZ. Used by Lambda, ECS tasks, EC2, and RDS.
43
+ */
44
+ declare public /*out*/ readonly privateSubnetIds: pulumi.Output<string[]>;
45
+ /**
46
+ * The IDs of the public subnets, one per AZ. Used by load balancers, NAT Gateways, and the bastion host.
47
+ */
48
+ declare public /*out*/ readonly publicSubnetIds: pulumi.Output<string[]>;
49
+ /**
50
+ * The ID of the VPC.
51
+ */
52
+ declare public /*out*/ readonly vpcId: pulumi.Output<string>;
53
+
54
+ /**
55
+ * Create a Vpc resource with the given unique name, arguments, and options.
56
+ *
57
+ * @param name The _unique_ name of the resource.
58
+ * @param args The arguments to use to populate this resource's properties.
59
+ * @param opts A bag of options that control this resource's behavior.
60
+ */
61
+ constructor(name: string, args?: VpcArgs, opts?: pulumi.ComponentResourceOptions) {
62
+ let resourceInputs: pulumi.Inputs = {};
63
+ opts = opts || {};
64
+ if (!opts.id) {
65
+ resourceInputs["availabilityZones"] = args?.availabilityZones;
66
+ resourceInputs["bastion"] = args?.bastion;
67
+ resourceInputs["cidr"] = args?.cidr;
68
+ resourceInputs["flowLogs"] = args?.flowLogs;
69
+ resourceInputs["nat"] = args?.nat;
70
+ resourceInputs["bastionInstanceId"] = undefined /*out*/;
71
+ resourceInputs["bastionSecurityGroupId"] = undefined /*out*/;
72
+ resourceInputs["defaultSecurityGroupId"] = undefined /*out*/;
73
+ resourceInputs["privateSubnetIds"] = undefined /*out*/;
74
+ resourceInputs["publicSubnetIds"] = undefined /*out*/;
75
+ resourceInputs["vpcId"] = undefined /*out*/;
76
+ } else {
77
+ resourceInputs["availabilityZones"] = undefined /*out*/;
78
+ resourceInputs["bastionInstanceId"] = undefined /*out*/;
79
+ resourceInputs["bastionSecurityGroupId"] = undefined /*out*/;
80
+ resourceInputs["defaultSecurityGroupId"] = undefined /*out*/;
81
+ resourceInputs["privateSubnetIds"] = undefined /*out*/;
82
+ resourceInputs["publicSubnetIds"] = undefined /*out*/;
83
+ resourceInputs["vpcId"] = undefined /*out*/;
84
+ }
85
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
86
+ super(Vpc.__pulumiType, name, resourceInputs, opts, true /*remote*/);
87
+ }
88
+ /**
89
+ * Imports an existing Vpc into Anvil without managing or modifying it.
90
+ * Returns an identical output shape to `new Vpc()`.
91
+ *
92
+ * Flow logs, NAT, and bastion are not available on an imported VPC.
93
+ *
94
+ * If subnet IDs are omitted, Anvil auto-discovers them by inspecting
95
+ * route tables. Provide IDs explicitly if auto-discovery fails.
96
+ *
97
+ * @example
98
+ * const network = Vpc.fromId("existing", {
99
+ * vpcId: "vpc-0abc123def456",
100
+ * });
101
+ */
102
+ static fromId(
103
+ name: string,
104
+ args: {
105
+ vpcId: string;
106
+ privateSubnetIds?: string[];
107
+ publicSubnetIds?: string[];
108
+ },
109
+ opts?: pulumi.ComponentResourceOptions
110
+ ): Vpc {
111
+ return new Vpc(name, args as any, {
112
+ ...opts,
113
+ id: args.vpcId,
114
+ });
115
+ }
116
+
117
+ }
118
+
119
+ /**
120
+ * The set of arguments for constructing a Vpc resource.
121
+ */
122
+ export interface VpcArgs {
123
+ /**
124
+ * Number of Availability Zones to deploy subnets into. Valid values: 1, 2, 3. Defaults to 1. Inherits from App.defaults.availability — 'high' maps to 3, 'low' maps to 1.
125
+ */
126
+ availabilityZones?: pulumi.Input<number>;
127
+ /**
128
+ * Optional SSM bastion host for private network access. No SSH, no port 22 — access via AWS SSM Session Manager only. Use to connect to RDS, ElastiCache, and other private resources locally.
129
+ */
130
+ bastion?: pulumi.Input<boolean | inputs.aws.VpcBastionArgsArgs>;
131
+ /**
132
+ * The IPv4 CIDR block for the VPC. Default: '10.0.0.0/16'. Public subnets carved from offset 0 (/24 each), private subnets from offset 10 (/24 each).
133
+ */
134
+ cidr?: pulumi.Input<string>;
135
+ /**
136
+ * Optional VPC Flow Log configuration. Opt-in only. Either or both destinations can be enabled simultaneously. CloudWatch for active debugging, S3 for long-term compliance retention.
137
+ */
138
+ flowLogs?: pulumi.Input<inputs.aws.VpcFlowLogsArgsArgs>;
139
+ /**
140
+ * Optional NAT configuration for outbound internet access from private subnets. Omit for a fully private VPC.
141
+ */
142
+ nat?: pulumi.Input<inputs.aws.VpcNatArgsArgs>;
143
+ }
144
+
145
+ /**
146
+ * Normalises the `bastion` shorthand so the Pulumi provider
147
+ * always receives an object, never a raw boolean.
148
+ *
149
+ * bastion: true // enable with all defaults
150
+ * bastion: {} // identical to true
151
+ * bastion: { ... } // enable with custom config
152
+ */
153
+ export function normaliseBastion(
154
+ val: boolean | inputs.aws.VpcBastionArgsArgs | undefined
155
+ ): inputs.aws.VpcBastionArgsArgs | undefined {
156
+ if (val === undefined || val === false) return undefined;
157
+ if (val === true) return {};
158
+ return val;
159
+ }
@@ -0,0 +1,93 @@
1
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
2
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
+
4
+ import * as pulumi from "@pulumi/pulumi";
5
+ import * as inputs from "../types/input";
6
+ import * as outputs from "../types/output";
7
+ import * as enums from "../types/enums";
8
+ import * as utilities from "../utilities";
9
+
10
+ /**
11
+ * 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.
12
+ */
13
+ export class VpcEndpoint extends pulumi.ComponentResource {
14
+ /** @internal */
15
+ public static readonly __pulumiType = 'anvil:aws:VpcEndpoint';
16
+
17
+ /**
18
+ * Returns true if the given object is an instance of VpcEndpoint. This is designed to work even
19
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
20
+ */
21
+ public static isInstance(obj: any): obj is VpcEndpoint {
22
+ if (obj === undefined || obj === null) {
23
+ return false;
24
+ }
25
+ return obj['__pulumiType'] === VpcEndpoint.__pulumiType;
26
+ }
27
+
28
+ /**
29
+ * 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.
30
+ */
31
+ declare public /*out*/ readonly dnsName: pulumi.Output<string>;
32
+ /**
33
+ * The ID of the VPC endpoint, e.g. vpce-0abc1234567890abc. Use this to reference the endpoint in IAM condition keys such as aws:SourceVpce.
34
+ */
35
+ declare public /*out*/ readonly endpointId: pulumi.Output<string>;
36
+ /**
37
+ * The ID of the dedicated security group attached to this endpoint. Zero rules by default. Ingress rules are added when compute resources call grantEndpointAccess.
38
+ */
39
+ declare public /*out*/ readonly securityGroupId: pulumi.Output<string>;
40
+
41
+ /**
42
+ * Create a VpcEndpoint resource with the given unique name, arguments, and options.
43
+ *
44
+ * @param name The _unique_ name of the resource.
45
+ * @param args The arguments to use to populate this resource's properties.
46
+ * @param opts A bag of options that control this resource's behavior.
47
+ */
48
+ constructor(name: string, args: VpcEndpointArgs, opts?: pulumi.ComponentResourceOptions) {
49
+ let resourceInputs: pulumi.Inputs = {};
50
+ opts = opts || {};
51
+ if (!opts.id) {
52
+ if (args?.privateSubnetIds === undefined && !opts.urn) {
53
+ throw new Error("Missing required property 'privateSubnetIds'");
54
+ }
55
+ if (args?.service === undefined && !opts.urn) {
56
+ throw new Error("Missing required property 'service'");
57
+ }
58
+ if (args?.vpcId === undefined && !opts.urn) {
59
+ throw new Error("Missing required property 'vpcId'");
60
+ }
61
+ resourceInputs["privateSubnetIds"] = args?.privateSubnetIds;
62
+ resourceInputs["service"] = args?.service;
63
+ resourceInputs["vpcId"] = args?.vpcId;
64
+ resourceInputs["dnsName"] = undefined /*out*/;
65
+ resourceInputs["endpointId"] = undefined /*out*/;
66
+ resourceInputs["securityGroupId"] = undefined /*out*/;
67
+ } else {
68
+ resourceInputs["dnsName"] = undefined /*out*/;
69
+ resourceInputs["endpointId"] = undefined /*out*/;
70
+ resourceInputs["securityGroupId"] = undefined /*out*/;
71
+ }
72
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
73
+ super(VpcEndpoint.__pulumiType, name, resourceInputs, opts, true /*remote*/);
74
+ }
75
+ }
76
+
77
+ /**
78
+ * The set of arguments for constructing a VpcEndpoint resource.
79
+ */
80
+ export interface VpcEndpointArgs {
81
+ /**
82
+ * 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.
83
+ */
84
+ privateSubnetIds: pulumi.Input<pulumi.Input<string>[]>;
85
+ /**
86
+ * 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.
87
+ */
88
+ service: pulumi.Input<enums.aws.AwsVpcEndpointService>;
89
+ /**
90
+ * The ID of the VPC to create the endpoint in. Accepts both Anvil-managed VPC IDs and imported VPC IDs.
91
+ */
92
+ vpcId: pulumi.Input<string>;
93
+ }
@@ -7,4 +7,10 @@ export declare const Lambda: typeof import("./lambda").Lambda;
7
7
  export { SvelteKitSiteArgs } from "./svelteKitSite";
8
8
  export type SvelteKitSite = import("./svelteKitSite").SvelteKitSite;
9
9
  export declare const SvelteKitSite: typeof import("./svelteKitSite").SvelteKitSite;
10
+ export { VpcArgs } from "./vpc";
11
+ export type Vpc = import("./vpc").Vpc;
12
+ export declare const Vpc: typeof import("./vpc").Vpc;
13
+ export { VpcEndpointArgs } from "./vpcEndpoint";
14
+ export type VpcEndpoint = import("./vpcEndpoint").VpcEndpoint;
15
+ export declare const VpcEndpoint: typeof import("./vpcEndpoint").VpcEndpoint;
10
16
  export * from "../types/enums/aws";
package/bin/aws/index.js CHANGED
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
17
  };
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.SvelteKitSite = exports.Lambda = exports.Bucket = void 0;
19
+ exports.VpcEndpoint = exports.Vpc = exports.SvelteKitSite = exports.Lambda = exports.Bucket = void 0;
20
20
  const pulumi = require("@pulumi/pulumi");
21
21
  const utilities = require("../utilities");
22
22
  exports.Bucket = null;
@@ -25,6 +25,10 @@ exports.Lambda = null;
25
25
  utilities.lazyLoad(exports, ["Lambda"], () => require("./lambda"));
26
26
  exports.SvelteKitSite = null;
27
27
  utilities.lazyLoad(exports, ["SvelteKitSite"], () => require("./svelteKitSite"));
28
+ exports.Vpc = null;
29
+ utilities.lazyLoad(exports, ["Vpc"], () => require("./vpc"));
30
+ exports.VpcEndpoint = null;
31
+ utilities.lazyLoad(exports, ["VpcEndpoint"], () => require("./vpcEndpoint"));
28
32
  // Export enums:
29
33
  __exportStar(require("../types/enums/aws"), exports);
30
34
  const _module = {
@@ -37,6 +41,10 @@ const _module = {
37
41
  return new exports.Lambda(name, undefined, { urn });
38
42
  case "anvil:aws:SvelteKitSite":
39
43
  return new exports.SvelteKitSite(name, undefined, { urn });
44
+ case "anvil:aws:Vpc":
45
+ return new exports.Vpc(name, undefined, { urn });
46
+ case "anvil:aws:VpcEndpoint":
47
+ return new exports.VpcEndpoint(name, undefined, { urn });
40
48
  default:
41
49
  throw new Error(`unknown resource type ${type}`);
42
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../aws/index.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;;;;;;;;;;;;;;;AAEjF,yCAAyC;AACzC,0CAA0C;AAK7B,QAAA,MAAM,GAAqC,IAAW,CAAC;AACpE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;AAItD,QAAA,MAAM,GAAqC,IAAW,CAAC;AACpE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;AAItD,QAAA,aAAa,GAAmD,IAAW,CAAC;AACzF,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAGjF,gBAAgB;AAChB,qDAAmC;AAEnC,MAAM,OAAO,GAAG;IACZ,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE;IAC/B,SAAS,EAAE,CAAC,IAAY,EAAE,IAAY,EAAE,GAAW,EAAmB,EAAE;QACpE,QAAQ,IAAI,EAAE;YACV,KAAK,kBAAkB;gBACnB,OAAO,IAAI,cAAM,CAAC,IAAI,EAAO,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;YACpD,KAAK,kBAAkB;gBACnB,OAAO,IAAI,cAAM,CAAC,IAAI,EAAO,SAAS,EAA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AAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC;AAG7E,gBAAgB;AAChB,qDAAmC;AAEnC,MAAM,OAAO,GAAG;IACZ,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE;IAC/B,SAAS,EAAE,CAAC,IAAY,EAAE,IAAY,EAAE,GAAW,EAAmB,EAAE;QACpE,QAAQ,IAAI,EAAE;YACV,KAAK,kBAAkB;gBACnB,OAAO,IAAI,cAAM,CAAC,IAAI,EAAO,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;YACpD,KAAK,kBAAkB;gBACnB,OAAO,IAAI,cAAM,CAAC,IAAI,EAAO,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;YACpD,KAAK,yBAAyB;gBAC1B,OAAO,IAAI,qBAAa,CAAC,IAAI,EAAO,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;YAC3D,KAAK,eAAe;gBAChB,OAAO,IAAI,WAAG,CAAC,IAAI,EAAO,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;YACjD,KAAK,uBAAuB;gBACxB,OAAO,IAAI,mBAAW,CAAC,IAAI,EAAO,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;YACzD;gBACI,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC;SACxD;IACL,CAAC;CACJ,CAAC;AACF,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA"}
@@ -24,6 +24,10 @@ export declare class Lambda extends pulumi.ComponentResource {
24
24
  * The ARN of the Lambda's IAM execution role.
25
25
  */
26
26
  readonly roleArn: pulumi.Output<string>;
27
+ /**
28
+ * The ID of the dedicated security group created for this Lambda. Only populated when vpc is set. Use this to grant other resources access to this Lambda via the grant system.
29
+ */
30
+ readonly securityGroupId: pulumi.Output<string | undefined>;
27
31
  /**
28
32
  * Create a Lambda resource with the given unique name, arguments, and options.
29
33
  *
@@ -101,7 +105,7 @@ export interface LambdaArgs {
101
105
  */
102
106
  url?: pulumi.Input<boolean>;
103
107
  /**
104
- * VPC ID to place the Lambda in for access to private resources (RDS, ElastiCache, etc.).
108
+ * Places the Lambda inside a VPC for access to private resources such as RDS or ElastiCache. Anvil creates a dedicated security group with zero inbound and zero outbound rules. Nothing is reachable until explicitly granted via the grant system.
105
109
  */
106
- vpc?: pulumi.Input<string>;
110
+ vpc?: pulumi.Input<inputs.aws.LambdaVpcArgsArgs>;
107
111
  }
package/bin/aws/lambda.js CHANGED
@@ -52,12 +52,14 @@ class Lambda extends pulumi.ComponentResource {
52
52
  resourceInputs["functionName"] = undefined /*out*/;
53
53
  resourceInputs["functionUrl"] = undefined /*out*/;
54
54
  resourceInputs["roleArn"] = undefined /*out*/;
55
+ resourceInputs["securityGroupId"] = undefined /*out*/;
55
56
  }
56
57
  else {
57
58
  resourceInputs["arn"] = undefined /*out*/;
58
59
  resourceInputs["functionName"] = undefined /*out*/;
59
60
  resourceInputs["functionUrl"] = undefined /*out*/;
60
61
  resourceInputs["roleArn"] = undefined /*out*/;
62
+ resourceInputs["securityGroupId"] = undefined /*out*/;
61
63
  }
62
64
  opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
63
65
  super(Lambda.__pulumiType, name, resourceInputs, opts, true /*remote*/);
@@ -1 +1 @@
1
- {"version":3,"file":"lambda.js","sourceRoot":"","sources":["../../aws/lambda.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AAIzC,0CAA0C;AAG1C,oCAAoC;AAEpC,MAAa,MAAO,SAAQ,MAAM,CAAC,iBAAiB;IAOhD;;;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,MAAM,CAAC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AG,SAAS,CAAC,OAAO,CAAC;YAC9C,cAAc,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;SACzD;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACxE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACI,WAAW,CAAC,MAA0B,EAAE,IAA0B;QACrE,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC;QAC3D,MAAM,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAC3D,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAClF,CAAC;IACD,kEAAkE;IAC3D,SAAS;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,mEAAmE;IAC5D,YAAY;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;;AA3GL,wBA6GC;AA5GG,gBAAgB;AACO,mBAAY,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,98 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ import * as inputs from "../types/input";
3
+ export declare class Vpc extends pulumi.ComponentResource {
4
+ /**
5
+ * Returns true if the given object is an instance of Vpc. This is designed to work even
6
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
7
+ */
8
+ static isInstance(obj: any): obj is Vpc;
9
+ /**
10
+ * The resolved Availability Zone names, e.g. ['ap-southeast-2a']. Consumed by RDS Multi-AZ, ECS spread, and other downstream components.
11
+ */
12
+ readonly availabilityZones: pulumi.Output<string[]>;
13
+ /**
14
+ * The EC2 instance ID of the bastion host. Use with: aws ssm start-session --target <bastionInstanceId>. Only populated when bastion is enabled.
15
+ */
16
+ readonly bastionInstanceId: pulumi.Output<string | undefined>;
17
+ /**
18
+ * The security group ID of the bastion host. Use to grant the bastion access to private resources, e.g. db.grant(network.bastion, { access: 'readWrite' }). Only populated when bastion is enabled.
19
+ */
20
+ readonly bastionSecurityGroupId: pulumi.Output<string | undefined>;
21
+ /**
22
+ * The ID of the VPC default security group. All rules removed — not used by Anvil components.
23
+ */
24
+ readonly defaultSecurityGroupId: pulumi.Output<string>;
25
+ /**
26
+ * The IDs of the private subnets, one per AZ. Used by Lambda, ECS tasks, EC2, and RDS.
27
+ */
28
+ readonly privateSubnetIds: pulumi.Output<string[]>;
29
+ /**
30
+ * The IDs of the public subnets, one per AZ. Used by load balancers, NAT Gateways, and the bastion host.
31
+ */
32
+ readonly publicSubnetIds: pulumi.Output<string[]>;
33
+ /**
34
+ * The ID of the VPC.
35
+ */
36
+ readonly vpcId: pulumi.Output<string>;
37
+ /**
38
+ * Create a Vpc resource with the given unique name, arguments, and options.
39
+ *
40
+ * @param name The _unique_ name of the resource.
41
+ * @param args The arguments to use to populate this resource's properties.
42
+ * @param opts A bag of options that control this resource's behavior.
43
+ */
44
+ constructor(name: string, args?: VpcArgs, opts?: pulumi.ComponentResourceOptions);
45
+ /**
46
+ * Imports an existing Vpc into Anvil without managing or modifying it.
47
+ * Returns an identical output shape to `new Vpc()`.
48
+ *
49
+ * Flow logs, NAT, and bastion are not available on an imported VPC.
50
+ *
51
+ * If subnet IDs are omitted, Anvil auto-discovers them by inspecting
52
+ * route tables. Provide IDs explicitly if auto-discovery fails.
53
+ *
54
+ * @example
55
+ * const network = Vpc.fromId("existing", {
56
+ * vpcId: "vpc-0abc123def456",
57
+ * });
58
+ */
59
+ static fromId(name: string, args: {
60
+ vpcId: string;
61
+ privateSubnetIds?: string[];
62
+ publicSubnetIds?: string[];
63
+ }, opts?: pulumi.ComponentResourceOptions): Vpc;
64
+ }
65
+ /**
66
+ * The set of arguments for constructing a Vpc resource.
67
+ */
68
+ export interface VpcArgs {
69
+ /**
70
+ * Number of Availability Zones to deploy subnets into. Valid values: 1, 2, 3. Defaults to 1. Inherits from App.defaults.availability — 'high' maps to 3, 'low' maps to 1.
71
+ */
72
+ availabilityZones?: pulumi.Input<number>;
73
+ /**
74
+ * Optional SSM bastion host for private network access. No SSH, no port 22 — access via AWS SSM Session Manager only. Use to connect to RDS, ElastiCache, and other private resources locally.
75
+ */
76
+ bastion?: pulumi.Input<boolean | inputs.aws.VpcBastionArgsArgs>;
77
+ /**
78
+ * The IPv4 CIDR block for the VPC. Default: '10.0.0.0/16'. Public subnets carved from offset 0 (/24 each), private subnets from offset 10 (/24 each).
79
+ */
80
+ cidr?: pulumi.Input<string>;
81
+ /**
82
+ * Optional VPC Flow Log configuration. Opt-in only. Either or both destinations can be enabled simultaneously. CloudWatch for active debugging, S3 for long-term compliance retention.
83
+ */
84
+ flowLogs?: pulumi.Input<inputs.aws.VpcFlowLogsArgsArgs>;
85
+ /**
86
+ * Optional NAT configuration for outbound internet access from private subnets. Omit for a fully private VPC.
87
+ */
88
+ nat?: pulumi.Input<inputs.aws.VpcNatArgsArgs>;
89
+ }
90
+ /**
91
+ * Normalises the `bastion` shorthand so the Pulumi provider
92
+ * always receives an object, never a raw boolean.
93
+ *
94
+ * bastion: true // enable with all defaults
95
+ * bastion: {} // identical to true
96
+ * bastion: { ... } // enable with custom config
97
+ */
98
+ export declare function normaliseBastion(val: boolean | inputs.aws.VpcBastionArgsArgs | undefined): inputs.aws.VpcBastionArgsArgs | undefined;
package/bin/aws/vpc.js ADDED
@@ -0,0 +1,94 @@
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.normaliseBastion = exports.Vpc = void 0;
6
+ const pulumi = require("@pulumi/pulumi");
7
+ const utilities = require("../utilities");
8
+ class Vpc extends pulumi.ComponentResource {
9
+ /**
10
+ * Returns true if the given object is an instance of Vpc. This is designed to work even
11
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
12
+ */
13
+ static isInstance(obj) {
14
+ if (obj === undefined || obj === null) {
15
+ return false;
16
+ }
17
+ return obj['__pulumiType'] === Vpc.__pulumiType;
18
+ }
19
+ /**
20
+ * Create a Vpc resource with the given unique name, arguments, and options.
21
+ *
22
+ * @param name The _unique_ name of the resource.
23
+ * @param args The arguments to use to populate this resource's properties.
24
+ * @param opts A bag of options that control this resource's behavior.
25
+ */
26
+ constructor(name, args, opts) {
27
+ let resourceInputs = {};
28
+ opts = opts || {};
29
+ if (!opts.id) {
30
+ resourceInputs["availabilityZones"] = args?.availabilityZones;
31
+ resourceInputs["bastion"] = args?.bastion;
32
+ resourceInputs["cidr"] = args?.cidr;
33
+ resourceInputs["flowLogs"] = args?.flowLogs;
34
+ resourceInputs["nat"] = args?.nat;
35
+ resourceInputs["bastionInstanceId"] = undefined /*out*/;
36
+ resourceInputs["bastionSecurityGroupId"] = undefined /*out*/;
37
+ resourceInputs["defaultSecurityGroupId"] = undefined /*out*/;
38
+ resourceInputs["privateSubnetIds"] = undefined /*out*/;
39
+ resourceInputs["publicSubnetIds"] = undefined /*out*/;
40
+ resourceInputs["vpcId"] = undefined /*out*/;
41
+ }
42
+ else {
43
+ resourceInputs["availabilityZones"] = undefined /*out*/;
44
+ resourceInputs["bastionInstanceId"] = undefined /*out*/;
45
+ resourceInputs["bastionSecurityGroupId"] = undefined /*out*/;
46
+ resourceInputs["defaultSecurityGroupId"] = undefined /*out*/;
47
+ resourceInputs["privateSubnetIds"] = undefined /*out*/;
48
+ resourceInputs["publicSubnetIds"] = undefined /*out*/;
49
+ resourceInputs["vpcId"] = undefined /*out*/;
50
+ }
51
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
52
+ super(Vpc.__pulumiType, name, resourceInputs, opts, true /*remote*/);
53
+ }
54
+ /**
55
+ * Imports an existing Vpc into Anvil without managing or modifying it.
56
+ * Returns an identical output shape to `new Vpc()`.
57
+ *
58
+ * Flow logs, NAT, and bastion are not available on an imported VPC.
59
+ *
60
+ * If subnet IDs are omitted, Anvil auto-discovers them by inspecting
61
+ * route tables. Provide IDs explicitly if auto-discovery fails.
62
+ *
63
+ * @example
64
+ * const network = Vpc.fromId("existing", {
65
+ * vpcId: "vpc-0abc123def456",
66
+ * });
67
+ */
68
+ static fromId(name, args, opts) {
69
+ return new Vpc(name, args, {
70
+ ...opts,
71
+ id: args.vpcId,
72
+ });
73
+ }
74
+ }
75
+ exports.Vpc = Vpc;
76
+ /** @internal */
77
+ Vpc.__pulumiType = 'anvil:aws:Vpc';
78
+ /**
79
+ * Normalises the `bastion` shorthand so the Pulumi provider
80
+ * always receives an object, never a raw boolean.
81
+ *
82
+ * bastion: true // enable with all defaults
83
+ * bastion: {} // identical to true
84
+ * bastion: { ... } // enable with custom config
85
+ */
86
+ function normaliseBastion(val) {
87
+ if (val === undefined || val === false)
88
+ return undefined;
89
+ if (val === true)
90
+ return {};
91
+ return val;
92
+ }
93
+ exports.normaliseBastion = normaliseBastion;
94
+ //# sourceMappingURL=vpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vpc.js","sourceRoot":"","sources":["../../aws/vpc.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AAIzC,0CAA0C;AAE1C,MAAa,GAAI,SAAQ,MAAM,CAAC,iBAAiB;IAI7C;;;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,GAAG,CAAC,YAAY,CAA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