@appliance.sh/infra 1.12.0 → 1.13.0
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/package.json
CHANGED
|
@@ -36,7 +36,7 @@ export async function applianceInfra() {
|
|
|
36
36
|
const applianceBase = new baseController(
|
|
37
37
|
`${base}`,
|
|
38
38
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
-
{ config: baseConfig.data
|
|
39
|
+
{ config: baseConfig.data },
|
|
40
40
|
{
|
|
41
41
|
globalProvider: baseGlobalProvider,
|
|
42
42
|
provider: baseRegionalProvider,
|
|
@@ -2,10 +2,10 @@ import * as pulumi from '@pulumi/pulumi';
|
|
|
2
2
|
import * as aws from '@pulumi/aws';
|
|
3
3
|
import * as awsNative from '@pulumi/aws-native';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { ApplianceBaseConfigInput, ApplianceBaseType } from '@appliance.sh/sdk';
|
|
6
6
|
|
|
7
7
|
export type ApplianceBaseAwsPublicArgs = {
|
|
8
|
-
config:
|
|
8
|
+
config: ApplianceBaseConfigInput;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export interface ApplianceBaseAwsPublicOpts extends pulumi.ComponentResourceOptions {
|
|
@@ -21,9 +21,15 @@ export class ApplianceBaseAwsPublic extends pulumi.ComponentResource {
|
|
|
21
21
|
public readonly certificateArn?: pulumi.Output<string>;
|
|
22
22
|
public readonly cloudfrontDistribution?: aws.cloudfront.Distribution;
|
|
23
23
|
|
|
24
|
+
public readonly config;
|
|
25
|
+
|
|
24
26
|
constructor(name: string, args: ApplianceBaseAwsPublicArgs, opts?: ApplianceBaseAwsPublicOpts) {
|
|
25
27
|
super('appliance-infra:appliance-base-aws-public', name, args, opts);
|
|
26
28
|
|
|
29
|
+
if (args.config.type !== ApplianceBaseType.ApplianceAwsPublic) {
|
|
30
|
+
throw new Error('Invalid config');
|
|
31
|
+
}
|
|
32
|
+
|
|
27
33
|
if (args.config.dns.createZone) {
|
|
28
34
|
this.zone = new aws.route53.Zone(
|
|
29
35
|
`${name}-zone`,
|
|
@@ -91,6 +97,33 @@ export class ApplianceBaseAwsPublic extends pulumi.ComponentResource {
|
|
|
91
97
|
).arn;
|
|
92
98
|
}
|
|
93
99
|
|
|
100
|
+
const state = new aws.s3.Bucket(
|
|
101
|
+
`${name}-state`,
|
|
102
|
+
{
|
|
103
|
+
acl: 'private',
|
|
104
|
+
forceDestroy: true,
|
|
105
|
+
},
|
|
106
|
+
{ parent: this, provider: opts?.provider }
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
new aws.s3.BucketVersioning(
|
|
110
|
+
`${name}-state-versioning`,
|
|
111
|
+
{
|
|
112
|
+
bucket: state.bucket,
|
|
113
|
+
versioningConfiguration: { status: 'Enabled' },
|
|
114
|
+
},
|
|
115
|
+
{ parent: this, provider: opts?.provider }
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
new aws.s3.BucketServerSideEncryptionConfiguration(
|
|
119
|
+
`${name}-state-sse`,
|
|
120
|
+
{
|
|
121
|
+
bucket: state.bucket,
|
|
122
|
+
rules: [{ applyServerSideEncryptionByDefault: { sseAlgorithm: 'AES256' } }],
|
|
123
|
+
},
|
|
124
|
+
{ parent: this, provider: opts?.provider }
|
|
125
|
+
);
|
|
126
|
+
|
|
94
127
|
const lambdaOrigin = new aws.lambda.CallbackFunction(
|
|
95
128
|
`${name}-origin`,
|
|
96
129
|
{
|
|
@@ -224,5 +257,24 @@ export class ApplianceBaseAwsPublic extends pulumi.ComponentResource {
|
|
|
224
257
|
},
|
|
225
258
|
{ parent: this, provider: opts?.globalProvider }
|
|
226
259
|
);
|
|
260
|
+
|
|
261
|
+
this.config = {
|
|
262
|
+
name: name,
|
|
263
|
+
region: args.config.region,
|
|
264
|
+
stateBackendUrl: pulumi.interpolate`s3://${state.bucket}`,
|
|
265
|
+
domainName: args.config.dns.domainName,
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
new aws.ssm.Parameter(
|
|
269
|
+
`${name}-base-config`,
|
|
270
|
+
{
|
|
271
|
+
name: `/appliance/base/${name}/config`,
|
|
272
|
+
type: 'SecureString',
|
|
273
|
+
value: pulumi.jsonStringify(this.config),
|
|
274
|
+
},
|
|
275
|
+
{ parent: this, provider: opts?.provider }
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
this.registerOutputs(this.config);
|
|
227
279
|
}
|
|
228
280
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as pulumi from '@pulumi/pulumi';
|
|
2
|
-
import {
|
|
2
|
+
import { ApplianceBaseConfigInput, ApplianceBaseType } from '@appliance.sh/sdk';
|
|
3
3
|
|
|
4
4
|
export type ApplianceBaseAwsVpcArgs = {
|
|
5
|
-
config:
|
|
5
|
+
config: ApplianceBaseConfigInput;
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export interface ApplianceBaseAwsVpcOpts extends pulumi.ComponentResourceOptions {
|
|
@@ -14,5 +14,9 @@ export interface ApplianceBaseAwsVpcOpts extends pulumi.ComponentResourceOptions
|
|
|
14
14
|
export class ApplianceBaseAwsVpc extends pulumi.ComponentResource {
|
|
15
15
|
constructor(name: string, args: ApplianceBaseAwsVpcArgs, opts?: ApplianceBaseAwsVpcOpts) {
|
|
16
16
|
super('appliance-infra:appliance-base-aws-vpc', name, args, opts);
|
|
17
|
+
|
|
18
|
+
if (args.config.type !== ApplianceBaseType.ApplianceAwsVpc) {
|
|
19
|
+
throw new Error('Invalid config');
|
|
20
|
+
}
|
|
17
21
|
}
|
|
18
22
|
}
|