feat: Add availability_zone
output
#347
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added
availability_zone
output. Theavailability_zone
of the created instance is useful information to use outside of the module.Motivation and Context
When creating multiple EC2 instances in multiple AZs, in most cases, we would like to have the EBS volume in the same AZ as the created EC2. As a trick we can use
data.aws_instance
with loop or a map of AZs andrandom_suffle
,but it does not look nice. In my opinion having
availability_zone
output would get out of tricks and make the code cleaner and easier to read.This PR resolves #341 and #264
Breaking Changes
None
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectsDeployed
volume-attachment
example:pre-commit run -a
on my pull request