bored-coat-16933
02/25/2022, 8:27 AMechoing-dinner-19531
02/25/2022, 9:34 AMconst stackRef = new pulumi.StackReference(`${stack}`)
Keep in mind these need to be from the same backend login url. If you login to different filestate urls you can't currently get a stack reference from one while logged into another.bored-coat-16933
02/25/2022, 9:42 AMechoing-dinner-19531
02/25/2022, 10:31 AMpulumi stack ls --all
show that shared stack?bored-coat-16933
02/25/2022, 11:51 AMechoing-dinner-19531
02/25/2022, 11:59 AMI created an organisation in the pulumi config although.What do you mean by this?
pulumi login
for both of these stacks?bored-coat-16933
02/25/2022, 12:04 PMI created an organisation in the pulumi config although.
pulumi config set org OrgName
echoing-dinner-19531
02/25/2022, 12:07 PMls
call is really odd. Your develop stack in your screenshot is pulumi-poc-specific-develop, not just develop.bored-coat-16933
02/25/2022, 12:33 PMechoing-dinner-19531
02/25/2022, 3:32 PM$ pulumi config set companyStack YOUR_ORG/aws-ts-stackreference-company/dev
$ pulumi config set departmentStack YOUR_ORG/aws-ts-stackreference-department/dev
But I did:
$ pulumi config set companyStack dev
$ pulumi config set departmentStack dev-dept
because filestate doens't have orgs or projectsbored-coat-16933
02/28/2022, 8:06 AMechoing-dinner-19531
02/28/2022, 9:22 AMbored-coat-16933
02/28/2022, 1:44 PMpulumi:pulumi:Stack (specific-hohr.specific-dev):
error: Running program 'C:\work\temp\pulumi-nested\specific\bin\Debug\netcoreapp3.1\specific.dll' failed with an unhandled exception:
Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="invocation of pulumi:pulumi:getResource returned an error: unknown resource urn:pulumi:hohr.shared-dev::shared::azure-native:web:AppServicePlan::HoHr.Shared.AppServicePlan", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1646055774.763000000","description":"Error received from peer ipv4:127.0.0.1:53276","file":"..\..\..\src\core\lib\surface\<http://call.cc|call.cc>","file_line":1068,"grpc_message":"invocation of pulumi:pulumi:getResource returned an error: unknown resource urn:pulumi:hohr.shared-dev::shared::azure-native:web:AppServicePlan::HoHr.Shared.AppServicePlan","grpc_status":2}")
at async Task<InvokeResponse> Pulumi.GrpcMonitor.InvokeAsync(InvokeRequest request)
at async Task<SerializationResult> Pulumi.Deployment.InvokeRawAsync(string token, SerializationResult argsSerializationResult, InvokeOptions options) x 2
at async Task<(string urn, string id, Struct data, ImmutableDictionary<string, ImmutableHashSet<Resource>> dependencies)> Pulumi.Deployment.ReadOrRegisterResourceAsync(Resource resource, bool remote, Func<string, Resource> newDependency, ResourceArgs args, ResourceOptions options)
at async Task Pulumi.Deployment.CompleteResourceAsync(Resource resource, bool remote, Func<string, Resource> newDependency, ResourceArgs args, ResourceOptions options, ImmutableDictionary<string, IOutputCompletionSource> completionSources)
at async Task<T> Pulumi.Output<T>.GetValueAsync(T whenUnknown)
at async Task<string> Pulumi.Deployment+EngineLogger.TryGetResourceUrnAsync(Resource resource)
error: Running program 'C:\work\temp\pulumi-nested\specific\bin\Debug\netcoreapp3.1\specific.dll' failed with an unhandled exception:
Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="invocation of pulumi:pulumi:getResource returned an error: unknown resource urn:pulumi:hohr.shared-dev::shared::azure-native:resources:ResourceGroup::HoHr.Shared", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1646055774.771000000","description":"Error received from peer ipv4:127.0.0.1:53276","file":"..\..\..\src\core\lib\surface\<http://call.cc|call.cc>","file_line":1068,"grpc_message":"invocation of pulumi:pulumi:getResource returned an error: unknown resource urn:pulumi:hohr.shared-dev::shared::azure-native:resources:ResourceGroup::HoHr.Shared","grpc_status":2}")
at async Task<InvokeResponse> Pulumi.GrpcMonitor.InvokeAsync(InvokeRequest request)
at async Task<SerializationResult> Pulumi.Deployment.InvokeRawAsync(string token, SerializationResult argsSerializationResult, InvokeOptions options) x 2
at async Task<(string urn, string id, Struct data, ImmutableDictionary<string, ImmutableHashSet<Resource>> dependencies)> Pulumi.Deployment.ReadOrRegisterResourceAsync(Resource resource, bool remote, Func<string, Resource> newDependency, ResourceArgs args, ResourceOptions options)
at async Task Pulumi.Deployment.CompleteResourceAsync(Resource resource, bool remote, Func<string, Resource> newDependency, ResourceArgs args, ResourceOptions options, ImmutableDictionary<string, IOutputCompletionSource> completionSources)
at async Task<T> Pulumi.Output<T>.GetValueAsync(T whenUnknown)
at async Task<string> Pulumi.Deployment+EngineLogger.TryGetResourceUrnAsync(Resource resource)
echoing-dinner-19531
02/28/2022, 1:57 PMPlan.Get
?bored-coat-16933
02/28/2022, 2:01 PMechoing-dinner-19531
02/28/2022, 2:13 PMvar sharedStack = new Pulumi.StackReference("hohr.shared-dev");
var sharedPlanId = sharedStack.RequireOutput("SharedPlanId");
var resourceGroup = new ResourceGroup("Robtest");
var appService = new Pulumi.AzureNative.Web.WebApp("RobsSpecificApp", new Pulumi.AzureNative.Web.WebAppArgs
{
ServerFarmId = sharedPlanId,
ResourceGroupName = resourceGroup.Name
});
bored-coat-16933
02/28/2022, 2:19 PMCannot implicitly convert type 'Pulumi.Output<object>' to 'Pulumi.Input<string>
var sharedStack = new Pulumi.StackReference("hohr.shared-dev");
var sharedPlanId = sharedStack.RequireOutput("SharedPlanId").Apply(sharedPlanId => (string)sharedPlanId);
System.Console.WriteLine(sharedPlanId.ToString());
var resourceGroup = new ResourceGroup("Robtest");
var appService = new Pulumi.AzureNative.Web.WebApp("RobsSpecificApp", new Pulumi.AzureNative.Web.WebAppArgs
{
ServerFarmId = sharedPlanId,
ResourceGroupName = resourceGroup.Name
});
AppServiceId = appService.Id;
this compiles, but when running the same error appliesechoing-dinner-19531
02/28/2022, 2:31 PMOutput<T>
at that point, but it should work as an input to ServerFarmId
bored-coat-16933
02/28/2022, 2:39 PMechoing-dinner-19531
02/28/2022, 2:54 PM.Apply(id => (string)id)
thats needed because RequireOutput doesn't know what the remote type is. But the WriteLine(sharedPlanId)
won't print anything useful because sharedPlanId
is an Output<string> and ToString on an output just prints a warning message.sharedPlandId.Apply(id => WriteLine(id))
bored-coat-16933
02/28/2022, 3:01 PMechoing-dinner-19531
02/28/2022, 3:10 PMbored-coat-16933
03/01/2022, 8:29 AM