Not able to create and run a new Instance
rrajj opened this issue · comments
Rishav Raj commented
Expected behavior
Create a new instance and run a provided script.
Actual behavior
Nothing happens at the following line of code:
try {
console.log(in try block);
const response = await client.send(command);
console.log(response);
} catch (err) {
console.error(err);
}
Code just stops after printing in try block
. Checked the console, no errors there.
Steps to reproduce
// Create a new EC2 instance.
export const main = async () => {
const command = new RunInstancesCommand({
ImageId: 'ami-07caf09b362be10b8',
InstanceType: 't2.micro',
// Ensure only 1 instance launches.
MinCount: 1,
MaxCount: 1,
});
try {
const response = await client.send(command);
console.log(response);
} catch (err) {
console.error(err);
}
};```
2) Running the code should create and run an instance, BUT nothing happens at all.
Logs / stacktrace (if applicable)
2024-05-12T18:29:43.843Z 5f9b7776-03f7-4a6b-9e6a-246ea0ef1faa INFO in try block
END RequestId: 5f9b7776-03f7-4a6b-9e6a-246ea0ef1faa
REPORT RequestId: 5f9b7776-03f7-4a6b-9e6a-246ea0ef1faa Duration: 597.59 ms Billed Duration: 598 ms Memory Size: 128 MB Max Memory Used: 128 MB Init Duration: 647.20 ms
Which SDK were you using?
JavaScript (v3)
Which OS were you using?
Linux
SDK version
No response
OS version
Ubuntu 22
Rishav Raj commented
Also I have Administrator Access.
Corey Pyle commented
Hey @rrajj, is this in relation to a specific code example or a more general JS SDK question? If it's related to the SDK, you would need to go to https://github.com/aws/aws-sdk-js-v3
Rishav Raj commented
@cpyle0819 thanks. I will check that out