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

Add ip_configuration block to private endpoints #1691

Merged

Conversation

fschirinzi
Copy link
Contributor

@fschirinzi fschirinzi commented Jul 11, 2023

Issue-1689

PR Checklist


Description

Currently, it is not possible to define a static IP-address for private endpoints by defining the ip_configuration block, which is supported in the Private-Endpoint Terraform Resource >3.21.0.
This PR enables reading the ip_configuration from the settings property.

Does this introduce a breaking change

  • YES
  • NO

Testing

Copy link
Member

@arnaudlh arnaudlh left a comment

Choose a reason for hiding this comment

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

thanks for the PR @fschirinzi, are you able to add an self-contained example so we can run your code/examples in CI/CD?
thanks
Arnaud

@fschirinzi
Copy link
Contributor Author

@arnaudlh Hi Arnaud.
I updated the example. Does it work now?

Copy link
Member

@arnaudlh arnaudlh left a comment

Choose a reason for hiding this comment

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

hi @fschirinzi,

I can see there that could be multiple ip_configuration blocks as per https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint#ip_configuration.

I think config file should be like that:

        ip_configurations = {
          static1= {          
            name               = "kv01_rg1-name"
            private_ip_address = "10.150.100.140"
            subresource_name   = "vault"
            member_name        = "default"
          }
          static2 = {
            name               = "kv02_rg1-name"
            private_ip_address = "10.150.100.150"
          }
        }

and the code like:

  dynamic "ip_configuration" {
    for_each = try(var.settings.ip_configurations, {})

...

Try and let me know if ok with it?

examples/networking/private_endpoint/configuration.tfvars Outdated Show resolved Hide resolved
@fschirinzi
Copy link
Contributor Author

fschirinzi commented Jul 26, 2023

You are right. The one or more block was introduced in a later version than the one mentioned by me (3.21.0).
I missed also, that the used version is 3.56.0.

I'll work on it.

@fschirinzi
Copy link
Contributor Author

@arnaudlh Should work now. Can you test please?

Copy link
Member

@arnaudlh arnaudlh left a comment

Choose a reason for hiding this comment

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

LGTM

You can test this module outside of a landingzone using

```bash
sudo terraform init
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sudo terraform init
terraform init


```

sudo terraform plan -var-file examples/networking/private_endpoint/configuration.tfvars
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sudo terraform plan -var-file examples/networking/private_endpoint/configuration.tfvars
terraform plan -var-file examples/networking/private_endpoint/configuration.tfvars


```

sudo terraform plan -var-file examples/networking/private_endpoint/configuration.tfvars
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sudo terraform plan -var-file examples/networking/private_endpoint/configuration.tfvars
terraform plan -var-file examples/networking/private_endpoint/configuration.tfvars

@@ -0,0 +1,19 @@
You can test this module outside of a landingzone using
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
You can test this module outside of a landingzone using
You can test this module outside of a rover using

@arnaudlh arnaudlh added this to the 5.7.3 milestone Aug 3, 2023
@arnaudlh arnaudlh merged commit c136c92 into aztfmod:main Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request private endpoints
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Feature request - Define an IP-configuration for private endpoints
3 participants