Remotely start (trigger) an EC2 amazon windows server with an URL - amazon-web-services

My server is stopped when idle (no more charge from aws), but I'm trying to figure out an easy way to send a command via the web to the AWS control to start my Windows EC2 server. I look everywhere and can't find anything easy to implement.

Based on the comments. API gateway with lambda proxy integration. The lambda will start the instance. A good tutorial on the lambda and api gateway setup is here:
Build an API Gateway API with Lambda Integration

Related

Expose websocket endpoint for RabitMQ from aws Broker

I have launched a RabbitMQ instance from AWS Broker service. I plan to be able to connect to this from my frontend application too and as such would want a websocket endpoint. I am wondering if AWS exposes a websoket endpoint natively? I came across some documentation which had images showing a wss endpoint under the connection details in the aws console. Please find the attached image for reference.
I don't see this option under the connection of my aws console. Image for reference
I could always launch a separate instance and have it work as a relay, but was just wondering if this is available from within AWS

Spring boot microservice( Api Gatway) on aws

and trying to deploy micro-services build in spring boot on aws but didn't know which aws service is suitable for perticular spring micro-service(Could Config, Service Discovery, Api Gatway, and vault).
I build an api gateway service on spring boot, but when it comes to deployment on aws i got confused with the aws api gateway.
Do we need both of the to work together? or we can just setup springBoot Api gatway on ec2 instance.
And its out of context but, do we need separate ec2 for small service like 'Service Discovery', 'Config Service' etc.
thanks
API Gateway is just a kind of routing to your application, no matter if it is hosted on serverless platform or on EC2 container.
You can try to deploy your Spring Boot app on AWS Lambda environment and this way you don't have to think of configuring the server environment. You have to be awarded the cold start of the application in this case. You can google more about it how to solve this problem.
API Gateway is like facade in front of your microservices for communication with external services. There are several ways to use/implement API gateway depending on requirements such as Request Routing, API composition(calling multiple services and combining responses), Authentication, Caching etc.
AWS API gateway is good if you need request routing feature but it can't perform API composition. In such case you need to implement your own custom API gateway using technologies such as Spring Cloud Gateway & Reactive programming.
GraphQL is another popular technology to implement API Gateway.
P.S. - Service Discovery is another concept. In real life you will use Kubernetes or Service Mesh which will internally do Service Registry and Discovery.

Daily assign all Application Load Balancers to WAF

In my development environment, we constantly create and destroy applications for testing. I would like all Application Load Balancers (ALB) to be placed behind our single AWS Web Application Firewall (WAF) daily through a Lambda script. I want a trigger to run a script that finds all ALBs and then assigns them to the WAF. I can't seem to figure out which boto3 client I should be using to execute this in Python 3.8. Any guidance? Thanks
I suggest use cloudtrail event, using lambda look for elb creation event and connect them to waf.
And I assume you are using SAM or serverless for lambda deployment.
Some usefull link
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-cloudtrail-logs.html
https://docs.aws.amazon.com/lambda/latest/dg/with-cloudtrail-example.html

How can I set up Web Sockets on AWS and log incoming messages to s3 (elastic beanstalk project) mysql db

I have an existing LAMP project on AWS (Elastic-beanstalk). I now what to set up web sockets on AWS too. According to AWS documentation, the way to do that is via AWS API Gateway. I don't know how this all works but there's documentation I found for setting up WebSockets.
Does the Gateway API connect to another service? If so, what service is this? What am I missing?
I mostly just want to make a Web Socket service to look incoming messages to the MySQL database on my Elastic-beanstalk project. I am totally confused about how to do this. Can anyone advise me about what steps I need to take?
Just because api gateway supports web sockets, doesn't mean you need to use it. ALBs do as well and are a more exact fit for elastic beanstalk.
Does an Application Load Balancer support WebSockets?
AWS doesn't support PHP (Ratchet) Web Sockets

AWS Api Gateway local testing/development

We've got dockerized microservices in AWS, all behind an API Gateway and accessible via REST. Authentication is managed by the API Gateway.
Is there any possibility to test those REST-microservices on a local machine (including authentication/api gateway logic)? Is there a possibility to make the API Gateway echo back the requests to my local machine and to call the microservices running locally? What is best practice for testing API Gateway managed authentication locally?
To use the AWS API Gateway locally, spin up SAM locally using the SAM CLI. There are however limits to what you can do with SAM, so you may not be able to do what you need to do locally. For example, websockets are still not supported (as of Sept 2020) as far as I know.
Instead of voting this answer down, please add a comment to provide other important information.
SAM stands for Serverless Application Model. See the Quickstart Guide for Developing Serverless Apps using SAM.
Other links:
Running API Gateway Locally
AWS CLI (required to run the SAM CLI)
Install the SAM CLI
SAM CLI Reference
Unfortunately, API Gateway doesn't offer local testing/development solutions at the moment.
To call the microservices locally a workaround could be to use Private integration on API Gateway which would use VPCLink. VPCLink will connect to services running within a VPC via NLB. For example, the setup would be API Gateway --> VPCLink Integration --> NLB --> EC2 instance (for example, acts as proxy) --> calls local service (VPC connects to local network via Direct connect)
Although a complicated setup but a possible workaround