This message was deleted.
# getting-started
s
This message was deleted.
b
You are looking for some variation of workspace.projectSettings or workspace.getProjectSettings depending on your language
It is not a method on the stack but rather the parent workspace
r
but I don’t have access to parent workspace
b
Yes you do. The static selectStack function is an API that handles setting up the workspace for you. So there are other APIs that you can use to construct your LocalWorkspace before you instantiate your stack, or you can access the Workspace property in your stack
r
The stack that I’m trying to access is already being initiated. I wan’t to
select
the stack using some
args
it’s true that I can add this info (project name) inside the args but that make it de-coupled from the name inside the
pulumi.yaml
file. I don’t want to write the name of the project twice. just want to read it from the yaml file. if I could read the value from the
pulumi.yaml
before creating the
args
object i would be good also. again, I’m using automation api.
b
You can do that. Just look at the APIs to construct a LocalWorkspace that return the workspace instead of pre-selecting the stack. Make sure you are giving it only the directory with the existing pulumi.yaml