Unable to import EC2 instance with pulumi import command - go

I am running an EC2 instance on aws which I need to import to pulumi by running the following command pulumi import -f resources.json.
I have the following JSON file as my resource file resource.json.
{
"resources": [{
"type": "aws:ec2/instance:Instance",
"name": "my-server",
"id": "i-08f92a261a2ef6650",
"ami": "ami-0fdb3f3ff5d7c40db"
}
]
}
But get the following error:
aws:ec2:Instance (my-server):
error: aws:ec2/instance:Instance resource 'my-server' has a problem: Missing required argument: "instance_type": one of `instance_type,launch_template` must be specifie
d. Examine values at 'Instance.InstanceType'.
error: aws:ec2/instance:Instance resource 'my-server' has a problem: Missing required argument: "launch_template": one of `ami,instance_type,launch_template` must be sp
ecified. Examine values at 'Instance.LaunchTemplate'.
error: aws:ec2/instance:Instance resource 'my-server' has a problem: Missing required argument: "ami": one of `ami,launch_template` must be specified. Examine values at
'Instance.Ami'.
error: Preview failed: one or more inputs failed to validate

This is a bug, please see this GitHub issue:
https://github.com/pulumi/pulumi-aws/issues/1605
and this one: https://github.com/pulumi/pulumi/issues/7160#issuecomment-912093311
The best workaround at this stage is to define the EC2 instance in your code, and then set the import resource property as defined here

Related

Golang following container logs undeclared name Log

I'm trying to build a container with testcontainers and output the logs to stdout.
I have followed their documentation (https://golang.testcontainers.org/features/follow_logs/) but when writing the Accept function, I get an error:
func (g *TestLogConsumer) Accept(l Log) {
g.Msgs = append(g.Msgs, string(l.Content))
}
The problem is that I didn't import a certain package, so I can't use "Log".
I get the following error:
undeclared name: Log
The question is, which package should I import. How can I make vscode import these packages automatically for me ? I have installed the go extension, but it doesn't import anything automatically.

Account_locked_balance import not found

After updating near-bindgen and nearlib when trying to call one of our viewMethods through nearlib called get_all_markets
When calling the method I now get the following error:
Querying call/flux-test39/get_all_markets failed: wasm execution failed with error: FunctionCallError(LinkError("link error: Import not found, namespace: env, name: account_locked_balance")).
{
"error": "wasm execution failed with error: FunctionCallError(LinkError(\"link error: Import not found, namespace: env, name: account_locked_balance\"))",
"logs": []
}
I see that account balance locks are exposed since the last commit, is there any documentation around this?
It seems the PR (https://github.com/nearprotocol/nearcore/pull/1714) that introduces account_locked_balance is not merged into nearcore. Sorry about this. Please use the previous version of near-bindgen for now.
Here is the fix, sorry for that: https://github.com/nearprotocol/nearcore/pull/1873

invoking lambda function gives "errorMessage": "Cannot find module 'semver'"

I'm working on a lambda function and when I try to invoke it I get the following error
"errorMessage": "Cannot find module 'semver'".
details
Unable to import module 'dist/index': Error
If I add semver to package.json then it works fine. This started happening suddenly. A bit of background information, I'm using a monorepo with yarn and lerna.

Exported resources not working with puppet

I've written a module to set up the Prometheus node_exporter (in here called ni_trending). Now I need to add all FQDNs of the nodes to a simple file: So declaring an exported resource makes much sense here. PuppetDB is configured and working.
Here's the declaration, within my config.pp:
##node_exporter { "${listen_address}":
hostname => $ni_trending::hostname,
listen_port => $ni_trending::listen_port,
}
When the module is applied on the node I get following error:
Error: Could not retrieve catalog from remote server: Error 500 on
SERVER: Server Error: Evaluation Error: Error while evaluating a
Resource Statement, Invalid export in Class[Ni_trending]: {} is not a
resource on node ydixken-dev01.berlin.ni
Within the ni_trending module I'm retrieving all collected resources via:
Node_exporter <<| |>>
What is missing here?

Error while connecting Elastic Map Reduce ruby client

I am following the steps mentioned on the AWS to use an interactive Hive session using SSH.
I used the following resources
https://github.com/ucbtwitter/getting-started/wiki/Using-Elastic-Map-Reduce-via-Command-Line
http://docs.amazonwebservices.com/ElasticMapReduce/latest/GettingStartedGuide/SignUp.html
I was getting this error initially "Error: Missing key access-id" and then I fixed my JSON file. The JSON file is in the same format as mentioned in the above links.
When I run this command
./elastic-mapreduce
I am getting the following error :-
Error: Unable to parse credentials.json: can't convert String into Integer.
I checked the values required in JSON at AWS as well.
Does anyone has an idea why am I getting this error?
The region value in the credentials.json must be of int type.
{......
......
"region": 1
}

Resources