-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update debug settings * Run as debug mode * Improve logging * Fix error
- Loading branch information
1 parent
257fd4b
commit 007884a
Showing
8 changed files
with
162 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Import the necessary AWS SDK clients and commands | ||
import { EC2Client, DescribeInstancesCommand } from "@aws-sdk/client-ec2"; | ||
|
||
// Create an EC2 client | ||
const client = new EC2Client(); | ||
|
||
// Lambda handler function | ||
export const handler = async () => { | ||
const command = new DescribeInstancesCommand({}); | ||
|
||
// Send the command to the EC2 client | ||
const response = await client.send(command); | ||
|
||
// Extract instances information | ||
const instances = response.Reservations.flatMap( | ||
(reservation) => reservation.Instances | ||
); | ||
|
||
// Return the list of instances | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(instances), | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const handler = () => { | ||
return "hello"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.