How to share my AWS EC2 Reserved instance? - amazon-web-services

I want to know Is there any possibilities for sharing my Ec2 Reserved instance to some one or my another account.

Yes, it is possible and automatic provided the other account rolls up to the same consolidated billing account (and contains an instance of the same type, region, etc. as the reserved instance of course).
From AWS:
The pricing benefits of Reserved Instances are shared when the
purchasing account is part of a set of accounts billed under one
consolidated billing (CB) payer account.
Source/further detail: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-reserved-instances-billing.html

Related

terminate a member account in my aws organizations?(not the root account)

I want to terminate my member account(child account) in AWS organizations.
Will I still be charged for resources, that weren't manually deleted, owned by this account? or it will remove all resources? for example instances, backup, etc.
The best practice when closing an AWS account is to delete first all the resources because AWS might not automatically terminate all the active resources and will incur in additional cost.
Delete on-demand resources should not be a problem but any other types (e.g Reserved Instances, Saving Plans) will be still charged until the plan term ends.
The same concept apply to accounts that belongs to an Organization.
Reference:
Terminate resources on account closure
Closed account billing

AWS ec2 instance created so many other resources

I am new to AWS. I want to test my free tier. Today i created a free EC2.micro instance. Its working successfully, i didn't create anything else, but when i go to Resource Group -> Tag Editor and try to list all resources in all region, it is listing 168 resources
One is my EC2 instance (I created)
others are DHCPOptions, InternetGateway, NetworkAcl, Subnet, RouteTable, VPC, SecurityGroup, Volume, DBSecurityGroup with different regions (I don't why they are here)
I want to know all this above are come under free tier or its going to make a huge $$$ bill???
How can i see my billing live?
Some resources are created by AWS and are not charged.
One of the reasons you see so many resources is because AWS creates a VPC in each region for you. It also creates a default SG, Subnets, Routing Tables and so on.
They are not charged.
You can click on your organization name and then on My Billing Dashboard to see the current bill amount and a monthly estimate.
VPC is like your private space. It is a network isolation from other customers and provide all the basics needed for network and therefore it contains things like subnets, Internet Gateway, routes, NACL, Subnet, Security group... and are all free (except things like data transfer between subnets in different datacenters, but it is not your case)
You also have an EBS created, which is the disk for your EC2. There is a free tier for that, so after one year you will pay it, like your EC2.

AWS consolidated billing on reserved instances

My AWS infrastructure is part of consolidated billing provided by our client company.
There may be other accounts for different companies and are part of consolidated billing.
So, when I reserve an instance, do all other accounts within the consolidated billing umbrella enjoy the privileges?
Does it make sense to have reserved instances in consolidated billing environment if you don't want to share the benefits with other accounts?
Yes, when you use consolidated billing the cost-savings of a reserved instance can be spread/shared to any of the 'child' accounts - just like the savings you may get by combing your total S3 storage (for example).

EC2 instance billing type programmatically

I have reservation of type t2.micro and us-ease-1d availability zone, also I have multiple instances running, including the one with mentioned type and zone.
As a result I expect billing for this one instance will take into account the reservation. The problem is that I haven't found any link between reservation and actual instances.
I've used aws ec2 describe-instances and aws ec2 describe-reserved-instances CLI commands but I wasn't able to find any link.
Is it possible to realise which billing approach will be used for each instance using Amazon SDK?
So f.e. I will see that some instance is linked to some reserved instance (reservation)
Is it possible to realise which billing approach will be used for each instance using Amazon SDK?
No, it isn't.
The "link" between reserved instances and running instances is not something the EC2 operational infrastructure knows about. It's all done after the fact, in billing.
Each hour, for a given instance type and availability zone placement, you're billed for your reserved instances (depending on the terms of the reservation, this happens whether you have this many instances running or not, though in some cases, the amount billed here is $0 since you've already paid). Then, if the number of running on-demand instances for that type and placement exceeds exceeds the number of reserved instances for that type and placement, the difference for that hour is billed at the on-demand rate.
So if you had purchased one reserved instance matching a certain spec and during a given hour you had two such instances running, it's not really the case that one of your instances "is the reserved instance" and the other one isn't. If you stop either one, then the next hour, the reserved instance pricing applies to the one that remains running... but EC2 can't tell you which is which and, in fact, the billing logic is such that it doesn't matter.
There isn't really a link between reservations and specific instances. Think of it more like a discount that gets applied to your bill, after you have incurred some instance charges.
You can use the Reserved Instance Utilization Report to see how your reservations have been applied to the instance hours you have been charged for.

How do I associate an AWS EC2 instance with a purchased reserved instance?

We’ve purchased an Amazon Web Services (AWS) reserved instance for an Amazon Elastic Compute Cloud (EC2) instance that is critical to our infrastructure. This instance starts and stops every day at certain time interval.
I see that purchasing a reserved instance 'guarantees' that this instance will reliably start even when AWS is under heavy load, but is there any way to specifically tie this reserved instance to the instance we want to associate with it?
What happens if we add another instance that matches the exact criteria of the reserved instance we’ve purchased?
You don't need to worry or do anything in associating the instance and the purchased Reserved Instance; all those are done automatically by AWS.
The reserved Instance is purely a billing and cost related and it doesn't relate to the technology aspect of an EC2 instance. If any of your running instance matches with any of your purchased Reserved Instance then you benefit from the reduced costing. There isn't any commitment on the SLA or changes at the Instance level which involves Reserved Instance. The same case works when you have 2 reserved instances; if there 2 instances running in your account which matches your reserved instance purchase they the reduced cost would be applied.
Analogy - Super Market Coupon Offer
If the Offer Says, buy 2 units of Product A and get one Product B
absolutely Free. So you look into the offer and take 2 units of
Product A and one Unit of Product B. During the billing as well, the
Point of Sales Person also doesn't look into each and every product
and try to check it offers; rather he or she directly keeps scaning
each and every product against the bar-code scanner and that't it -
when these 3 are scanned, the price for Free-Product is automatically
reversed.
So similarly, you buy the Reserved Instance (Coupon) choosing the AMI,
Region, AZ, Duration etc. You would do all your tech stuff as usual
like deploying, patching, monitoring etc. During the billing, if the
instance(s) you launched matches the Reserved Instance, then the
Reserved pricing would be applied; if not that would be charged at
'On-Demand-Pricing'.
If there is a mismatch between what instance you are running and what instance you have reserved; you will not be using the benefit of Reserved-Instance pricing
and be charged with On-Demand-Pricing. Also you will be wasting the
investment done for the Reserved-Instance
As implied in Naveen's answer, there is no direct way to associate an instance with a reservation.
If you want the reliability, then you must launch instances with unique set of properties (instance type, az and AMI). There is no other way at the moment.
This is supposed to be a comment in Naveen's reply. But as I had no reputation yet to commen, I am adding it as an answer.