Can I access AWS Parameter store from Lightsail instance? - amazon-web-services

I have a spring boot server deployed in ec2 which uses Parameter store in System manager to keep the application secrets.
I want to deploy the same now on AWS Lightsail instance.
Please help if this is possible. if yes, how to do it.

Yes, you can do this, but not through instance roles (lightsale instances do not support roles). Instead you have to setup AWS credentials on the Lightsail instance as you would do on your local linux workstation.

Related

Static IP for internal communication in AWS for microservices

I have 7 Spring microservices with Eureka Server which I would like to deploy into AWS Elastic Beanstalk. Every time when I redeploy microservice I see that the url address is changed. Is it possible to use internal static IP for every AWS service?
I was also facing this problem with managing EB instances remotely, I have fixed this in two ways:
For myself I use eb ssh from EB CLI to remotely access instances. As the CLI gives you an option to select which instance you want to connect to if there are more than one. If your microservices are in a private subnet you need a bastion to connect to your instances remotely.
using AWS System manager / Session Manager
You can install a System manager agent on your elastic beanstalk environment using ebextensions. Using Systems managers; Session manager you can start a session towards your microservice and all your commands will be logged towards S3 (can be usefull for change management / complaincy)
As I want straight to these two options; I never fixed the issue where private IP's changed.

How to make connection with AWS EC2 instance and locate the hosted files

I am using a AWS console which show a running instance but when I check the storage in S3 there are no files in it. I have checked all the other storage options but unable to find any files. I need to check that which website is hosted on this instance. What can i do?
Moreover, I do not have .pem of the instance
I am working on a client website and we have a doubt that one of our website is hosted on AWS. We want to migrate that website from AWS to another host.
Please guide what is the best way to do this?
Thanks
Amazon EC2 uses Elastic Block Store (EBS) volumes for its file system, not S3. So if the web site is hosted by an EC2 instance, the files will most likely be stored on an EBS volume. To get access, you will probably need to log in to the instance using SSH or the AWS Session Manager. Alternatively, you can try and attach the volume to a different EC2 instance that you have access to.
Firstly S3 is for object storage, the instance runs off block storage using EBS and is where the file structure is located. Unless a job exists to manually copy content to S3 you will not find it there.
There are a few options you can perform to gain access:
You can try connecting using Sessions Manager assuming that the SSM Agent is running on the host.
You can try using instance connect if it is setup, this will allow you to use an SSH terminal by specifying a temporary pem.
You can create an AMI of the server and then launch a new instance from this AMI (the server will be running as if it is the server that you took the AMI from so be aware services will be running).
You can take a EBS snapshot of the server and attempt to launch a new volume from this. You would then mount it to a host.
Be aware that if this is a Windows host, connecting via regular RDP will require the Windows password of the host. If this is the case you will need to follow these instructions.

Creating VM in AWS

Recently I started to use Azure.
In Azure, I created Resources Group, Virtual Network, Availability Set and Virtual Machine.
Then I connected VM using RDP
Same way, I want to create and connect VM in AWS.
Please let me know, what steps I need to follow.
Virtual Machines on AWS are provided by the Amazon Elastic Compute Cloud service, more commonly known as Amazon EC2. Individual VMs are referred to as instances. Thus, the terminology to seek is "Amazon EC2 instance".
There are many ways to launch an Amazon EC2 instance, such as using a web interface, making an API call or using the AWS Command-Line Interface (CLI).
See: Launch Your Instance - Amazon Elastic Compute Cloud
To launch an instance from the EC2 management console, click Launch instance and provide the desired configuration.
See: Launching an Instance Using the Launch Instance Wizard - Amazon Elastic Compute Cloud

EC2 Instance doesn't become managed after installing SSM Agent

I've installed SSM Agent (2.2.607.0) on Windows Server 2012 R2 Standard instance with the EC2 Config (4.9.2688.0). After installing it, i cannot see the server on the Managed Instances screen. I did the same steps on other servers (Windows and Linux) and it worked.
Tried to uninstall the EC2 Config, reinstalled it again with no luck. Tried to install a different SSM Agent version (2.2.546.0) with no luck also.
Any thoughts?
The agent is installed, but the instance still needs the proper role to communicate with the systems manager. Particularly this step of Configuring Access to Systems Manager.
By default, Systems Manager doesn't have permission to perform actions
on your instances. You must grant access by using an IAM instance
profile. An instance profile is a container that passes IAM role
information to an Amazon EC2 instance at launch.
You should review the whole configuration guide and make sure you have configured all required roles appropriately.
I had this problem, and of the four troubleshooting steps - SSM Agent, IAM instance role, Service Endpoint connectivity, Target operating system type, it turned out that the problem was endpoint connectivity.
My VPC, Subnet, route table, and internet gateway all looked correct (and were identical to another instance which was being managed by SSM). But the instance didn't have a public IP, and without that you can't use the IGW. You can't use a VPC endpoint and an Internet Gateway. So adding a public IP allowed the instance to connect to SSM and become managed.
Extra complication : I was trying to use EC2 Image Builder, which creates an instance without a public IP. So there is no way to use Image Builder in a VPC which has an Internet Gateway.
New SSM agent version comes with a diagnostic package.. You can run that to see which prerequisites is missing.
https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-cli.html

Amazon Web Services - Using an existing EC2 instance as Beanstalk environment

I'm new to AWS, and I want to deploy a web application on an EC2 instance,
So far I've tried Elastic Beanstalk, but AWS always requires me to create a new Environment for the application instead of letting me choose an existing EC2 instance that I've created before.
Actually my main purpose is to set a policy group that allow HTTPS access, and idk how to set it to the "Environment" instance.
Any help is greatly welcome. :)
That is not currently viable, as you'd need to set up an AMI based on your instance and use a custom AMI for beanstalk, and that is not a trivial task. If you need to run a custom environment in Elastic Beanstalk, using Docker would be much easier.
But none of that is required to set a security group allowing HTTPS, you can configure security groups and HTTP/s listeners for ELBs on you Environment configuration.