Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add instance private IP to the outputs #241

Conversation

mustafa89
Copy link
Contributor

@mustafa89 mustafa89 commented Oct 6, 2021

Description

Added an output for the private_ip of the aws instance(s), similar to the public_ip.

Motivation and Context

I need the private IP as an output for referencing,

Breaking Changes

None

How Has This Been Tested?

  • I have tested and validated these changes using one or more of the provided examples/* projects

I tested against the volume-attachment example.

Also,

After discovering the module doesn't have a private_ip output. I cloned my fork, changed the source of the module in my original project to point to my local clone, and then re-ran terraform. The private_ip of the instance was then outputed.

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_ebs_volume.volume["eu-central-1a"] will be updated in-place
  ~ resource "aws_ebs_volume" "volume" {
        id                   = "<redacted>"
      ~ tags                 = {
          + "purpose" = "<redacted>"
            # (1 unchanged element hidden)
        }
        # (9 unchanged attributes hidden)
    }

  # aws_ebs_volume.volume["eu-central-1b"] will be updated in-place
  ~ resource "aws_ebs_volume" "volume" {
        id                   = "<redacted>"
      ~ tags                 = {
          + "purpose" = "<redacted>"
            # (1 unchanged element hidden)
        }
        # (9 unchanged attributes hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

Changes to Outputs:
  + ec2 = "10.64.0.221"

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: no

Apply cancelled.
❯ terraform --version
Terraform v1.0.0
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v3.51.0
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/tls v3.1.0

Your version of Terraform is out of date! The latest version
is 1.0.8. You can update by downloading from https://www.terraform.io/downloads.html
❯ terragrunt --version

@mustafa89 mustafa89 force-pushed the feature/instance-private-ip branch from e4211fb to a17306a Compare October 6, 2021 23:32
@antonbabenko
Copy link
Member

There were similar requests like this - #240

@bryantbiggs How about making an exception for private_ip and merge this PR?

@antonbabenko antonbabenko changed the title feature/outputs.tf: Add instance private IP to the outputs. feat: Add instance private IP to the outputs Oct 7, 2021
Copy link
Member

@bryantbiggs bryantbiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I can see use cases where private IP is a desirable output

@antonbabenko antonbabenko merged commit ae0c50e into terraform-aws-modules:master Oct 7, 2021
@antonbabenko
Copy link
Member

@mustafa89 Thank you for the addition.

v3.2.0 has been just released.

@antonbabenko antonbabenko mentioned this pull request Oct 7, 2021
@mustafa89
Copy link
Contributor Author

Thanks for the merge and for all your great work.

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants