Pulumi.Aws.Invokes.GetCallerIdentity throws System.NullReferenceException
See original GitHub issue- Language: dotnet
Description of issue
await Pulumi.Aws.Invokes.GetCallerIdentity();
always throws exception.
error: Running program 'D:\git\infra\pulumi\sandbox\bin\Debug\netcoreapp3.0\Infra.dll' failed with an unhandled exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Pulumi.Deployment.InvokeAsync[T](String token, ResourceArgs args, InvokeOptions options, Boolean convertResult)
at Program.<>c.<<Main>b__0_0>d.MoveNext() in D:\work\infra\pulumi\sandbox\Program.cs:line 17
--- End of stack trace from previous location where exception was thrown ---
at Pulumi.Stack.RunInitAsync(Func`1 init)
at Pulumi.Output`1.GetValueAsync()
at Pulumi.Deployment.RegisterResourceOutputsAsync(Resource resource, Output`1 outputs)
at Pulumi.Deployment.Runner.WhileRunningAsync()
Minimum reproduce
- run
pulumi new aws-csharp
- add
await Pulumi.Aws.Invokes.GetCallerIdentity();
to Program.cs. - run
pulumi up
- throw exception on preview.
using System.Collections.Generic;
using System.Threading.Tasks;
using Pulumi;
class Program
{
static Task<int> Main()
{
return Deployment.RunAsync(async () =>
{
await Pulumi.Aws.Invokes.GetCallerIdentity();
});
}
}
It also happens even if I explicitly made provider for profile
or AccessKey
.
var provider = new Pulumi.Aws.Provider("sandbox", new Pulumi.Aws.ProviderArgs
{
Profile = "my-provider",
Region = "ap-northeast-1",
});
await Pulumi.Aws.Invokes.GetCallerIdentity(new InvokeOptions{Provider = provider,});
var provider = new Pulumi.Aws.Provider("sandbox", new Pulumi.Aws.ProviderArgs
{
AccessKey = "INPUT_ACCESSKEY",
SecretKey = "INPUT_SECRETKEY",
Region = "ap-northeast-1",
});
await Pulumi.Aws.Invokes.GetCallerIdentity(new InvokeOptions{Provider = provider,});
Expected behavior
get GetCallerIdentityResult
.
Actual behavior
throws exception.
Version
$ pulumi version
v1.5.1
$ pulumi plugin ls
NAME KIND VERSION SIZE INSTALLED LAST USED
aws resource 1.10.0 185 MB 2 minutes ago 2 minutes ago
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
aws.getCallerIdentity - Pulumi
Documentation for the aws.getCallerIdentity function with examples, input properties, output properties, and supporting types.
Read more >aws.lambda.Invocation - Pulumi
Use this resource to invoke a lambda function. The lambda function is invoked with the RequestResponse invocation type. NOTE: This resource only ...
Read more >aws.lambda.Function - Pulumi
Documentation for the aws.lambda.Function resource with examples, input properties, output properties, lookup functions, and supporting types.
Read more >aws.lambda.Permission - Pulumi
using System.Collections.Generic; using System.Text.Json; using Pulumi; using Aws = Pulumi.Aws; return await Deployment.RunAsync(() => { var defaultTopic ...
Read more >aws.lambda.getFunction - Pulumi
ARN to be used for invoking Lambda Function from API Gateway. kmsKeyArn string. ARN for the KMS encryption key. lastModified string.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Try adding
<PackageReference Include="Pulumi" Version="1.6.0-preview" />
@pgavlin Yes, should be fixed with Pulumi Nuget
1.5.2-preview