rhythmic-whale-48997
01/30/2023, 9:46 AMrenderYamlToDirectory
and then create this file on GitHub with @pulumi/github
However, I need to call pulumi up
twice. Is there a way to dump yaml files and then to read them in one go? Already tried dependsOn
but it's not working.
Sample code that I'm using for PoC
// Instantiate a Kubernetes Provider and specify the render directory.
const provider = new k8s.Provider("render-yaml", {
renderYamlToDirectory: "./samples/rendered",
enableServerSideApply: true
});
const s3 = new kx.Secret("credentials-s3", {
metadata: {
name: "credentials-s3"
},
stringData: {
"access-key-id": "access",
"secret-access-key": "secret"
}
}, {
provider
});
fs.readdirSync(path.resolve(__dirname, "samples/rendered/1-manifest/")).forEach(file => {
const fileContent = fs.readFileSync(path.resolve(__dirname, `samples/rendered/1-manifest/${file}`), "utf-8")
if (file.includes("v1-configmap")) {
const yaml = load(fileContent) as k8s.core.v1.ConfigMap;
new github.RepositoryFile(`files-${yaml.metadata.name}`, {
repository: tenantsRepository.name,
file: `./tenants/${yaml.metadata.namespace}/configmaps/${yaml.metadata.name}.yaml`,
content: fileContent,
branch: "master",
overwriteOnCreate: true
})
}
});