Skip to content

Commit

Permalink
Add VectorDb component
Browse files Browse the repository at this point in the history
  • Loading branch information
fwang committed Jan 5, 2024
1 parent fd7a688 commit 4c5986f
Show file tree
Hide file tree
Showing 24 changed files with 1,210 additions and 338 deletions.
59 changes: 1 addition & 58 deletions examples/playground/sst.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,63 +15,6 @@ export default $config({
};
},
async run() {
return {
// testThrowInApply(),
...testProviderOutput(),
//...testHostedZoneLookup(),
output: "output",
};
new sst.VectorDb("VectorDB", {});
},
});

function testProviderOutput() {
interface Random {
num: number;
}

const randomprovider: pulumi.dynamic.ResourceProvider = {
async create(inputs) {
return { id: "foo", outs: { num: "foo" } };
},
};

class Random extends pulumi.dynamic.Resource {
constructor(name: string, opts?: pulumi.CustomResourceOptions) {
super(randomprovider, name, { num: undefined }, opts);
}
}
const random = new Random("Random");
return { r: random.num, r2: "hi" };
}

function testHostedZoneLookup() {
const zone = new sst.HostedZoneLookup("Zone", {
domain: "a.sst.sh",
});
console.log(zone);
return { zoneId: zone.zoneId, p: "foweih" };
zone.zoneId.apply((id) => {
console.log("zoneId", id);
});
}

function testThrowInApply() {
// Observations:
// 1. Has to be related to await aws.route53.getZone because if I replace that
// with a component error, the error is caught right away.
// 2. Only happens when there are 2 components in the chain

const zoneId = pulumi.output("foo").apply(async (domain) => {
throw new Error("hi");
});

const fn = new aws.lambda.Function(`Function`, {
role: zoneId,
});

new aws.lambda.Function(`Function2`, {
role: fn.arn,
});

return {};
}
Loading

0 comments on commit 4c5986f

Please sign in to comment.