numerous-psychiatrist-20856
08/27/2020, 6:02 PMimport * as awsx from "@pulumi/awsx";
const repository = new awsx.ecr.Repository("repository");
export const ecrRepository = repository;
and application code:
import * as pulumi from "@pulumi/pulumi";
import * as awsx from "@pulumi/awsx";
const env = pulumi.getStack();
const infra = new pulumi.StackReference(`cakper/infrastructure/${env}`);
infra.requireOutput("ecrRepository").apply(repository => {
const repo = new awsx.ecr.Repository("repository", repository);
});
problem that I'm running into, is that I can't properly reference the repository and both stacks end up creating it. Can someone please help me wrap my head around it? 🙂faint-table-42725
08/27/2020, 6:09 PMget
on the resource and use it from there.
Something along these lines:
In the exporting stack: export const repositoryId = repository.id
In the importing stack, const repo = new awsx.ecr.Repository("repo", { repository: aws.ecr.Repository.get("ecrRepo", infra.requireOutput("repositoryId")) })
numerous-psychiatrist-20856
08/27/2020, 6:11 PMhundreds-musician-51496
08/27/2020, 7:24 PMnumerous-psychiatrist-20856
08/27/2020, 7:42 PM