sparse-intern-71089
09/18/2023, 2:59 PMdry-keyboard-94795
09/18/2023, 3:03 PMimport
it (docs)
but be mindful that either stack can delete it.
You could also use the .get()
method for one of the stacks. In your case, prod
creates it, and staging
would use .get
millions-pharmacist-626
09/18/2023, 3:04 PMmillions-pharmacist-626
09/18/2023, 3:04 PMdry-keyboard-94795
09/18/2023, 3:05 PMlittle-library-54601
09/18/2023, 3:05 PMmillions-pharmacist-626
09/18/2023, 3:06 PMcurrent_stack = pulumi.get_stack()
if current_stack == 'staging':
resource = aws.Resource(...)
else:
resource = aws.Resource().get()
correct ?dry-keyboard-94795
09/18/2023, 3:07 PMmillions-pharmacist-626
09/18/2023, 3:07 PMlittle-library-54601
09/18/2023, 3:10 PMvar stagingStackReference = new StackReference("staging");
var communicationsServicesConnectionStringOutput = stagingStackReference.GetOutput("CommunicationsServicesConnectionString");
var signalRConnectionStringOutput = stagingStackReference.GetOutput("SignalRConnectionString");
I don't need the import, I believe, because I'm explicitly outputting the values I need for "production" when the "staging" stack runs.millions-pharmacist-626
09/18/2023, 3:11 PMbillowy-army-68599
millions-pharmacist-626
09/18/2023, 5:06 PMbillowy-army-68599
billowy-army-68599
millions-pharmacist-626
09/18/2023, 5:12 PMyou have one AWS account?yep, only one
I’d generally make this its own Pulumi project in this situation and have a single stack in thereyeah sometimes I do this, in this specific case I couldn't be assed to do so and was wondering if there was a specific alternative. The stack check that has been suggested above is good enough tbh